An aide memoire to myself for setting up Ubuntu with LVM at install time:
- At the disk partitioning screen select Manual
- Select a drive (if they are new drives then they will require partition tables)
- Select free space on the drive and choose to create a new partition. First off we need a /boot partition of 100MB which is of the primary type and starts at the beginning of the disk. Select the /boot mount point for this partition and ensure that you have selected the bootable flag.
- Repeat the last step to create a SWAP partition of about twice the size of your RAM.
- The rest of the disks holding the /boot and SWAP partitions can now be used to hold an LVM containing the / filesystem for the machine.
- Select the free space on your first disk.
- Choose to make it a physical volume for LVM
- Repeat this step for any other drives that will be part of the LVM
- Select "Configure the Logical Volume Manager"
- Select "Create volume group"
- Give the group a name - this can be anything but should be easy to remember. I just used machinename_vg1
- Select which physical volumes will be part of the volume group
- Select "Create a logical volume"
- Select the volume group that will contain the new logical volume
- Name the logical volume, e.g. machinename_lv1
- Enter the size for the logical volume
- Select finish
- In the main menu select the volume group
- Select to use the volume as Ext3
- Select to mount the volume as the / file system
- Finish the regular Ubuntu install
Of course one gotcha with LVM appears to be that unless you are combining the volumes with RAID then you could lose your entire logical volume, spanned acroos all of the disks, if you lose a single physical volume to a hardware fault. I would like to be proven wrong on this, and don't want to find out the hard way so I don't currently have data solely in an LVM file system - I merely use it as a convenience for a live file system that is completely backup up elsewhere.