Expandable File System On The Ubuntu Server
Server - Ubuntu

 

The “Guided – use entire disk and set up LVM” option provides a way to expand the partitions you create to meet future needs.  This provides a flexible, affordable and sensible method of creating a server.   Here is how it works.

The Logical Volume Manager (LVM) is an abstract layer that can envelop all of a system's hard drives, which allows the kernel to access the combined filesystems as if they were a single filesystem structure.  Normally, the kernel sees the drive partitions, and then it sees the data structure that represents the filesystems on those partitions.  For example, the kernel might see "/dev/sda3" mounted as the "/home" partition.  With LVM, the partitions are used to create "physical volumes", which are in turn added to the "volume group".  From a volume group, an administrator would then create "logical volumes", which act as partitions.  Logical volumes can be manipulated and resized as needed.

LVM will recognize and manage volumes that span across several different hard drives.  If need be, an administrator can even add more physical drives to the LVM.

 

Advantages of LVM

1. Multiple Drive Capability - You have the ability to create a LVM from multiple drives.  Or you can add a drive and then expand the LVM to include the newly added drive.  In the illustration you see that partitions from three separate drives; sda,sdb and sdc are used to create the volume group.

 

2. Re-sizable Volumes  - Logical volumes can be extended or contracted to fit the needs of the user.

3. Disk Striping  - Data can be striped across a number of drives to increase throughput.

4. Volume Mirroring - Volumes can be mirrored to provide redundancy much like a RAID 1.

5. Data Relocation - Data can be relocated on a new drive while the system is running.

6. Volume Snapshots - Volume snapshots provides a way to capture an image of the logical volume.

Logical Volume Manager

The bottom line … when you select LVM, you have the ability to add a drive or partition later and use the space on that drive or partition to increase the size of one the partitions that you have already created with LVM.  In other words, you cannot run out of space as you can just keep adding drives.  This is an excellent model for a server as you never know for sure the needs and exapansion of the company.  In order to make this happen select the second option when you have a choice for partitioning.

Partitioning Method

With LVM the process of building the partition is a three step process.  First create the partition as LVM aware, then createthe  logical group (a container for all of the space in the LVM),  and finally create and manage the logical volumes as you want to use them.  The step below is the process of creating a partition that is LVM aware.

Write Changes

The operating system takes the physical volumes, places them in a group and then allows you to create logical volumes from the group.  The step below is allowing you to choose the size of the logical volume.

Write Changes and Configure LVM?

Once you create the logical volume you can then create a mount point, decide where it will be mounted in the operating system.

Overview

As you look at this summary of the server you can see how the process develops.  Note that there are two drives in this example; sda (this first drive) and sdb (the second drive).  The sdb drive has no partitions configured, but it could easily be added later.  The sda drive had three partitions:
#1 primary   254.8 MB  f ext2 /boot

This partition is the /boot partition that contains the Linux kernel and is used by the operating stystem to boot or start the system.

The swap partition is a partition that is used to "swap" data from RAM to the hard drive when the system runs out of memory.
#1           536.9 MB  f  swap  swap

The final partition you see is the partition that is made LVM aware.
#5  logical  4.8 GB

This partition is used by LVM to create a VG or Volume Group called "ub11" from which the linear volume is created and mounted as "/".  This is listed as:
#1           4.2 GB   f  ext4     /
It is using the newer ext4 file system and because it is LVM it could be expanded at any time.  Thus, LVM provides flexibility, affordability and a sensible way to use your resources.

Disadvantages of LVM

The biggest disadvantage for using LVM is that as you can see, it is more complex and requires some knowledge of how it is set up and how it will be managed.  Unless you create mirrored volumes it does not provide any redundancy.  So for all of the complexity, you will need to take care to have good backups.