Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

As a Linux/Ubuntu newbie, what is LVM and what is it used for?

In terms of a web server installation, what benefits does it provide?

Would you recommend using it?

share|improve this question
    
ehm, first google hit? en.wikipedia.org/wiki/Logical_Volume_Manager_%28Linux%29 ? Looking at the other hits on the front page? –  maxschlepzig Sep 4 '10 at 12:38
20  
Yes that was the first thing I did, but as a first time Ubuntu/Linux user, currently starting at the installation partition screen, I don't understand enough of the terms on that wikipedia page to know whether to use it or not. –  Matthew Blackford Sep 4 '10 at 12:47
6  
This question is now the first google result for "ubuntu server lvm", FYI. –  Wug Nov 21 '13 at 8:48

4 Answers 4

up vote 64 down vote accepted

Benefits

You can think of LVM as "dynamic partitions", meaning that you can create/resize/delete LVM "partitions" (they're called "Logical Volumes" in LVM-speak) from the command line while your Linux system is running: no need to reboot the system to make the kernel aware of the newly-created or resized partitions.

Other nice features that LVM "Logical Volumes" provide are:

  1. If you have more than one hard-disk, Logical Volumes can extend over more than one disk: i.e., they are not limited by the size of one single disk, rather by the total aggregate size.

  2. You can set up "striped" LVs, so that I/O can be distributed to all disks hosting the LV in parallel. (Similar to RAID-0, but a bit easier to set-up.)

  3. You can create a (read-only) snapshot of any LV. You can revert the original LV to the snapshot at a later time, or delete the snapshot if you no longer need it. This is handy for server backups for instance (you cannot stop all your applications from writing, so you create a snapshot and backup the snapshot LV), but can also be used to provide a "safety net" before a critical system upgrade (clone the root partition, upgrade, revert if something went wrong).

While being most useful on server systems, I think that features 1. and 3., combined with LVM's ability to create/resize/delete LVs on the fly, are quite handy on desktop systems as well. (Especially if you experiment a lot with the system.)

Downsides

Of course, all of this comes at a price: the initial set-up of LVM is more complex than just partitioning a disk, and you will definitely need to understand the LVM terminology and model (Logical Volumes, Physical Volumes, Volume Groups) before you can start using it. (Once it is set up, using it is much easier, though.)

Also if you use LVM across hard drives you may loose all your data when only one drive fails.

Recommendation

Reccommend reading the LVM HOW-TO from The Linux Documentation Project.

share|improve this answer
    
With LVM2 you can also set up writeable snapshots too! –  Flimm Nov 26 '12 at 18:51
    
Thank you @Riccardo Murri. This is a very useful answer. –  S.M.Mousavi Feb 15 '13 at 7:42
    
@Flimm Realy?! Very interesting –  S.M.Mousavi Feb 15 '13 at 7:46

Without answering your question directly (which the other posters already did), there is an easy answer about whether or not you need LVM: If you don't know some feature during installation in detail, leave it at its default setting. The default configuration will be fine for most users (including me and probably you). :)

share|improve this answer

The main benefit from using LVM is if you have more than one harddrive. With LVM you can group the hardrives into one huge one. Also you can add more space to this group if you add more harddrives.

With LVM you can simple work like you have only one single huge harddrive. Despite that LVM supports a lot expert features.

share|improve this answer

What kind of applications or content are you planning to host ? If it is a personal server or something for a small organization, you probably can get by without using LVM.

LVMs are useful if you need partitions etc across multiple disks. I doubt you would need it, given that you're asking here regarding it :)

share|improve this answer
    
Yes it's just a personal server, so it sounds like I won't be needing it. Thanks. –  Matthew Blackford Sep 4 '10 at 14:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.