Rich Freeman on 8 Mar 2013 12:51:08 -0800


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Booting from a RAID partition?


On Fri, Mar 8, 2013 at 3:11 PM, Eric Lucas <eric@lucii.org> wrote:
> I have a Red Hat 5.x box with RAID (software) mirroring:
> Two drives, sda and sdb
>
> /dev/md0   /boot      (/dev/sda1  and /dev/sdb1)
> /dev/md1  /             ( /dev/sda2  and /dev/sdb2)
> /dev/md2   <swap>     ( /dev/sda13 and /dev/sdb3)
> /dev/md3  /home      (/dev/sda4  and /dev/sdb4)
>
> When I remove sda and replace it with a blank drive (partitioned and
> formatted) the system is unable to boot.
> I get the normal grub menu but after hitting the return key I get:
>
>>  root (hd0,0)
>>   Filesystem type is ext2fs, partition type 0xfd
>>  kernel /vmlinuz-2.6..18-164.el5 ro root=/dev/md1 rhgb quiet crashkernel=64M@48M
>>
>>  Error  15: File not found
>>
>>  Press any key to continue...
>
> When I remove sdb and replace it with a blank drive (partitioned and
> formatted) the system is unable to boot - it tries the CD/DVD device
> and then just sits there... no grub.

The issue is with your grub configuration.  I'm never quite sure if I
have my own config right so I'm hesitant to lecture, but you need to
install grub on both drives, and for each one point it to the
appropriate root on the same drive, but keeping in mind that the drive
number could change if others disappear.

It would be nice if grub could use some kind of GUID and search for
the root when drives renumber.

It must be booting off of sdb in your current setup, but when it looks
for hd0,0 it might be looking at your now-blank sda and not finding
it.  On the other hand, when you remove sdb you probably removed the
only drive with grub installed.

You need to install grub on both drives, you probably need to set them
both to boot off of hd0,0, and you probably need to set sda as your
boot drive.  If you replace it you need to set sdb as your new boot
drive.

At least, I /think/ that's about right - grub can be a real pain at
times and I can't say I've had the time to go unplugging drives left
and right testing various scenarios out.  I'm down to only 5 drives in
my RAIDs now.

Oh, I wish that you could do RAID1 across more than two drives (active
mirroring, not just spares).

Rich
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug