CentrioHost Blog

Stories and News from IT Industry, Reviews & Tips | Technology Blog


WHEN TO USE LVM

LVM, or the Logical Volume Manager, is a Linux volume partitioning solution that has been around for some time and provides a number of advanced features.

While many people confuse LVM with the file system, it actually works on a separate layer in order to create a virtual partitioning scheme on top of the actual disk layout.

LVM provides more flexibility when compared with traditional partitions, which can be extremely useful in many cases. However, there are also scenarios when it is pointless to use it or there are better options available.

We will discuss in this article what are the advantages and disadvantages of LVM, as well as some potential use cases.

HOW DOES LVM WORK?

The basic building blocks of the system are Physical volumes (PV). These can be any kind of available storage devices like actual discs (hard drives, SSDs, etc), RAID arrays, MBR and GPT partitions or various other block device nodes.

The physical volumes are combined into Volume groups (VG), which serve as storage pools. They create a unified storage space, combining the capacity of all underlying devices. Volume groups can be quickly resized by adding or removing physical volumes.

From a volume group, the Logical volumes (LV) are created. These are the actual partitions that can be formatted with various file systems and used by the operating system.

Unlike traditional disk partitions, the logical volumes are very flexible because they are abstracted in their volume group. A logical volume doesn’t have to be contiguous, it can stretch on multiple disks, can be easily migrated and you can assign it a name instead of a number for easier identification.

LVM splits physical volumes into small chunks names Physical extents (PE). These have a default size of 4 MB, must be contiguous and are the smallest units that can be allocated. PEs can be added and removed from volumes on the fly and are the core concept that powers LVM.

ADVANTAGES OF LVM

The biggest advantage of LVM is that both logical and physical volumes can be created, deleted and resized online, without any restarts.

Logical volumes can also be resized dynamically, so you can start for example with a small partition and configure it to expand as data is written on it.

Any number of disks and partitions can be unified into a big one, or a single physical disk can be quickly split into many partitions of any size.

In addition, LVM allows the creation of instant logical volume snapshots while the operating system is running and supports advanced encryption features.

DISADVANTAGES

The main disadvantage of LVM is that it adds another layer to the storage system. While the overhead of LVM is usually small, any decrease in performance can be critical on busy systems.

While the ability to resize logical volumes is very useful, the file systems installed on them must be resized separately. Since most Linux file systems don’t support online resizing, a period of downtime is needed.

Many users have reported significant performance issues when creating snapshots, which limits their use in a production system.

Finally, modern file system like zfs or btrfs support most of the advanced features of LVM (online resizing, snapshotting), without the need to add another layer.

WHEN TO USE LVM?

The option to setup LVM is presented during the installation of any modern Linux distribution, should you use it? The answer depends on the actual use case.

LVM can be extremely helpful in dynamic environments, when disks and partitions are often moved or resized. While normal partitions can also be resized, LVM is a lot more flexible and provides extended functionality.

As a mature system, LVM is also very stable and every Linux distribution supports it by default. It is easy to install and configure, with plenty of online documentation available, unlike the modern file systems alternatives that require advanced knowledge and are not as reliable in a production setting.

Another common use case for LVM is in testing environments, when you need for example to create multiple partitions for different file systems. It is also well suited for the management of partitions of various sizes, like the ones used to store logs that start small but can significantly increase in time.

Some system administrators install LVM solely because of the snapshots, which preserve an image of a partition that can later be merged with the original in order to restore it to an earlier state.

However, in a static environment where partitions and disks are never changed, there is no reason to configure LVM unless you need to create snapshots.

 

LVM is a complex service with many other features that are described in detail in the official documentation.

Looking into the future, it is very likely that LVM will be phased out as the new generation of file systems like zfs and btrfs become mature. At the moment, it is still a very powerful and flexible tool that remains the best choice in many situations.

Subscribe Now

10,000 successful online businessmen like to have our content directly delivered to their inbox. Subscribe to our newsletter!

Archive Calendar

SatSunMonTueWedThuFri
 123
45678910
11121314151617
18192021222324
25262728293031

Over 20000 Satisfied Customers!

  • web hosting reviewer
    Valerie Quinn
    CTO, Acteon Group

    Centriohost staff were fantastic, I had a concern with a domain and they got back to me very quickly and they helped me to resolve the issue! ~ . . . Read more

  • Joomla hosting reviewer
    Collin Bryan
    Photographer, Allister Freeman

    I'm using centrio for my portfolio since 2006. The transition was seamless, the support was immediate, and everything works perfectly. ~ . . . Read more

  • dedicated server reviewer
    Harry Collett
    Actor, A&J Artists

    Very easy to understand & use even though I am not very technologically minded. No complications whatsoever & I wouldn't hesitate to recommend it to all. ~ . . . Read more

  • vps web hosting reviewer
    Porfirio Santos
    Technician, Diageo PLC

    Centrio support team have been amazingly responsive and helpful to any of my queries, thank you so much to the Centriohost have been amazingly responsive and helpful to any of my queries 👍👍👍 ~ . . . Read more

  • wordpress hosting plans reviewer
    Catherine Auer
    Doctor, SmartClinics

    Anytime I've had a problem I can't solve, I've found Centriohost to be diligent and persistent. They simply won't let an issue go until the client is happy. ~ . . . Read more

  • reseller hosting reviewer
    Effectivo Social
    Freelancer, Fiverr

    Recommend their shared hosting for all my SME web design clients. Their cloud or VME offerings are too great to deal with. Pricing is perfect and suitable for all users (͠≖ ͜ʖ͠≖) 👌 ~ . . . Read more

Top