Table of Contents

Install raid1 and lvm for Kubuntu

Hardware configuration

Brief problem description

I started off installing Kubuntu Feisty 7.04. Within the partitioner, I could not set up lvm. I could not get past the error message “Error informing the kernel about modifications to /dev/md2p1 –Invalid argument”, no matter what I did. I even zeroed all partition tables with dd, but whenever I entered LVM config the partitioner recognized md0, md1, md2 and the usage as lvm. I'm not quite sure how this is possible, I even started doubting my new hardware.

After several hours I decided to go back to Kubuntu 6.10, with which I still could not install lvm, but I could properly install the 2 multidisk (raid1) configurations (md0: /, md1: swap, md2: /srv). md2 = /srv was a necessary intermediate step, because lvm did not configure through on Edgy either, so I formatted it with ext3.

Remarks for the walkthrough below

Desired configuration of the disks

hdd partition raid1 lvm mount point
sda sda1 md0 - /
sdb sdb1 md0
sda sda2 md1 - swap
sdb sdb2 md1
sdc sdc1 md2 vg1, lv1, lv2 /home, /srv
sdd sdd1 md2
sde sde1 - vg2, lv3 /backup

Install Base

  1. Install Kubuntu Edgy (6.10) Alternate Install: F6-F6-Expert Mode
  2. Install Raid1 with MD package activated
  3. DO NOT install LVM during initial setup
  4. Boot into KDE from HD

Install LVM

  1. lvm > pvcreate /dev/sde1 > pvcreate /dev/md2
  2. lvm > vgcreate vg_backup /dev/sde1 > vgcreate vg_data /dev/md2
  3. lvm > vgdisplay vg_backup to check ### of free extents (following steps same for vg_data, but 2 logical volumes)
  4. lvm > lvcreate -l### vg_backup (do not use -LxxGB, use size with -l### which is number of extents)
  5. lvm > lvrename vg_backup lvol0 lv_backup
  6. lvm > vgcfgbackup to backup volume group configurations
  7. lvm > exit
  8. umount /home > umount /srv
  9. mkfs -t ext3 /dev/vg_backup/lv_backup > mkfs -t ext3 /dev/vg_data/lv_home > mkfs -t ext3 /dev/vg_data/lv_srv
  10. mkdir /backup
  11. mount /dev/vg_backup/lv_backup /backup > mount /dev/vg_data/lv_home /home > mount /dev/vg_data/lv_srv /srv

Done! Everything works now!