royong
30-04-2006, 19:59
This HOWTO will help you to install GRUB on to the "mirrored" hard disk of a software RAID1 configuration. In usual cases, in a software RAID1 configuration, GRUB is only installed on HDA and not installed on HDC. This prevents HDC from booting up after a hard disk failure on HDA - thereby decreasing the usability of a system. This presumes that you have corrected installed and setup RAID1 during the installation process [anaconda or text]
First up, the following will help obtain a copy of the partition schemas that you have maded for HDA and HDC.
mkdir /root/raidpartition
fdisk -l
sfdisk -d /dev/hda > /root/raidpartition/partitions.hda
sfdisk -d /dev/hdc > /root/raidpartition/partitions.hdc
Next, the following will help install the GRUB proper
grub
grub>find /grub/stage1 This will give you where all the grub setup files are located. On my raid1 mirror system listed:
(hd0,0)
(hd1,0)
grub>device (hd0) /dev/hdc
grub>root (hd0,0)
grub>setup (hd0)
grub>quit
That's all. In a situation where you need to restore or replace a faulty hard disk in a software RAID1 configuration, you will need to physically shutdown the server and replace the faulty hard disk. Thereafter, you will need to perform the following:
sfdisk /dev/hdc < /raidinfo/partitions.hdc
raidhotadd /dev/md0 /dev/hdc1
raidhotadd /dev/md1 /dev/hdc2
raidhotadd /dev/md2 /dev/hdc3
cat /proc/mdstat I have 3 partitions on my partion schemas for HDA and HDC
/boot
/
swap
I know its not the best disk partitioning schema, but it works right? LOL.
First up, the following will help obtain a copy of the partition schemas that you have maded for HDA and HDC.
mkdir /root/raidpartition
fdisk -l
sfdisk -d /dev/hda > /root/raidpartition/partitions.hda
sfdisk -d /dev/hdc > /root/raidpartition/partitions.hdc
Next, the following will help install the GRUB proper
grub
grub>find /grub/stage1 This will give you where all the grub setup files are located. On my raid1 mirror system listed:
(hd0,0)
(hd1,0)
grub>device (hd0) /dev/hdc
grub>root (hd0,0)
grub>setup (hd0)
grub>quit
That's all. In a situation where you need to restore or replace a faulty hard disk in a software RAID1 configuration, you will need to physically shutdown the server and replace the faulty hard disk. Thereafter, you will need to perform the following:
sfdisk /dev/hdc < /raidinfo/partitions.hdc
raidhotadd /dev/md0 /dev/hdc1
raidhotadd /dev/md1 /dev/hdc2
raidhotadd /dev/md2 /dev/hdc3
cat /proc/mdstat I have 3 partitions on my partion schemas for HDA and HDC
/boot
/
swap
I know its not the best disk partitioning schema, but it works right? LOL.