* 標準だとgrub2はファイルシステムのUUIDを元にどのデバイスかを区別しており、このままだと複製したbackup diskから起動しようとした時にそのUUIDのファイルシステムがのったデバイスがないといってrescue modeに落ちてしまいます。
* そこでUUIDで区別しないようにgrub2を設定してみます
====== grub2からuuidを排除 ======
* /etc/default/grubの#GRUB_DISABLE_LINUX_UUID=true
をコメントアウト
* 以下のパッチを当てる
[root@archlinux-proxmox grub]# diff -ur /usr/share/grub/grub-mkconfig_lib /backup/usr/share/grub/grub-mkconfig_lib
--- /usr/share/grub/grub-mkconfig_lib 2012-08-07 22:24:23.649377433 +0900
+++ /backup/usr/share/grub/grub-mkconfig_lib 2012-08-07 22:24:38.432711843 +0900
@@ -146,20 +146,20 @@
done
fi
- # If there's a filesystem UUID that GRUB is capable of identifying, use it;
- # otherwise set root as per value in device.map.
- fs_hint="`"${grub_probe}" --device "${device}" --target=compatibility_hint`"
- if [ "x$fs_hint" != x ]; then
- echo "set root='$fs_hint'"
- fi
- if fs_uuid="`"${grub_probe}" --device "${device}" --target=fs_uuid 2> /dev/null`" ; then
- hints="`"${grub_probe}" --device "${device}" --target=hints_string 2> /dev/null`" || hints=
- echo "if [ x$feature_platform_search_hint = xy ]; then"
- echo " search --no-floppy --fs-uuid --set=root ${hints} ${fs_uuid}"
- echo "else"
- echo " search --no-floppy --fs-uuid --set=root ${fs_uuid}"
- echo "fi"
- fi
+# # If there's a filesystem UUID that GRUB is capable of identifying, use it;
+# # otherwise set root as per value in device.map.
+# fs_hint="`"${grub_probe}" --device "${device}" --target=compatibility_hint`"
+# if [ "x$fs_hint" != x ]; then
+# echo "set root='$fs_hint'"
+# fi
+# if fs_uuid="`"${grub_probe}" --device "${device}" --target=fs_uuid 2> /dev/null`" ; then
+# hints="`"${grub_probe}" --device "${device}" --target=hints_string 2> /dev/null`" || hints=
+# echo "if [ x$feature_platform_search_hint = xy ]; then"
+# echo " search --no-floppy --fs-uuid --set=root ${hints} ${fs_uuid}"
+# echo "else"
+# echo " search --no-floppy --fs-uuid --set=root ${fs_uuid}"
+# echo "fi"
+# fi
}
grub_get_device_id ()
* grub-install /dev/sda
====== backupディスクにgrubを書き込む ======
* 以下のような状況の場合を説明しています
* mount /dev/sdb3 /backup
* mount /dev/sdb1 /backup/boot
* mount -t proc proc /backup/proc
* mount –bind /dev /backup/dev
* chroot /backup
* grub-install /dev/sdb
====== grub rescueモードでの操作 ======
* ls
* ls (hd0,msdos1)/grub
* set prefix=(hd0,msdos1)/grub
* insmod (hd0,msdos1)/grub/i386-pc/normal.mod
* normal