Too frequent BSODs and 'display driver not detected' messages were turning me insane. I decided to install Ubuntu via WUBI, but although the pain slightly decreased, the true potential of linux was still shrouded by Windows. I had been contemplating on completely formatting and installing Linux, and about a week ago, I finally did it. With just 1 Gb of RAM and a P4 processor, I thought Xubuntu would be the way to go - and it seems that I was right.
Anyway, while installing Xubuntu I put a tick mark on "Use LVM with the new Xubuntu Installation" without even knowing what LVM was. It just seemed fancy, I guess. I have a knack for doing stupid things. Now what happened was, the entire Harddisk got formatted, like I wanted. But, there was only one partition for root (obviously).
GParted does not seem to work with resizing LVM partitions because you need to have some unallocated space on your volume group. Since all the space was assigned to the same volume group and there were no free space, I could not make use of it.
Being sort of a newbie to Linux, I was looking for an easy way out (i.e. a GUI based solution) and I did find one - an utility called KVPM. It seems to work better than GParted because it does not require any free space on the volume group in order to partition it (I haven't used it though, use at your own risk.) But, with my Internet Speed it would have taken me almost 2 hours just to download it.
Resize an LVM partition and create a new one the dirty way (Just kidding; it's easy.):
- Boot with a live CD of the Linux distro. Click on Try Ubuntu (or whatever unity based distro you've got.)
- Go to terminal (Ctrl+Alt+T) and change to root by entering the command : sudo su.
- We need to find the volume group name of your partition and its corresponding device folder.
- Enter lvdisplay. The results you see are your logical volumes. You should find at least two of them: /dev/vg-name/root and /dev/vg-name/swap_1. Disregard the swap partition, it's the root that needs resizing.
As you can see on the picture, the device folder in my case is /dev/xubuntu-vg/root. Suppose, I wanted to resize my 230 Gb partition to just 80 Gb and create a new volume on the free space. Here's what I would do. Note that I'm entering /vg-name/root because that is what I am going to resize. If you are going to resize some other volume, you have to enter its name instead of root. (Enter these commands one after another. Remember to put your actual volume group in place of 'vg-name'.)
resize2fs -P /dev/vg-name/root
e2fsck -f /dev/vg-name/root
resize2fs -M /dev/vg-name/root
lvresize vg-name/root -L 80GB