Obnova GRUBu u RAID 1

Po selhání disku v RAID 1 je třeba také obnovit nastavení GRUBu.
Tento postup je obdobně možné použít i pro obnovu grubu na jednom disku.

Nejprve pomocí příkazu fdisk -l zjistíme jaké disky máme.
Může to být např.  sda a sdb.

Zde je výpis postupu:

root@internet mnt]#grub
(nyní grub2-install /dev/sdx

GRUB  version 0.93  (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.]

grub> device (hd0) /dev/hda
nebo device (hd0) /dev/sda
grub> root (hd0,0)
Filesystem type is ext2fs, partition type 0xfd

grub> setup (hd0)
Checking if „/boot/grub/stage1“ exists… yes
Checking if „/boot/grub/stage2“ exists… yes
Checking if „/boot/grub/e2fs_stage1_5“ exists… yes
Running „embed /boot/grub/e2fs_stage1_5 (hd0)“…  16 sectors are embedded.
succeeded
Running „install /boot/grub/stage1 (hd0) (hd0)1+16 p (hd0,0)/boot/grub/stage2 /boot/grub/grub.conf“… succeeded
Done.

grub> device (hd1) /dev/hdc

nebo device (hd1) /dev/sdb

grub> root (hd1,0)
Filesystem type is ext2fs, partition type 0xfd

grub> setup (hd1)
Checking if „/boot/grub/stage1“ exists… yes
Checking if „/boot/grub/stage2“ exists… yes
Checking if „/boot/grub/e2fs_stage1_5“ exists… yes
Running „embed /boot/grub/e2fs_stage1_5 (hd1)“…  16 sectors are embedded.
succeeded
Running „install /boot/grub/stage1 (hd1) (hd1)1+16 p (hd1,0)/boot/grub/stage2 /boot/grub/grub.conf“… succeeded
Done.

grub>quit
[root@internet mnt]#

A je to 🙂