Operating System - Linux
1751972 Members
4605 Online
108784 Solutions
New Discussion юеВ

Logical Volumes in Fedora

 
SOLVED
Go to solution
John Collier
Esteemed Contributor

Logical Volumes in Fedora

I have been trying to do a little bit of research on the LVM that is currently being used in Fedora Core (used by default now if you let the OS handle disk space during install) and I am having a bit of a hard time wrapping my grey matter around it. Logical Volumes are just not something that I have had to deal with and for some reason it is just going way over my head.

Man pages are obviously available, but I was wondering if someone here would mind either walking me through the entire concept (consider this being something like teaching an infant to walk) or pointing me to a "for Dummies" type of site referring to this.

My gut tells me that this would be a good thing to understand, but my mind is simply unwilling to comply at the moment.

Of course, there is a bunny for the first person that can make that little light bulb above my head turn on for the first time. Shoot, I may even pass out a few if I we get on a roll of really good (aka very simple yet informative) info.

I would put this in the Fedora-specific forums, but this forum always seems to be better for information along these lines.
"I expect to pass through this world but once. Any good, therefore, that I can do, or any kindness that I can show to any human being, let me do it now. Let me not defer or neglect it, for I shall not pass this way again." Stephen Krebbet, 1793-1855
15 REPLIES 15
Ivan Ferreira
Honored Contributor
Solution

Re: Logical Volumes in Fedora

Learning LVM is a must, there are several advantages of using it.

A quick and good introduction can be found here:

http://www.redhat.com/magazine/009jul05/features/lvm2/
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
John Collier
Esteemed Contributor

Re: Logical Volumes in Fedora

Ivan,

Much information provided on that link. While it is not quite the "for dummies" version, I think I may have a better grasp of it. Let me see if I can sort of put it into words:

Basically, what I am getting from the document you pointed me to is that a logical volume is sort of like a virtual HDD that can either be made up of either one or more physical drives.

Once you have your virtual HDD space configured, you can allocate it on the fly to any of your groups (virtual partitions on your virtual HDD) as needed. The only reason you would have to take any downtime would be to actually add another physical drive such as another IEDE/SATA drive (or anything else that you can not add while the system is up).

So far, does that sound pretty much correct? If so, then I have a few other things to clarify/questions to ask in regards to this.

Of course, if I am completely off from the start it would be pointless to move on without a solid base to start on.
"I expect to pass through this world but once. Any good, therefore, that I can do, or any kindness that I can show to any human being, let me do it now. Let me not defer or neglect it, for I shall not pass this way again." Stephen Krebbet, 1793-1855
Ivan Krastev
Honored Contributor

Re: Logical Volumes in Fedora

Here is another good resource for LVM on Linux - http://tldp.org/HOWTO/LVM-HOWTO/

regards,
ivan
Ivan Ferreira
Honored Contributor

Re: Logical Volumes in Fedora

>>>> Basically, what I am getting from the document you pointed me to is that a logical volume is sort of like a virtual HDD that can either be made up of either one or more physical drives.

- Yes, more or less. I prefer to describe it as an "abstraction layer".

>>> Once you have your virtual HDD space configured, you can allocate it on the fly to any of your groups (virtual partitions on your virtual HDD) as needed. The only reason you would have to take any downtime would be to actually add another physical drive such as another IEDE/SATA drive (or anything else that you can not add while the system is up).

- Instead of "on the fly to any of your groups" could be "on the fly to any of your logical partitions/volumes"

So far, does that sound pretty much correct? If so, then I have a few other things to clarify/questions to ask in regards to this.

- Yes, but this is only the start, you can also take "snapshots" for example.

Of course, if I am completely off from the start it would be pointless to move on without a solid base to start on.

- You are getting the point.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
John Collier
Esteemed Contributor

Re: Logical Volumes in Fedora

Wow! Attack of the Ivans!

Not a bad thing, mind you, but it will change the way I have to word my responses here :-)

Ivan K.

That is the same link on the bottom of the first page that Ivan F. left for me and I am currently in the middle of going through it. It is nowhere near as clear and simple as the first one, but I will eventually get through it.



Ivan F.

Thanks for the positive feedback. Looks like there is another bunny in your future.

I will put my next questions together carefully before posting them. I want to give myself time to see if I really still need to ask them or if I might be able to muddle through it on my own.
"I expect to pass through this world but once. Any good, therefore, that I can do, or any kindness that I can show to any human being, let me do it now. Let me not defer or neglect it, for I shall not pass this way again." Stephen Krebbet, 1793-1855
Stuart Browne
Honored Contributor

Re: Logical Volumes in Fedora

LVM is one of those fun things that was 'borrowed' from somewhere else.

I've used LVM1 extensivly, and have found it almost without issue.

The systems I use in my current job are quite static in nature, thus don't really gain much from LVM (so don't use it).

When using LVM, you might also want to look at alternate filesystem types, as resizing EXT2/EXT3 filesystems 'on the fly' is one of those things that sorta-works (from memory, it's able to 'grow', but not 'shrink' on the fly). I use ReiserFS (3) at home on my logical-volumes (can resize both directions on-the-fly).

NOTE: on-the-fly is quite a relative term. Growing a filesystem is usually pretty safe, but because of writes, shrinking should be done as a single-user.. Some of the EXT2/EXT3 need the filesystem to be unmounted to do such however.
One long-haired git at your service...
Heironimus
Honored Contributor

Re: Logical Volumes in Fedora

Once upon a time you used an entire disk all at once. Then disks got big, so people started carving them up in to slices or partitions based on physical attributes (sector addresses, cylinder/head/sector mappings). Then volume managers came along and handled all that stuff under the hood so you could carve up your storage without worrying about the physical layout, thus allowing you to have "logical" volumes.

A volume group is just a pool of storage, backed by one or more physical devices. When you create or expand a logical volume you're reaching in to the pool and grabbing blocks, and when you remove/reduce volumes you're dumping blocks back in.

It's important to remember that filesystem resizing is independent of volume management, though they're both a whole lot more useful when you use them together.
dirk dierickx
Honored Contributor

Re: Logical Volumes in Fedora

in the beginning you just assigned partitions to a disk and created filesystems on that.

volumes managers work in a few more layers. first you have a disk. this disk can be divided into volume groups. you'll have a group for OS and one for data for example. those groups contain the volumes, these can be compared with the partitions you used before and that is where you create your filesystem on.

now what could possibly be the advantage of it all?

volume groups can be exported and imported on other machines, which is nice in clusters.

but probably the most interesting to you is the ability to extend a VG and LV. you can expand an LV and you don't have to worry were it will reside on the disk (with partitions they have to be in one big chunk), also a filesystem can span multiple disks. if your disk runs full, add another, expand your VG and LV and you're off again.

there are also other nice tricks like snaps etc.

once you used it and are used to it, you never want to go back to the old disk-partitioning scheme...
John Collier
Esteemed Contributor

Re: Logical Volumes in Fedora

I see I am one of the few left who did not totally grasp the LVOL thing.

I feel like I have a bit of a grasp of the concept, but since I have no additional disk space or hardware to experiment with, I will have to simply work with the theory for now. No Biggie, I will eventually be able to change that...

Now, here is one of those "practical" questions regarding LVOL and Administration:

Let's say, just for argument, that you have a system with LVOLs set up that has a fatal OS crash. The HDD is fine, but you don't have time (for one reason or another) to play with the existing OS to fix it and you just want to pull all of the old info from the existing HDD so you can reinstall.

With classic partitions, this is as simple as hooking up another HDD (or using your existing CD/DVD burner), booting into your favorite Live Linux CD and moving/copying data.

With LVOLs, I have not found a single live CD that knows how to access or read an existing LVOL. What are the options as this point?

I know we should already have backups of all the important info, but this is simply an example. More likely to happen at home than the office, but an issue nonetheless.

I have yet to see anything on this subject on the documents I was lead to earlier in this thread, but I do have to admit that I have not finished them all yet.
"I expect to pass through this world but once. Any good, therefore, that I can do, or any kindness that I can show to any human being, let me do it now. Let me not defer or neglect it, for I shall not pass this way again." Stephen Krebbet, 1793-1855