问题描述:

一个硬盘做RAID0,使用Clonezilla克隆硬盘到另外一个RAID0 disk ,使用克隆好的硬盘开机,发现suse 系统报错 couldn't find /dev/disk/by-id/scsi-xxxx .. 

原理分析:

OS记录硬盘的ID,使用克隆之后的硬盘开机,系统无法找到记录的硬盘ID,导致开机失败。

设备命名方式参考如下链接:

https://wiki.archlinux.org/index.php/Persistent_block_device_naming_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)#by-id_.E5.92.8C_by-path


解决方式:

 挂载安装光盘,进入rescue模式,挂载系统目录到mnt. 修改原系统的/etc/fstab 和elilo.conf

原fstab

/dev/disk/by-id/scsi-3600605b00ac2f7f0224be6730ce1fe6d-part5 swap                 swap       defaults              0 0

/dev/centos/swap     swap                 swap       defaults              0 0

/dev/disk/by-id/scsi-3600605b00ac2f7f0224be6730ce1fe6d-part6 /                    ext3       acl,user_xattr        1 1

/dev/disk/by-id/scsi-3600605b00ac2f7f0224be6730ce1fe6d-part4 /boot/efi            vfat       umask=0002,utf8=true  0 0

proc                 /proc                proc       defaults              0 0

sysfs                /sys                 sysfs      noauto                0 0

debugfs              /sys/kernel/debug    debugfs    noauto                0 0

usbfs                /proc/bus/usb        usbfs      noauto                0 0

devpts               /dev/pts             devpts     mode=0620,gid=5    

修改后:

/dev/sda5 swap                 swap       defaults              0 0

/dev/centos/swap     swap                 swap       defaults              0 0

/dev/sda6 /                    ext3       acl,user_xattr        1 1

/dev/sda4 /boot/efi            vfat       umask=0002,utf8=true  0 0

proc                 /proc                proc       defaults              0 0

sysfs                /sys                 sysfs      noauto                0 0

debugfs              /sys/kernel/debug    debugfs    noauto                0 0

usbfs                /proc/bus/usb        usbfs      noauto                0 0

devpts               /dev/pts             devpts     mode=0620,gid=5       0 0


原elilo.conf 

# This file has been transformed by /sbin/elilo.

# Please do NOT edit here -- edit /etc/elilo.conf instead!

# Otherwise your changes will be lost e.g. during kernel-update.

#

# Modified by YaST2. Last modification on Thu Apr 12 12:09:19 EDT 2018

timeout = 80

##YaST - boot_efilabel = "SUSE Linux Enterprise Server 11 SP4"

default = SLES11_SP4

prompt


image = vmlinuz-3.0.101-63-default

###Don't change this comment - YaST2 identifier: Original name: linux###

    label = SLES11_SP4

    append = "resume=/dev/disk/by-id/scsi-3600605b00ac2f7f0224be6730ce1fe6d-part5 splash=silent crashkernel=256M-:128M showopts "

    initrd = initrd-3.0.101-63-default

    root = /dev/disk/by-id/scsi-3600605b00ac2f7f0224be6730ce1fe6d-part6


image = vmlinuz-3.0.101-63-default

###Don't change this comment - YaST2 identifier: Original name: failsafe###

    label = failsafe

    append = "showopts ide=nodma apm=off noresume edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe   "

    description = "Failsafe (3.0.101-63-default)"

    initrd = initrd-3.0.101-63-default

    root = /dev/disk/by-id/scsi-3600605b00ac2f7f0224be6730ce1fe6d-part6

修改后:

# Modified by YaST2. Last modification on Thu Apr 12 12:09:19 EDT 2018

timeout = 80

##YaST - boot_efilabel = "SUSE Linux Enterprise Server 11 SP4"

default = SLES11_SP4

secure-boot = off

prompt


image = /boot/vmlinuz-3.0.101-63-default

###Don't change this comment - YaST2 identifier: Original name: linux###

    label = SLES11_SP4

    append = "resume=/dev/disk/by-id/scsi-3600605b00ac2f7f0224be6730ce1fe6d-part5 splash=silent crashkernel=256M-:128M showopts "

    initrd = /boot/initrd-3.0.101-63-default

    root = /dev/dev/sda6


image = /boot/vmlinuz-3.0.101-63-default

###Don't change this comment - YaST2 identifier: Original name: failsafe###

    label = failsafe

    append = "showopts ide=nodma apm=off noresume edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe   "

    description = Failsafe

    initrd = /boot/initrd-3.0.101-63-default

    root = /dev/disk/by-id/scsi-3600605b00ac2f7f0224be6730ce1fe6d-part6