I don't know why the default LVM setup was chosen, but I can offer some background on how LVM works.
Without LVM, you divide a disk in partitions, and each partition contains a filesystem (/
, /home
, etc.) or something else such as swap space.
LVM introduces a layer of insulation between the disk structures and the content-bearing structures. I'll refer you to the Wikipedia article for a more in-depth presentation, but in a nutshell, each disk partition is an LVM physical volume, while each filesystem or swap area is an LVM logical volume. There's no relationship between the extent of logical and physical volumes: the space in a physical volume can be divided between several logical volumes, and a logical volume can be stored across multiple physical volumes.
This explains why you're seeing two views. At the disk partitioning level, you have a disk with two partitions, one of which happens to be an LVM physical volume. At the content level, you have several filesystems, some of which happen to be on LVM logical volumes.
Parted isn't showing the LVM logical volumes. Either this version of Parted doesn't support LVM (hmm, I thought it did), or you need to tell it to switch to a different view, or you have already created partitions but not logical volumes yet.
I don't know where you're seeing 4MB wasted. I see 17MB unallocated, and I don't know why. Up to 4MB unused could happen with LVM: the size of each logical volume is a multiple of 4MB.
I don't know for sure what the 255MB ext2 partition is for, but I guess it's meant to be /boot
. It used to be that Grub, the default Ubuntu bootloader, couldn't boot from LVM. But Grub 2, the default bootloader for new installation since Ubuntu 9.10, supports an all-LVM installation, so you probably don't need that boot partition. (There are rare cases where an ext2 boot partition is still useful, for example if you're dual-booting with another operating system that doesn't support loading a kernel from LVM or ext4.)
I think I've addressed everything except the amount of swap. (Aside: you shouldn't ask unrelated questions in one question. The amount of swap has nothing to do with your interrogations about LVM. But the topic has already been done to death, so don't ask it separately, just search the site.) Since disk space is cheap, don't hesitate to have ample swap. The machine I'm posting this from has 4GB of RAM and 16GB of swap. Having low or not swap space will absolutely not “force the OS to use faster RAM”, this is completely wrong and I advise treating any source that says this with deep suspicion. (As far as I know this applies to Windows as well.) The OS will use RAM whenever it can. Swap is only used as a last resort, when there isn't enough RAM. Note that on a normal system, you should expect to see some swap in use. That's because RAM isn't just for storing the memory of running processes, it's also for caching disk contents. In fact, it's quite common to have about half the RAM used by the disk cache, and to have some process memory swapped out. If your system didn't do this, it would be running slower, because it would waste more time reloading the same files from disk again and again.
Here is a few bits of information I gathered regarding resizing LVM2 partitions based on my personal experience.
First things first: G-Parted (currently version 16 / July 2013) is unable to extend or shrink LVM2 partitions... Just forget G-Parted at the time being.
To date, the only GUI application able to resize LVM2 partition is "system-config-lvm" (sudo apt-get install system-config-lvm
) but for some reason, I haven't been able to get much from it.
Alternatively, it is possible to resize LVM2 partitions by using the appropriate command lines. More here > http://www.howtogeek.com/howto/40702/how-to-manage-and-use-lvm-logical-volume-management-in-ubuntu/ and there > http://www.tcpdump.com/kb/os/linux/lvm-resizing-guide/all-pages.html
I am personally a fan of G-Parted, the usual fast & easy trick. I hope the next version will be able to resize LVM2 partitions all graphically. But in the meantime, the best thing I always do, and I really mean it, is NOT to install new Linux boxes with LVM2; but rather with Ext3 or Ext4 instead. This choice is given in the middle of the install process: just avoid doing the "OK / Next / Next" thing mindlessly as LVM2 will be picked up as the default partition system ^^ it is far better customizing the formatting method. So let's keep say 1024 Mb for the Swap Partition, and assign 10GB or more to the /dev/sda1 partition (the Ext3/4 one), on which "/" is the Mount Point.
This way, you may be able to use G-parted later on it if needed, with no limitation of any kind.
Edit 1 : if you desperately need to free some disk space on your FileSystem partition ASAP, logon your linux and type the following command : "du -sh *", which will display a list of all the directories and their size. This will help you identify the biggest folders at a glance and maybe move or remove static data.
Edit 2 : Latest news from the G-Parted Team (dated 2nd sept. 2013) : "
To resize LVM2 PV partitions, the volume must be deactivated. To do this, select the menu option "Partition --> Deactivate". When the LVM2 PV partition is deactivated, then the resize/move menu option will be enabled.
Since Logical Volume Management is not simply a file system, there are serious repercussions to changing the volume group name or UUID. Also problems will occur if the LVM2 PV is copied. That is why these operations are not supported for LVM2 PV."
Best Answer
Perhaps not the smartest solution:
use the tool system-config-lvm to migrate your data to another (temporal, external hard drive) device, delete the partition / do your resizing and migrate the data back.
hope that helps