G.3.5 GRUBマスター・ブート・レコードおよびHBAブート順序のリストア
スワップ・パーティションをリストアした後、Grand Unified Bootloader (GRUB)のマスター・ブート・レコードをリストアできます。
device.map
ファイルによって、オペレーティング・システム・デバイスにBIOSドライブがマップされます。次に、デバイス・マップ・ファイルの例を示します。
# this device map was generated by anaconda (hd0) /dev/sda (hd1) /dev/sdb
ただし、GRUBデバイス・マップはシンボリック・リンクをサポートしていないため、デバイス・マップ内のマッピングは/dev/disk/by-hba-slot
によって使用されているものと一致しない場合があります。この手順では、必要に応じてデバイス・マップを修正する方法について説明します。
GRUBのブート・レコードをリストアするには、次の手順を実行します。
-
ドライブがslot1で使用しているカーネル・デバイスを確認します。
# ls -ld /dev/disk/by-hba-slot/s1 lrwxrwxrwx 1 root root 9 Apr 22 12:54 /dev/disk/by-hba-slot/s1 -> ../../sdb
-
ステップ
1
に示すとおり、出力に/dev/sdbが表示されている場合は、次のステップ(GRUBのオープン)に進みます。別のデバイス(
/dev/sdn
など)が表示されている場合は、まずhd1
が正しいデバイスを指すように設定する必要があります。-
device.map
ファイルのコピーを作成します。# cd /boot/grub # cp device.map mydevice.map # ls -l *device* -rw-r--r-- 1 root root 85 Apr 22 14:50 device.map -rw-r--r-- 1 root root 85 Apr 24 09:24 mydevice.map
-
mydevice.map
を編集して、hd1
が新しいデバイスを指すようにします。この例では、ステップ1
でs1
が/deb/sdnを指していました。# more /boot/grub/mydevice.map # this device map was generated by bda install (hd0) /dev/sda (hd1) /dev/sdn
-
残りのステップでは、編集したデバイス・マップ(
mydevice.map
)を使用します。
-
-
ここに示すように
device.map
を使用するか、編集したmydevice.map
を使用して、GRUBをオープンします。# grub --device-map=/boot/grub/device.map GNU GRUB version 0.97 (640K lower / 3072K upper memory) [ Minimal BASH-like line editing is supported. For the first word, TAB lists possible command completions. Anywhere else TAB lists the possible completions of a device/filename. ]
-
/dev/sda
の場合はhd0、/dev/sdb
の場合はhd1を入力して、ルート・デバイスを設定します。grub> root (hdn,0) root (hdn,0) Filesystem type is ext2fs, partition type 0x83
-
/dev/sda
の場合はhd0、/dev/sdb
の場合はhd1を入力して、GRUBをインストールします。grub> setup (hdn) setup (hdn) Checking if "/boot/grub/stage1" exists... no Checking if "/grub/stage1" exists... yes Checking if "/grub/stage2" exists... yes Checking if "/grub/e2fs_stage1_5" exists... yes Running "embed /grub/e2fs_stage1_5 (hdn)"... failed (this is not fatal) Running "embed /grub/e2fs_stage1_5 (hdn,0)"... failed (this is not fatal) Running "install /grub/stage1 (hdn) /grub/stage2 p /grub/grub.conf "... succeeded Done.
-
GRUBコマンドライン・インタフェースを終了します。
grub> quit
-
HBAのブート・ドライブが正しく設定されていることを確認します。
# MegaCli64 /c0 show bootdrive
BootDrive VD:0が設定されている場合、コマンド出力は次のようになります。
Controller = 0 Status = Success Description = None Controller Properties : ===================== ---------------- Ctrl_Prop Value ---------------- BootDrive VD:0 ----------------
BootDrive VD:0が設定されていない場合、コマンド出力に
「No Boot Drive」
と表示されます。Controller = 0 Status = Success Description = None Controller Properties : ===================== ---------------- Ctrl_Prop Value ---------------- BootDrive No Boot Drive ----------------
-
ブート・ドライブが設定されていないことが
MegaCli64 /c0 show bootdrive
によって報告された場合は、次のように設定します。# MegaCli64 /c0/v0 set bootdrive=on Controller = 0 Status = Success Description = None Detailed Status : =============== ----------------------------------------- VD Property Value Status ErrCd ErrMsg ----------------------------------------- 0 Boot Drive On Success 0 - ------------------------------------------
-
ブート・ドライブが設定されたことを確認します。
# MegaCli64 /c0 show bootdrive Controller = 0 Status = Success Description = None Controller Properties : ===================== ---------------- Ctrl_Prop Value ---------------- BootDrive VD:0 ----------------
-
自動選択ブート・ドライブ機能が有効であることを確認します。
# MegaCli64 adpBIOS EnblAutoSelectBootLd a0 Auto select Boot is already Enabled on Adapter 0.
-
構成を確認します。「ディスク構成の確認」を参照してください。