Before using an ECS to create a private image, you need to change disk identifiers to UUID in the GRUB file of the ECS.
Modify the menu.lst or grub.cfg file (/boot/grub/menu.lst, /boot/grub/grub.cfg, /boot/grub2/grub.cfg, /boot/grub/grub.conf, or /boot/efi/EFI/euleros/grub.cfg), и настройте загрузочный раздел, используя UUID.
Корневой раздел, указанный в файле конфигурации, отличается в зависимости от ОС. Он может быть root=/dev/xvda или root=/dev/disk.
blkid
Отображается следующая информация:
/dev/xvda1: UUID="ec51d860-34bf-4374-ad46-a0c3e337fd34"/dev/xvda1: UUID="ec51d860-34bf-4374-ad46-a0c3e337fd34" TYPE="ext3"/dev/xvda5: UUID="7a44a9ce-9281-4740-b95f-c8de33ae5c11"/dev/xvda5: UUID="7a44a9ce-9281-4740-b95f-c8de33ae5c11" TYPE="swap"
cat /boot/grub/grub.cfg
Отображается следующая информация:
......menuentry 'Ubuntu Linux, with Linux 3.13.0-24-generic' --class ubuntu --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.13.0-24-generic-advanced-ec51d860-34bf-4374-ad46-a0c3e337fd34' {recordfailload_videogfxmode $linux_gfx_modeinsmod gzioinsmod part_msdosinsmod ext2if [ x$feature_platform_search_hint = xy ]; thensearch --no-floppy --fs-uuid --set=root ec51d860-34bf-4374-ad46-a0c3e337fd34elsesearch --no-floppy --fs-uuid --set=root ec51d860-34bf-4374-ad46-a0c3e337fd34fiecho 'Loading Linux 3.13.0-24-generic ...'linux /boot/vmlinuz-3.13.0-24-generic root=/dev/xvda1root=/dev/xvda1 roecho 'Loading initial ramdisk ...'initrd /boot/initrd.img-3.13.0-24-generic}
vi /boot/grub/grub.cfg
cat /boot/grub/grub.cfg
Изменение успешно, если отображается информация, похожая на следующую:
......menuentry 'Ubuntu Linux, with Linux 3.13.0-24-generic' --class ubuntu --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.13.0-24-generic-advanced-ec51d860-34bf-4374-ad46-a0c3e337fd34' {recordfailload_videogfxmode $linux_gfx_modeinsmod gzioinsmod part_msdosinsmod ext2if [ x$feature_platform_search_hint = xy ]; thensearch --no-floppy --fs-uuid --set=root ec51d860-34bf-4374-ad46-a0c3e337fd34elsesearch --no-floppy --fs-uuid --set=root ec51d860-34bf-4374-ad46-a0c3e337fd34fiecho 'Loading Linux 3.13.0-24-generic ...'linux /boot/vmlinuz-3.13.0-24-generic root=UUID=ec51d860-34bf-4374-ad46-a0c3e337fd34root=UUID=ec51d860-34bf-4374-ad46-a0c3e337fd34 roecho 'Loading initial ramdisk ...'initrd /boot/initrd.img-3.13.0-24-generic}
blkid
Отображается следующая информация:
/dev/xvda1: UUID="749d6c0c-990a-4661-bed1-46769388365a"/dev/xvda1: UUID="749d6c0c-990a-4661-bed1-46769388365a" TYPE="swap"/dev/xvda2: UUID="f382872b-eda6-43df-9516-5a687fecdce6"/dev/xvda2: UUID="f382872b-eda6-43df-9516-5a687fecdce6" TYPE="ext4"
cat /boot/grub/grub.conf
Отображается следующая информация:
default=0timeout=5splashimage=(hd0,1)/boot/grub/splash.xpm.gzhiddenmenutitle CentOS (2.6.32-573.8.1.el6.x86_64)root (hd0,1)kernel /boot/vmlinuz-2.6.32-573.8.1.el6.x86_64 ro root=/dev/xvda2root=/dev/xvda2 rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=autoKEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quietinitrd /boot/initramfs-2.6.32-573.8.1.el6.x86_64.img
vi /boot/grub/grub.conf
cat /boot/grub/grub.conf
Изменение успешно, если отображается информация, похожая на следующую:
default=0timeout=5splashimage=(hd0,1)/boot/grub/splash.xpm.gzhiddenmenutitle CentOS (2.6.32-573.8.1.el6.x86_64)root (hd0,1)kernel /boot/vmlinuz-2.6.32-573.8.1.el6.x86_64 ro root=UUID=f382872b-eda6-43df-9516-5a687fecdce6root=UUID=f382872b-eda6-43df-9516-5a687fecdce6 rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=autoKEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quietinitrd /boot/initramfs-2.6.32-573.8.1.el6.x86_64.img
blkid
Отображается следующая информация:
/dev/xvda2: UUID="4eb40294-4c6f-4384-bbb6-b8795bbb1130"/dev/xvda2: UUID="4eb40294-4c6f-4384-bbb6-b8795bbb1130" TYPE="xfs"/dev/xvda1: UUID="2de37c6b-2648-43b4-a4f5-40162154e135"/dev/xvda1: UUID="2de37c6b-2648-43b4-a4f5-40162154e135" TYPE="swap"
cat /boot/grub2/grub.cfg
Отображается следующая информация:
......menuentry 'CentOS Linux (3.10.0-229.el7.x86_64) 7 (Core)' --class fedora --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-229.el7.x86_64-advanced-4eb40294-4c6f-4384-bbb6-b8795bbb1130' {load_videoset gfxpayload=keepinsmod gzioinsmod part_msdosinsmod xfsset root='hd0,msdos2'if [ x$feature_platform_search_hint = xy ]; thensearch --no-floppy --fs-uuid --set=root --hint='hd0,msdos2'4eb40294-4c6f-4384-bbb6-b8795bbb1130elsesearch --no-floppy --fs-uuid --set=root 4eb40294-4c6f-4384-bbb6-b8795bbb1130filinux16 /boot/vmlinuz-3.10.0-229.el7.x86_64 root=/dev/xvda2root=/dev/xvda2 ro crashkernel=auto rhgb quiet LANG=en_US.UTF-8initrd16 /boot/initramfs-3.10.0-229.el7.x86_64.img}
vi /boot/grub2/grub.cfg
cat /boot/grub2/grub.cfg
Изменение выполнено успешно, если отображается информация, похожая на следующую:
......menuentry 'CentOS Linux (3.10.0-229.el7.x86_64) 7 (Core)' --class fedora --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-229.el7.x86_64-advanced-4eb40294-4c6f-4384-bbb6-b8795bbb1130' {load_videoset gfxpayload=keepinsmod gzioinsmod part_msdosinsmod xfsset root='hd0,msdos2'if [ x$feature_platform_search_hint = xy ]; thensearch --no-floppy --fs-uuid --set=root --hint='hd0,msdos2'4eb40294-4c6f-4384-bbb6-b8795bbb1130elsesearch --no-floppy --fs-uuid --set=root 4eb40294-4c6f-4384-bbb6-b8795bbb1130filinux16 /boot/vmlinuz-3.10.0-229.el7.x86_64 root=UUID=4eb40294-4c6f-4384-bbb6-b8795bbb1130root=UUID=4eb40294-4c6f-4384-bbb6-b8795bbb1130 ro crashkernel=auto rhgb quiet LANG=en_US.UTF-8initrd16 /boot/initramfs-3.10.0-229.el7.x86_64.img}