Working example of LVM + RAID?

Thomas Neumann blacky+fai at fluffbunny.de
Thu Jun 14 12:03:13 CEST 2012


> What would be the best path to follow? Mirror the whole disks and put
> all the partitioning onto the md0 device? Or create partitions on both
> disks independently and then pair these up in RAID? At what level is it
> best to introduce LVM?

For _GRUB1_ configurations my typical suggestion is:

/dev/sda1: /boot (1)
/dev/sda2: [swap1]
/dev/sda3: MD-dev1

/dev/sda1: /boot (2)
/dev/sda2: [swap2]
/dev/sda3: MD-dev2

MD-dev1 and MD-dev2 are combined into a RAID1, this /dev/md0 is used as a
physical volume for LVM. /root is a logical volume. System boots from (and
mounts) one of the /boot volumes, the other one is unmounted.

rationale:
a) GRUB1 can't boot a LVM-volume, therefore a non-LV /boot (or root)
volume is required
b) it is unwise to put (all) swap into LVM-volumes because a deadlock can
occur if memory gets really tight

This setup is _not_ 100% automatic
- someone has to copy the contents of the mounted /boot filesystem to the
backup filesystem
- the MBR must be copied to the backup disc
- one of the discs may fail and cause loss of the swap space's content

The swapspace issue may be circumvented by raid1-ing the swap device too.
But then again: A system that is using the swap space is probably close to
un-usable anyway. (Except if swap-space is pre-allocated like oracle
does.)


GRUB2 can boot a LVM-Volume. It might be possible to drastically simplify
this setup.



More information about the linux-fai mailing list