Debian is one of a handful of Linux distributions with support for setting up LVM, the Linux Logical Volume Manager. LVM brings a level of flexibility to disk management on Linux that is not possible with the traditional disk partitioning scheme. If your favorite Linux distribution supports LVM, I’ll always recommend that you use it instead of the traditional disk partitioning scheme. There is no real downside to it.
If you opt for LVM on Debian 6 (Debian 6 review), the installer will allocate all available disk space to the partitions and Logical Volumes, leaving nothing to add other Logical Volumes if you ever need to. This article gives a very detailed step-by-step guide on proper LVM configuration on Debian 6. It is mostly intended for those new to the concept of volume management (on Linux).
Note: This article assumes installation on a computer with a single hard disk. A follow up article will show how to add extra disk(s) to the system, if the original disk becomes full.
Setting up LVM on any Linux distribution involves four steps:
- Create a non-LVM partition for /boot.
- Initialize the remaining free space of use by LVM. In LVM jargon, this free space is called a Physical Volume (PV).
- Create a Volume Group (VG). A VG is a virtual container for one or more PVs. The disk space available on a VG is the sum of the disk space of each member PV. If a VG runs out of disk space, you can attached a new hard disk to the system and add it to the VG.
- Carve out Logical Volumes (LV) from the VG. An LV is LVM’s equivalent of a disk partition. Like a VG, you can add or reduce the size of an LV. Lets say, for example, that you have an LV of size 20 GB, mounted at /home, And lets assume that the LV has run out of space, or is about to. You can grow the LV, provided that there is free space on the VG. And you can do this online, that is, while the computer is running, and without having to unmount the volume.
The default installation method on Debian 6 is via an ncurses-based interface. I prefer the graphical interface. It’s a bit easier.
Note: Using the default or choosing the “Graphical install” option on the boot screen will lead to the installation of a GNOME-based system. If you would rather install a system based on KDE. LXDE, or Xfce, choose “Advanced options,” and on the screen that comes after that, chose “Order desktops.”
A bunch of images that are not directly related to disk partitioning have been omitted from this tutorial. So, we cut to the step where disk partitioning starts.
The option to choose at this step is “Manual.” That is the only option that will allow to accomplish our objective, which is install a system using just a fraction of the available disk space. Continue.
Select the disk(s) you want to use. Keep in mind that this tutorial assumes installation on a single disk. Continue.
If the disk has been initialized, you will see something just like the one in the image below. If it has not, you will get another screen requesting permission to initialized it. Select the free space, then Continue.
Select the option as shown to start creating partitions. The goal here is to create a traditional partition for /boot, then create three logical volumes for /, swap, and /home. You can create more partitions, but for a desktop system, these will do. Continue.
By default the /boot partition on Debian 6 is allocated about 250 MB. Most Linux distributions use 500 MB. I think 250 MB will do just fine. Continue.
The default here is Primary. No problem with that. Continue.
Stick with the default. Continue.