So, this is how it worked for me, but: PLEASE KEEP IN MIND THAT MESSING WITH PARTITIONS MAY CAUSE DATA LOSS!!! SO BACK UP YOUR DATA!!!
OK, having that said, let's begin by getting the default Ubuntu Lucid Lynx desktop live iso from here, burn it to CD and boot from it. When you're being asked to either try it out or install Ubuntu, go for the first option. Once the desktop is loaded, open a terminal from the "Applications" menu and install lvm2:
# sudo apt-get update
# sudo apt-get install lvm2
As I already created logical volumes with the alternate installer, all I had to do is make them active:
# sudo vgchange -ay
If you don't have your logical volumes created already, do so now. I guess if you want/need logical volumes you know what you're doing, but this is roughly how it works:
- Prepare the harddrive(s) with "
sudo fdisk /dev/sdX", you need at least one partition with type set to "e8"
- Create a physical volume:
sudo pvcreate /dev/sdXY(do that for every partition you've created in step 1 with type set to "e8").
- Create a volume group:
sudo vgcreate <VOLGROUPNAME> /dev/sdXY /dev/sdZY(if you want to have multiple disks in the group)
- Create the logical volumes within the volume group:
sudo lvcreate -L <SIZE, i.e. 25G> -n <VOLNAME> <VOLGROUPNAME>
- Activate the newly created volumes:
sudo vgscan --mknodes && sudo vgchange -ay
- Format the volumes:
sudo mkfs.ext4 /dev/mapper/<VOLGROUPNAME>-<VOLNAME>
Now close the terminal, start the Ubuntu installer and go on as usual. Remember to choose the "Custom partitioning" option when the installer asks for the disk layout. From here you can choose your logical volumes and assign mount points. Once the install is finished DO NOT REBOOT, but click "Continue testing". As the newly installed system lacks lvm2 we need to add it now by setting up a chroot environment.
First, open a terminal again and mount your root partition (please adjust the devices accordingly):
# sudo mount /dev/mapper/volgrp0-rootlv /mnt
Once done, mount all other devices including the virtual filesystems:
# sudo mount /dev/mapper/volgrp0-homelv /mnt/home(/boot is extremely crucial!)
# sudo mount /dev/sda2 /mnt/boot
# sudo mount --bind /dev /mnt/dev
# sudo mount --bind /dev/pts /mnt/dev/pts
# sudo mount --bind /proc /mnt/proc
Now install lvm2:
# sudo chroot /mnt apt-get update
# sudo chroot /mnt apt-get install lvm2
# sudo umount /mnt/proc /mnt/dev/pts /mnt/dev /mnt/boot /mnt/home /mnt
And now choose to reboot from the applet at the upper right corner. If everything went well you should then be running Lucid Lynx with lvm support!