2

I am preparing for a minimal Ubuntu Server 12.04 LTS that will simply run libvirt/KVM to host a handful of Ubuntu Server 12.04 LTS guests. On my KVM host I created a RAID 1 comprised of two physical disks. With the resulting volume I used LVM to create space for the root filesystem, swap, and a sizable partition for /var (as this is where my KVM guests will live.)

  • Is it advisable to install the boot volume on a LVM volume that resides on a software RAID?
  • What are best practices?
  • What should be taken into consideration when configuring LVM on a software RAID?
Michael Hampton
  • 237,123
  • 42
  • 477
  • 940
sardean
  • 833
  • 3
  • 14
  • 34

1 Answers1

1

mdraid and LVM2 are stable. Modern Linux distributions can boot this setup directly without any issues.

There aren't too many special considerations.

You will want to ensure grub is installed on each individual disk so that the system can still boot in the event of a disk failure.

You may want to leave some of the volume group free to take advantage of LVM snapshots.

Mark Sturgill
  • 889
  • 5
  • 9
  • Can you elaborate as to how one would install Grub on each individual disk? Wouldn't applying the RAID configuration and the LVM on top of it destroy anything on the disk? – sardean Feb 19 '14 at 02:49
  • 1
    If you created the RAID array through the Ubuntu installer you should already have grub installed on both members of the array. If that wasn't the case (and assuming you have two disks, /dev/sda and /dev/sdb) 'grub-install /dev/sdb' is generally all that would be necessary. Also see: http://unix.stackexchange.com/questions/25513/is-grub-installed-to-all-the-mbr-of-a-raid-array-by-default-by-the-debian-instal – Mark Sturgill Feb 19 '14 at 03:02
  • Pardon my ignorance but with LVM on top of the RAID is this still applicable? /boot will reside on an LVM partition. Or is the LVM partitioning insignificant. – sardean Feb 19 '14 at 03:31
  • 1
    grub is typically installed to the MBR. mdraid and LVM aren't really a factor at this level. Your system needs to locate a bootloader (grub) to boot. You have two mirrored disks. If grub is only installed on one of the disks and that disk fails then you will be unable to boot the degraded array from the single remaining disk that does not have a bootloader installed. That being said, Ubuntu's 12.04 installer should have installed grub onto both disks of your RAID-1 array for you. – Mark Sturgill Feb 19 '14 at 03:38