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.

So I just got a nice little home server (not 100% a server, it's also destined to run a few GUI jobs, but, mostly) configured to my specs, and it came with Ubuntu 10.4 pre-installed by the guys who put it together (who aren't Ubuntu specialists, but do that for customers who don't want to purchase Windows).

Now, I'd like to check (and perhaps modify) exactly how they installed it (maybe it would be wiser to reinstall from scratch, but first I'd like to understand exactly how it's configured now, anyway).

In particular, how do I check if and how LVM is installed/configured? I'd prefer a command-line approach, but GUIs are fine too -- and pointers to docs and tutorials on the subject are welcome too.

share|improve this question
add comment

1 Answer

up vote 10 down vote accepted

LVM is a pretty complex system and requires some knowledge before you can fully start to inspect the state. There are quite a few howtos lying around on the subject, but here is a crash course:

First of all, LVM is structured so that you pool physical partitions or volumes in to groups that then get split to logical volumes that are used by the operating system. All of these can be inspected with their own set of tools. Physical partitions (or volumes) can be inspected and modified with the pv* tools. Volume groups are inspected and modified with the vg* tools and finally the actual volumes that are used as filesystems can be inspected with lv* toolset.

Here is a good example on LVM structure

For inspecting the state of LVM you can use lvs, vgs or pvs commands. This will allow you to see how much space is used and where that space is allocated.

You can alter the size of logical volumes with the lvresize command, but be very careful when doing so. The LVM doesn't allow data to be stored outside of the logical volume like regular partitions. So if you shrink a partition by mistake and make it smaller than the filesystem, you will loose the data outside of the partition. Also when you resize a partition you need to resize the filesystem too, it is not automatically resized.

Finally, here is a full LVM HOWTO covering the bits I've left out here.

LVM is really powerful and useful. Once you get to know it, you don't really want to use anything else.

share|improve this answer
    
I know LVM, and I would still rather use ZFS :-) Nevertheless a great answer. I can especially second the recommendation of visiting the LVM HOWTO. –  andol Jul 30 '10 at 6:38
add comment

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.