Protecting against disk failure with LVM Raid

Daniel Pittman daniel at rimspace.net
Tue Oct 3 09:52:29 UTC 2006


Nils <elitepenguin at gmx.net> writes:

> Ubuntu supports LVM RAID with the installer. I would like to setup a
> RAID 1 with 2 (S)ATA disks, so that if one disk fails, the system is
> still fully operational. However I don't have experience with LVM
> RAID, so here are a few questions:

I would recommend using the 'md' RAID subsystem rather than LVM
mirroring, as it has a much longer history and is correspondingly better
tested.

> - How does it work with grub? Can i have /boot also on RAID, or do I
> have to create a seperate parition for it?

I can't speak for LVM mirroring, but my understanding is that like md
software RAID GRUB is simply unaware of it.

So, you boot of (hd0) which it reads as a normal hard disk, and the
kernel then handles RAID setup during the boot sequence.

Sadly, grub doesn't presently duplicate the bootloader data between the
disks, which means that you need to do that manually, or otherwise
provide for booting if the current primary disk fails.

> - If I setup the software RAID, how can I test if it will work if a
> disk fails. Just pull the plug on the drive will not work I think (or
> depends if the controller supports hot swapping?)

Actually it would work, because your system would have a catastrophic
fault on the disk you pulled and, then, you would see what happens in
the worst case. ;)

However, an easier test is to power the machine off, disconnect the
drive, then power the machine back on.

> - How do I get noticed when one of the drives fails?

With MD you run the 'mdadm' software in monitor mode.  That will notify
you by email when a disk fails.

I am not aware of any equivalent functionality for LVM, although EVMS
may have something hidden somewhere.

> - If a disk fails I normally get some very strange kernel errors and
> the box freezes.  Is it possible that the box also freezees if I use
> RAID?

Absolutely.  However you have a greater chance of your machine
surviving than without RAID -- if the system reports a disk fault MD
(and LVM) will eject the faulty disk and carry on normally.

So, as long as the fault doesn't cause the disk, controller, or system
to fail you should be fine.  Er, that does happen it practice as well.

Regards,
        Daniel
-- 
Digital Infrastructure Solutions -- making IT simple, stable and secure
Phone: 0401 155 707        email: contact at digital-infrastructure.com.au
                 http://digital-infrastructure.com.au/





More information about the ubuntu-server mailing list