Server Administration & Management

Software RAID issue after reboot of OS

After successful installation of OS, if there are some problem to boot os in one Hard-drive, as grub issue like kernel panic or grub error 17 or other issue

1. Reboot the machine in Rescue mode

Boot: linux rescue

# chroot /mnt/sysimages
# mkdir /a
# mount /dev/sdaX /a
# cd /a

# cat /proc/mdstat (UU means both disk are live)

2. Run the following commands to hotadd and rebuild the array

# mdadm /dev/md0 –add /dev/sda1
# mdadm /dev/md1 –add /dev/sda2
# mdadm /dev/md2 –add /dev/sda3

# grub-install /dev/md0    OR

# grub (GRUB shell type above command to reinstall the boot loader on both drives & reboot.)

grub> device (hd0) /dev/sda
grub> root (hd0,0)
grub> setup (hd0)

grub> device (hd1) /dev/sdb
grub> root (hd1,0)
grub> setup (hd1)

grub> quit

This is show on /boot/grub/device.map

grub> find /grub/stage1 (Find out which are the hard disks on which you can install grub)

This file show in /boot/grub/device.map

grub> device (hd0) /dev/sda
grub> root (hd0,0)
grub> setup (hd0)

January 20, 2014 Posted by | RAID, Tips & Tricks, Unix/Linux | , , , | Leave a comment