Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I want to create a volume group with two drives, and make one big logical partition. I am wondering if one of the two drives crash...will all my data be destroyed in my volume group? Would their be anyway for me to get data off the "good" drive that did not crash?
I've been reading up on LVM(2) and as far as I can tell, it's pretty ugly if one of the drives fail. Any partitions which were entirely on one drive should be okay, but you may have to replace the failed hard drive and do some "stuff" before you can really do things (I'm not entirely clear on this). Any partitions which span across the failed hard drive are toast, although you might be able to recover some data (I get the impression this isn't easy or straightforward in any way).
I'm left with the impression that the only "good thing" about a multi-drive LVM volume is that it may make it easier to migrate data around if disc space is tight and/or you want to migrate "live" data transparently. LVM seems more useful with single drive volumes, when you want a lot of subpartitions.
XaViaR: The lvm --partial option will attempt to provide access to “damaged” volume groups where some logical volumes are unavailable/missing, such as would be the case if you had the problem you described. As always, there is no substitute for regular backups.
You can direct the creation of a logical volume to one or more partitions/physical volumes in a volume group, thus giving you the ability to keep it on a single disk when the volume group is spread across two drives. There can be read/write speed advantages if you do this selectively.
For instance, if you were using the system as an Apache server, placing the logical volume containing /var on one drive and placing the logical volume containing /usr on the other drive will probably give you a significant speed boost when compared to them sharing the same drive.
Last edited by WhatsHisName; 08-20-2005 at 01:01 AM.
IsaacKuo: Two selling points for LVMs are their flexibility and ease of administration. Safety isn't on the list, but can be accomplished in other ways.
Multidrive LVMs are usually implemented on top of drive redundancy (e.g., Raid5, Raid50, Raid1n, Raid10n, etc.), so drive failure is not such a big deal (unless you are the one who has to replace it). On smaller systems, regular backups are probably your best option. On a small LAN, there is nothing like having an old P-3 system set up for storing hourly/daily backups of your critical data.
Back to your comment about LVMs on smaller systems, two advantages of LVMs on small systems are (1) the ability to easily resize logical volumes to accommodate changing needs and (2) the ability to “hot” backup the system without unmounting the filesystem by using a logical volume snapshot. Both advantages are more pronounced for ext3 filesystems than for reiserfs.
In the case of two drives, I usually go more for speed than for reliability. Did you know that you can create the functionality of Raid0 without using mdadm or raidtools by “scattering” the LVM across drives? Look at the lvcreate -i and -I options. They give you the speed of a Raid0 with the functionality of a LVM. The surprising thing is that the scattered LVM seems to be slightly faster than a mdadm Raid0.
And if you decide later on that you don't want Raid0 functionality, then just create a new “linear” logical volume and move your stuff out of the scattered logical volume. Again, the word for the day about LVMs is “flexibility”.
One big disadvantage of using LVMs is that it is just something else that you have to learn about to use it effectively/efficiently. From my point of view, it is worth learning, but like most things in linux, it requires a lot of reading and some practice to get it right.
Last edited by WhatsHisName; 08-20-2005 at 01:07 AM.