Preparing the system for drive failure, Copying the partition table, Installing grub on the mbr – Dell Software RAID with Red Hat Enterprise Linux4 User Manual
Page 7

Software RAID with Red Hat Enterprise Linux 4
5
Preparing the System for Drive Failure
This section provides information on preparing the system for restoring RAID configuration to a
failed drive. Once the RAID devices are configured and the operating system has been
installed you can:
•
Create a backup copy of the partition table
•
Install GRUB (GRand Unified Bootloader) on the Master Boot Record (MBR) of each drive
Copying the Partition Table
To copy a partition table, create a directory to store the partition information, and use the sfdisk
command to write partition information files for each disk into that directory.
mkdir /raidinfo
sfdisk -d /dev/sda > /raidinfo/partitions.sda
sfdisk -d /dev/sdb > /raidinfo/partitions.sdb
The partition tables for both drives are stored on the mirrored partition so that in the event of a
drive failure, the other drive contains the pertinent partition information from which to rebuild
the partition.
Installing GRUB on the MBR
During the RAID configuration and operating system installation process, GRUB is installed on the
MBR of the primary hard drive (sda) only. However, if the primary disk drive fails, the system can
be booted by using a boot disk only. To avoid this problem, install GRUB on the MBR of each drive.
To install GRUB on the MBR of the secondary drive, temporarily define the secondary drive as the
primary disk. To do so, identify sdb as hd0, and instruct GRUB to write the MBR to the
secondary drive.
To enter the GRUB shell, type grub at the command prompt.
At the prompt grub>:
device (hd0) /dev/sdb
root (hd0,0)
setup (hd0)
GRUB displays all the commands that run in the background of the setup command, and then
returns a message that the setup command succeeded. Both drives now have an MBR, and the
system can boot off either drive.