Mailinglist Archive: opensuse (818 mails)

< Previous Next >
[opensuse] Re: software RAID vs BIOS RAID
  • From: Joachim Schrod <jschrod@xxxxxxx>
  • Date: Sat, 17 Sep 2011 15:28:45 +0200
  • Message-id: <j527ad$gc$1@dough.gmane.org>
James Knott wrote:
Joachim Schrod wrote:
James Knott wrote:
Per Jessen wrote:
John Andersen wrote:

At one time there was a problem having /boot on raid, and its been a
while since I had to reconfigure a fresh box, so I don't know if this
is still the case.


With lilo it works fine, but I don't know about grub.

It doesn't work with grub. With RAID and also LVM, /boot has to be on a
regular partition.

Here LVM is the problem, not RAID-1.

With RAID-1 via md and no LVM, /boot on a mirrored ext3/ext4
filesystem definitively works with grub. We use it since several
years, and had enough disk errors to prove it working. One needs to
take care that grub bootloader is installed on both disks, though,
openSUSE doesn't do this itself during installation. Extra
robustness comes with stanzas that name both disks, in case hd0 is
not visible to the BIOS any more and hd1 suddenly gets hd0.


I was wondering about that. Also, the boot menu points to a specific
kernal. How does that get updated with RAID 1?

/boot is mirrored, so any change (any new kernel and any boot menu)
is written to both disks.

E.g., let's assume /boot is on /dev/md0 that is a mirrored device
made up from /dev/sda1 and /dev/sdb1. Now let's have two stanzas:

title Desktop -- openSUSE 11.4 1st disk - 2.6.37.6-0.7
root (hd0,0)
kernel /vmlinuz-2.6.37.6-0.7-desktop root=/dev/md2 noresume
quiet showopts nowatchdog vga=0x317 ipv6.disable=1
initrd /initrd-2.6.37.6-0.7-desktop

title Desktop -- openSUSE 11.4 2nd disk - 2.6.37.6-0.7
root (hd1,0)
kernel /vmlinuz-2.6.37.6-0.7-desktop root=/dev/md2 noresume
quiet showopts nowatchdog vga=0x317 ipv6.disable=1
initrd /initrd-2.6.37.6-0.7-desktop

When one does a grub setup one both disks (I usually install it in
the MBR), grub's bootloader, named stage 1 and stage 1.5, is
installed on both disks. I.e., one calls

# umount /boot
# grub
grub> root (hd0,0) # this is /boot on /dev/sda1
grub> setup (hd0) # MBR-Setup on 1st disk
grub> root (hd1,0) # this is /boot on /dev/sdb1
grub> setup (hd1) # MBR-Setup on 2nd disk
grub> quit
# mount /boot

During boot from either disks, it will look at the first partition
of the respective disk, will use its build-in filesystem driver,
and will access /boot/grub/menu.lst on that filesystem. (That's the
reason why you need a symlink boot -> . on /boot.) Then it gets
kernel and initrd from the first partition (accessed as ext3/ext4
filesystem, not as a mirrored device!!) and loads that. initrd
contains the md kernel module and assembles the raid devices. At
this point during boot, /dev/md? is available. Therefore we can now
mount /dev/md2 as root and later /dev/md0 on /boot.

This works because software raid (md, don't know if that works with
dmraid as well) doesn't create a special layout on its partition if
the md partition is just mirrored and not striped. Beneath it all,
there is still a straight-forward filesystem on that partition, and
grub knows how to handle that filesystem. I.e., after unmounting
/boot and stopping RAID on /boot (mdadm --stop md0), one *can*
mount both filesystems in the regular way, no problem, mount -t
ext4 /dev/sda1 /boot works. This md feature is the base for grub
booting from mirrored filesystems.

HTH,
Joachim

--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Joachim Schrod Email: jschrod@xxxxxxx
Roedermark, Germany

--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >