|
|
Subscribe / Log in / New account

Fedora and LVM

This article brought to you by LWN subscribers

Subscribers to LWN.net made this article — and everything that surrounds it — possible. If you appreciate our content, please buy a subscription and make the next set of articles possible.

By Jonathan Corbet
October 31, 2012
Those following the progress of the Fedora 18 development cycle cannot have failed to notice that the rework of Anaconda, the distribution's installer, is not going as smoothly as one might have liked. Complaints are common, and there is a real risk that installer problems will end up being what users remember about this release. Given that, it may seem surprising that the Fedora developers intend to change one of the fundamental decisions made by the developers of the new installer.

The logical volume manager (LVM) sits above the block layer, providing abstract storage devices that can be resized, encrypted, and more. In the absence of explicit instructions to the contrary, Anaconda has installed systems using LVM for many years. LVM adds some flexibility to an installed system and supports a number of official Fedora features, but it has the potential to confuse users who are not prepared for the addition of a layer of indirection over their disk partitions. It also irritates users who know they don't need LVM and would rather not see another layer of software in the block I/O path. Grumbling about the use of LVM in Fedora is not uncommon.

The new installer changes the default; unless the user asks for LVM explicitly, current F18 testing releases will install directly onto disk partitions and leave LVM out of the picture. How that change came to be is not entirely clear; it does not seem that there was much, if any discussion in the Fedora development community first. That did finally begin, though, on October 25, when Adam Williamson filed a Fedora bug asking that the change be reverted so that Fedora would, once again, install and use LVM by default.

That discussion got off to a bit of a rough start; arguably, Adam's phrasing did not help matters:

It's kind of hard to really swing the 'LVM annoys people' argument too. Well, it _does_, but not for very good reason. That argument boils down to 'catering to idiots': the people who say they're annoyed by LVM as default are people who know raw partitioning, don't understand LVM, and are resisting change.

In the end, though, the real arguments in favor of changing Anaconda to restore LVM-by-default came to the fore; there are several of them. The first of these is that a number of advertised Fedora features depend on LVM; a user who does without LVM will end up without the ability to use System Storage Manager, resize filesystems, migrate filesystems across disk, and more. Thus, Ric Wheeler said, turning LVM off by default constitutes a regression that needs to be reverted.

There is also the little problem that Fedora's documentation is written with the assumption that LVM is in use. Turning LVM off obsoletes that documentation without fixing it. Quality documentation is hard enough to come by as it is; causing what documentation exists to become inaccurate without (as LVM proponents see it) a proper justification just makes things worse to no good end.

Also relevant is that the current plan is for Fedora to switch to Btrfs during the Fedora 19 development cycle. Given that, making a fundamental change to the Fedora storage stack now makes little sense to many developers. It will just add churn to a system that is going away anyway, leaving one Fedora release with a storage setup that differs from all the others. That has the potential to confuse users and increase the amount of work the Fedora storage developers have to put into supporting the F18 release. Even if the Btrfs transition is delayed to F20 (an outrageously shocking and unpredictable course of events, but one might as well ponder even highly unlikely scenarios), a case could be made that it might be better not to perturb the existing stack unnecessarily in the meantime.

Finally, it has been pointed out that the change to Anaconda returning it to the pre-F18 default is quite small; it is really just changing the default value of a checkbox on an installer screen. All of the code for installing over LVM — code that has been used for many releases — is still there and working as well as ever. So the change should be safe and should not be cause for yet another slip in the Fedora 18 schedule.

Arguments for leaving the default as it is (and, thus, continuing to install without LVM) usually start with the fact that it is quite late in the F18 development cycle; unnecessary changes — even small and seemingly safe changes — should be avoided if possible. That is doubly true for the installer, which has had trouble stabilizing as it is. Rather than revisit established decisions, it is said, it would be better to focus on fixing the known problems and getting a solid release out the door.

Beyond that, some developers question the value of LVM. Fedora developer "drago01" asked:

Resizing partitions isn't that common and not the primary use of LVM (you can do it without it and most users won't). It is still pretty much useless (as in the extra features won't be used) for the average desktop / laptop installs. For most users all it does is slowing down the boot process (we should stop adding crap to the default boot process because someone might need it on some obscure case).

LVM has been fingered in the past for slowing down the boot process; indeed, it has been called out as one of the chief offenders. Discussion in the bug report suggests that LVM's dependency on udev-settle, which is the real cause of boot-time delays, has been significantly reduced, to the point that many or most installations no longer need it. But, if boot time is a prime concern, the addition of another service to set up in the boot path is unlikely to help the situation.

Finally, opponents argue that LVM is confusing to relatively unsophisticated users who will end up being unable to manage their systems properly. It is an added level of abstraction that makes things harder without bringing any significant new value. It would be better, they argue, to behave like many other distributions and just install directly onto disk partitions by default.

The Fedora Engineering Steering Committee (FESCO) took up this issue and brought it to a vote on October 30. Full consensus was not to be found there either, but, in the end, FESCO voted in favor of the change back to the pre-F18 default. So, unless something gets derailed somewhere, the Fedora 18 will, like its predecessors, install and use LVM by default.


(Log in to post comments)

Fedora and LVM

Posted Oct 31, 2012 16:27 UTC (Wed) by amacater (subscriber, #790) [Link]

This, again, is one of the things that the Debian installer does properly.

A netinst (220M download) install offers you the choice of filesystem on a single disk (LVM/not LVM), guided disk partitioning with several common variants or manual partitioning and, of course the chance to set up RAID and LVM in detail for a multi-disk system

Fedora and LVM

Posted Oct 31, 2012 16:35 UTC (Wed) by rahulsundaram (subscriber, #21946) [Link]

Fedora net install along with https://boot.fedoraproject.org/offers all this and more as well but this discussion has nothing to do with features and everything to do with the defaults.

Fedora and LVM

Posted Oct 31, 2012 17:03 UTC (Wed) by carenas (subscriber, #46541) [Link]

The link you provided to BFO has been broken for a while.

Fedora and LVM

Posted Oct 31, 2012 18:27 UTC (Wed) by seyman (subscriber, #1172) [Link]

I believe Rahul is talking about https://boot.fedoraproject.org/ and simply made a typo.

Fedora and LVM

Posted Oct 31, 2012 16:36 UTC (Wed) by dowdle (subscriber, #659) [Link]

The previous anaconda installer did too. I've seen the Debian installer so I'd not be touting it too much if I were you... including the GUI one they are still working on.

Debian's installer (was Fedora and LVM)

Posted Oct 31, 2012 19:07 UTC (Wed) by dskoll (subscriber, #1630) [Link]

Just out of curiosity... what's wrong with Debian's installer? I rather like it.

Fedora and LVM

Posted Oct 31, 2012 19:26 UTC (Wed) by pkern (subscriber, #32883) [Link]

"The GUI one" being just another frontend to the same code. Hence it not providing that much more functionality over the text mode install. Luckily that has the benefits of an identical feature set and less maintenance being required.

Fedora and LVM

Posted Oct 31, 2012 16:42 UTC (Wed) by dwmw2 (subscriber, #2063) [Link]

My biggest problem with LVM is that it's massively more fragile than the basic partitioning setup. And, as noted, with no real benefit in the basic laptop/desktop case.

I run a number of machines, and mostly I remember to disable LVM when installing them. I have lost count of the number of times that something's gone wrong with the ever-increasingly-baroque initrd, leaving mount-by-UUID and LVM non-functional, while a simple boot with 'root=/dev/sda2' has been sufficient to get it working again. And of the number of times that I've attempted to perform a similar task on an LVM-inflicted machine, and been screwed.

I have, on the other hand, resized partitions and switched from dual-500GB disks in RAID-1, to dual-1½TB disks in RAID-1, without having to use LVM. So even on the rare occasion that I've actually done disk-juggling stuff, LVM didn't help me.

Fedora and LVM

Posted Oct 31, 2012 17:03 UTC (Wed) by tialaramex (subscriber, #21167) [Link]

I'm sure it's all possible, it's just not convenient. LVM makes it easier and safer to do this sort of thing, without fumbling around with disk layouts and other stuff you've no reason to care about.

The last time I looked the Fedora UI for LVM sucked pretty badly. But that's not a failing of LVM, it's an opportunity for someone with UI design skills to do a better job. This stuff can be made non-scary, even the Windows Server UI is less scary than what Fedora has now.

It also lets me put off decisions. I have 500GB free, is that space for more video recordings or for experimental software? Never mind, I'll leave it free and assign it when it's needed. Tricky with raw partitions, easy by leaving the blocks assigned to a volume group but not a specific logical volume.

Fedora and LVM

Posted Oct 31, 2012 21:51 UTC (Wed) by epa (subscriber, #39769) [Link]

I can't really agree that 'LVM makes it easier and safer' to do disk-juggling operations. If your system is up and running happily from its system disk, and you have a couple of RAID arrays to manage, then yes. But for single-disk systems it seems to get in the way. For example, suppose you want to upgrade your hard disk. With Slackware it is a simple task to plug in the second disk, boot the machine, partition the second disk and copy everything across, and install the boot loader on the second disk. You're now ready to go. With Fedora and LVM, on the other hand, making it work requires a complex series of LVM commands; fdisk looks positively intuitive by comparison. In the end I gave up trying to move my system to a different hard disk and just reinstalled from scratch. Yay LVM!

To me, LVM is like git. It's hugely powerful; but as a beginner, or someone who doesn't use it often, you really long for a simple interface that will print out "WTF is going on" and guide you through the possible steps.

Fedora and LVM

Posted Oct 31, 2012 22:59 UTC (Wed) by marcH (subscriber, #57642) [Link]

> To me, LVM is like git.

While LVM obviously add some complexity, the comparison with git is really not fair. If you understand git then you can certainly understand LVM with an extremely small effort.

There are only two/three LVM concepts you need to know:

1. Physical partitions: your real, good old disk partitions
2. Volume Group: just an implementation detail you can almost ignore. Have a single VG, assign everything to it and forget about it.
3. Logical partitions: /usr, /home, swap, etc.

Apologies for just making you fully understand LVM against your will.

Fedora and LVM

Posted Nov 1, 2012 4:53 UTC (Thu) by bronson (subscriber, #4806) [Link]

Talk about oversimplification! He's going to have to read a lot more documentation to get even the simplest operation done in LVM.

Really, if if the desire is just to to move or resize partitions, it's probably best to use gparted and skip LVM entirely. Not many people actually need the additional features that LVM offers.

Fedora and LVM

Posted Nov 1, 2012 7:53 UTC (Thu) by marcH (subscriber, #57642) [Link]

> He's going to have to read a lot more documentation to get even the simplest operation done in LVM.

I must be a genius then.

The only thing I do besides remembering the above is type the following:

lv[tab] --help
pv[tab] --help
+ say 10 minutes of googling.

That's 15 minutes extra but it's only 15 minutes and it does not happen often.

> Really, if if the desire is just to to move or resize partitions, it's probably best to use gparted and skip LVM entirely.

The key LVM feature for me is: no reboot interruption(s) distracting me at the worst possible moment. If that's not considered important then yes LVM should be skipped.

Fedora and LVM

Posted Nov 1, 2012 8:53 UTC (Thu) by epa (subscriber, #39769) [Link]

Yes, if your machine is up and running then you have recourse to "ten minutes of googling". If it won't boot because the initrd doesn't recognize the LVM setup and just falls over in a heap (rather than doing something helpful like, I don't know, displaying a list of volume groups and volumes and letting you choose which to mount as /) then everything becomes a lot more uncomfortable.

Fedora and LVM

Posted Nov 1, 2012 9:29 UTC (Thu) by paulj (subscriber, #341) [Link]

That's not really LVMs fault, but the fault of the init root your distro supplied. That early-boot stuff gets rewritten en-masse regularly and then shipped to you when it still has lots of undiscovered bugs probably means you're the running the regression-guinea-pig version of your favoured vendors' distro.

Fedora and LVM

Posted Nov 1, 2012 15:54 UTC (Thu) by bronson (subscriber, #4806) [Link]

Are you really suggesting that with only your previous post, 10 minutes of googling, and the output lvm --help, that epa (or typical Linux users) will be able to easily reconfigure their lvm setups?

Fedora and LVM

Posted Nov 9, 2012 18:13 UTC (Fri) by nahoo (guest, #55570) [Link]

I think he is right. I did this last week. I did a backup, and half an hour later I had all my partitions + filesistems resized, and it was my first try at lvm.

Of course it depends on how you describer a typical user, but I think the statement is true for a user that knows what a filesystem/partition is and need to resize them.

Fedora and LVM

Posted Nov 1, 2012 9:50 UTC (Thu) by mordae (guest, #54701) [Link]

> For example, suppose you want to upgrade your hard disk. With Slackware it is a simple task to plug in the second disk, boot the machine, partition the second disk and copy everything across, and install the boot loader on the second disk.

Yeah, and with LVM you can do that on-the-fly and safely move LVs while using them. You just move the LVs between PVs (the disks) within the same VG and finally you remove the old drive. You can even do it all incrementally.

Fedora and LVM

Posted Nov 1, 2012 11:04 UTC (Thu) by epa (subscriber, #39769) [Link]

Do you have a link to some instructions about how to do this?

I had hoped to set up the new disk without touching the old disk - so there is always a fallback if something goes wrong. If you move the LV to the new disk, that means your old disk will no longer work. I think that for upgrading your hard disk, you usually just want to clone everything to the new disk - only with a larger partition size than before.

Fedora and LVM

Posted Nov 1, 2012 12:57 UTC (Thu) by pbonzini (subscriber, #60935) [Link]

pvcreate "formats" a partition for use with LVM.

vgextend (mentioned in the man page for pvcreate) adds the partition to the existing volume group.

pvmove moves the logical volume from the old disk to the new disk.

vgremove removes the old partition from the volume group.

Remember to move /boot manually (it should be easy to do it with dd since it can be left read-only).

Fedora and LVM

Posted Nov 1, 2012 14:40 UTC (Thu) by epa (subscriber, #39769) [Link]

Thank you.

Fedora and LVM

Posted Nov 2, 2012 0:34 UTC (Fri) by lacos (guest, #70616) [Link]

s/vgremove/vgreduce/ ; see above (commenting here so you get an email possibly and don't miss the correction)

Fedora and LVM

Posted Nov 1, 2012 21:13 UTC (Thu) by agk (guest, #23332) [Link]

> pvcreate "formats" a partition for use with LVM.

BTW This step is optional now. Basic pvcreate functionality is included in vgextend (and vgcreate).

Fedora and LVM

Posted Nov 2, 2012 0:33 UTC (Fri) by lacos (guest, #70616) [Link]

> vgremove removes the old partition from the volume group.

I think this is not correct (it caught my eye because I also have the most trouble remembering this step).

"vgremove" removes an entire volume group.

Instead "vgreduce" is needed here (evict the PV (ie. the partition) from the VG).

Afterwards "pvremove" may be invoked on the partition to "wipe[] the label on [the] device so that LVM will no longer recognise it as a physical volume".

Fedora and LVM

Posted Nov 1, 2012 11:39 UTC (Thu) by Cato (guest, #7643) [Link]

Indeed - LVM also makes it harder to recover data (few tools directly support LVM), easier to lose data (on setups where the write caching is broken, but mostly older kernels) and harder to resize partitions (multiple LVM and FS resize commands, and if shrinking is required then it's easy to wreck the FS). And LVM snapshots are pretty slow.

See http://serverfault.com/questions/279571/lvm-dangers-and-c... for more.

Generally I think LVM should only be a default on server distros aimed at professionals. Once btrfs is more mature and has a complete fsck, it removes some of the need for LVM in any case, and has other advantages such as faster snapshots.

Fedora and LVM

Posted Nov 1, 2012 20:49 UTC (Thu) by agk (guest, #23332) [Link]

> (multiple LVM and FS resize commands, and if shrinking is required then it's easy to wreck the FS).

To resize a logical volume containing a recognised filesystem with a single command, use:
lvresize -r ... (or lvextend/lvreduce; or --resizefs)

This passes the size to the filesystem resizing command (via 'fsadm') and runs the steps in the right sequence.

Fedora and LVM

Posted Nov 2, 2012 7:41 UTC (Fri) by Cato (guest, #7643) [Link]

I'm aware of the --resizefs feature, but it has been buggy over the years and was apparently only fixed some time in 2011 - see comments 5 and 6 on https://bugs.launchpad.net/ubuntu/+source/lvm2/+bug/174032

Most resizing HOWTOs for LVM don't use this command, probably because it was added in the last few years, but that may be no bad thing.

Shrinking an LVM logical volume and FS can be dangerous if you don't get the sizes exactly right, and I'm not 100% confident that the --resizefs feature is bug free. (See http://www.debuntu.org/how-to-install-ubuntu-over-lvm-fil... for a long discussion of issues, and the resizing part of http://serverfault.com/questions/279571/lvm-dangers-and-c...

Generally I have more confidence that Gparted (or parted) will not mess things up.

Fedora and LVM

Posted Nov 2, 2012 14:27 UTC (Fri) by agk (guest, #23332) [Link]

> Shrinking an LVM logical volume and FS can be dangerous if you don't get the sizes exactly right

Which is why --resizefs exists: so that appropriate sizes are used and the steps are performed in the right order. The feature is fully supported.

> and I'm not 100% confident that the --resizefs feature is bug free.

"Bug free" will never be promised, of course:) The bugs you referenced look to be from before the code was included in lvm2 and were of the "feature gives an error and stops instead of resizing" variety.

Fedora and LVM

Posted Nov 2, 2012 17:09 UTC (Fri) by paulj (subscriber, #341) [Link]

And if you insist on using the LVM and FS resizing commands separetely, well at least resize2fs doesn't /need/ any size argument. So just extend the LV, then run resize2fs on its own (no size arg) - it'll figure it out, completely safe.

Fedora and LVM

Posted Nov 2, 2012 17:20 UTC (Fri) by nybble41 (subscriber, #55106) [Link]

That's true only when _growing_ the logical volume; the danger is in _shrinking_ it. To reduce the size of a LV you must first shrink the filesystem, and for that you need the final size of the LV. If you fail to reduce the filesystem to a size less than or equal to the final size of the LV before resizing the LV, the result will be data corruption. Thus the --resize option, which takes care of these details for you.

Fedora and LVM

Posted Nov 5, 2012 12:08 UTC (Mon) by paulj (subscriber, #341) [Link]

For that case I first shrink the fs as much as possible, to size X say. Then I shrink the LV to desired size Y, where Y is unambiguously > X. Then I resizefs without args to increase the fs back to the full size of the LV.

That I do it that way is probably cause I pretty much never shrink fses, and the last time I had to do this was way back, when LVM was still newish and e2fsadm and/or the --resize option didn't exist, or didn't handle this.

Generally LVM lets me manage fses in such a way that I only allocate to them what is reasonable for the foreseeable future. I keep the extra space free in the VG. As/when fses need more space, I just extend them. That this is so painless to do with LVM and resize2fs - online and without interruption - makes it the best way to manage storage, I find.

So so so so much better than the olden days, when you had to rejiggle partitions, reboot several times, and potentially use your swap device as a temporary root, in order to shift space to where you needed it. That was hair-raising, and I never want to go back to that! There isn't much to LVM, it didn't take much to learn, and it's removed a lot of stress.

One lesson though: snapshots need attentive monitoring. Never let a snapshot get anywhere near full, otherwise you risk it getting full and your box will wedge! Also, the early implementations of pvmove were very risky. Apparently those problems have been ironed out and it's now a lot more reliable, but I'm conservative and tend to avoid it. Luckily, that's easy - just move PVs the old fashioned way, copy them like you had to do with FSes before LVM. ;)

Overall though, LVM is a massive win over what went before.

Fedora and LVM

Posted Nov 5, 2012 12:23 UTC (Mon) by Cato (guest, #7643) [Link]

Your 'over-shrink then grow' method is a good one for ensuring the FS doesn't get corrupted when shrinking an LV. However the --resizefs option should be safe and quicker according to agk's comments elsewhere.

Re the "olden days" scenario: now that 2 to 3 TB external drives are very cheap, and USB3 or eSATA are very fast, you can simply backup all the partitions involved (a good idea anyway) to the drive, then repartition destructively and restore. (If you are using rsnapshot you only do an incremental backup since the overnight one, which will not take so long.)

This backup/restore model may be faster than doing the Gparted model of moving FSs to new location, as it uses 2 spindles not one. It also has the benefit of defragging your FSs - I know Linux FSs don't need defragging in theory, but in practice it will help somewhat particularly if FS has been in use for some years. (LVM's model will tend to increase fragmentation somewhat as you never do this sort of FS re-creation.)

I don't see why more than one reboot is needed with Gparted.

Fedora and LVM

Posted Nov 5, 2012 12:32 UTC (Mon) by paulj (subscriber, #341) [Link]

Yes, I might try the --resizefs option next time. I just didn't know about it. It really has been a long time since I last had to shrink an fs.

That single reboot with gparted is still 1 more reboot than I need with LVM. Further, on an ongoing basis, it means you will need a lot more reboots than I will.

Fedora and LVM

Posted Nov 2, 2012 18:02 UTC (Fri) by Cato (guest, #7643) [Link]

Since it seems that "lvextend --resizefs" generally works for common FSs, it's certainly worth a try, but the lack of documentation and HOWTOs mentioning this option doesn't fill me with confidence.

While you are here: I think that the LV size should be larger than the FS size by 2 x the LVM physical extent (PE) size. Is that correct?

Fedora and LVM

Posted Nov 3, 2012 1:28 UTC (Sat) by agk (guest, #23332) [Link]

> the lack of documentation and HOWTOs mentioning this option doesn't fill me with confidence.

The LVM HOWTO at tldp hasn't been updated for several years.

> I think that the LV size should be larger than the FS size by 2 x the LVM physical extent (PE) size. Is that correct?

No. Where did that idea come from? LVM doesn't reserve any space *inside* the LVs it creates! The filesystem can use the entire LV if it wants to.

Fedora and LVM

Posted Nov 1, 2012 22:05 UTC (Thu) by agk (guest, #23332) [Link]

> And LVM snapshots are pretty slow.

That can be qualified: They are optimised to act as short-term backups that will be accessed perhaps just once (if at all) and then deleted.

But because of the lack of alternatives they often get used in other situations where they are indeed 'slow' by design.

An alternative LVM "thin provisioning" snapshot implementation is now available that is optimised for having many long-term snapshots of the same volumes, sharing data between them where they can. Example:

# Set aside 10GB for a pool of thin logical volumes (thin_pool1) in vg1
# and create a thin volume called thin_vol1 that purports to be 2GB in size
lvcreate -T -L10G vg1/thin_pool1 -V2G --name thin_vol1
# Put some data on vg1/thin_vol1
...
# Create a thin snapshot of vg1/thin_vol1
lvcreate -s vg1/thin_vol1 --name thin_snapshot1

Commands that allow the creation of thin snapshots of existing (non-thin) logical volumes are under development.

Fedora and LVM

Posted Nov 1, 2012 15:16 UTC (Thu) by jwakely (subscriber, #60262) [Link]

> To me, LVM is like git.

Except Git is something I find immensely useful and am grateful for daily and therefore is worth bothering to learn.

As I said here last year (http://lwn.net/Articles/459233/) I still don't feel as though I'm missing out on anything by shunning LVM.

Fedora and LVM

Posted Nov 2, 2012 7:26 UTC (Fri) by Cato (guest, #7643) [Link]

Your example of leaving 500GB free space for use by either video recordings or experimental software is easily handled with raw partitions and GParted:

1. Create the video and software FSs, say 200GB each, on partitions
2. Leave 500GB unpartitioned free space
3. Decide to expand (say) the video FS, which is before the software FS
4. Use Gparted to move the software FS up by (say) 100GB, and expand the software FS by the same amount.
5. Wait while Gparted does all operations

I haven't included unmount/mount because in some cases using a live CD for Gparted is easier.

My point is that many common FS resizing operations are easily done by Gparted - it will take longer in the 'commit' stage when it does all the work than with LVM (due to moving the data blocks around), but you can leave your system running.

For the typical laptop/desktop case, Gparted + raw partitions are much easier than LVM commands + LVM. For servers where uptime is important, LVM is much better, but it requires some care to get all the commands right.

Fedora and LVM

Posted Nov 2, 2012 16:13 UTC (Fri) by Tobu (subscriber, #24111) [Link]

A LiveCD isn't just easier, it's necessary to be able to unmount partitions that are normally in use. More importantly, step 4 will take a long time and leave you with a thrashed filesystem if an interruption occurs. This is not user-friendly.

Fedora and LVM

Posted Nov 2, 2012 16:27 UTC (Fri) by Cato (guest, #7643) [Link]

I'm aware of why using a live CD is sometimes necessary, didn't think that was essential to mention on LWN.

LVM on older kernels (< 2.6.33) that don't fully support write barriers is also rather dangerous for everyday operations, not just filesystem moves/resizes, unless you turn off write caching in the hard drive (long story, search for "lvm risks" in google).

So whether you use LVM or Gparted, you need to ensure your machine doesn't crash, that the moving-stuff-around app doesn't crash (pvmove has been known to cause data loss due to lack of RAM, see my comments elsewhere).

LVM is somewhat safer if you have a good UPS and have correctly configured write barriers and write caches, but since I use UPSes for my PCs and have yet to had a PSU failure or machine crash during a Gparted operation, I'm happy that the risk is quite low.

In fact the one time I lost data with GParted was when not using a live CD - the rather old kernel + Gparted versions meant that the partition table wasn't properly updated and I omitted to reboot. So a live CD is definitely the way to go.

Whatever method you use, you really need to do a full backup anyway, which guards against the sorts of data-loss mentioned here. So it comes down to speed, ease of use, reliability, etc.

Fedora and LVM

Posted Nov 2, 2012 21:50 UTC (Fri) by Tobu (subscriber, #24111) [Link]

I'm aware of why using a live CD is sometimes necessary, didn't think that was essential to mention on LWN.
I mean, with LVM I don't need to bother with bootable media. I wanted to highlight this difference (this FESCO spat brought up the petty in me, sigh).

Fedora and LVM

Posted Nov 2, 2012 17:38 UTC (Fri) by nix (subscriber, #2304) [Link]

Last I saw of it (which was years ago, I don't use partitions anymore), if you changed a partition table on a block device which was in use, you had to reboot before the kernel would pick up the new partition table.

That adds a new step 6, 'reboot'. That's a totally unnecessary reboot with LVM.

Fedora and LVM

Posted Nov 12, 2012 3:34 UTC (Mon) by steffen780 (guest, #68142) [Link]

Just run partprobe, always worked for me. I assume there is a reason why this isn't called automatically, but I don't have the slightest clue of what that may be.

Fedora and LVM

Posted Oct 31, 2012 17:27 UTC (Wed) by nix (subscriber, #2304) [Link]

That's not LVM's problem, though: it's the fault of the delicate initrd not handling the userspace initialization LVM needs properly, which could presumably bite booting off md/RAID as well. I've been using a simple initramfs linked into the kernel image for eight years now, giving me md, LVM-atop-md, md-atop-LVM and both-atop-NBD if needed. Total number of boot failures attributable to LVM in all that time: zero.

LVM has its nasty delicate corners (be scared of snapshots, for instance), but as a 'make it bigger when needed' tool, it still does the job, and is not notably unreliable in my experience.

Fedora and LVM

Posted Oct 31, 2012 17:51 UTC (Wed) by mjg59 (subscriber, #23239) [Link]

I don't think anyone's worried about the quality of LVM in terms of its implementation and the core userland tools, but it's really not as well integrated into the distributions as you'd like.

Fedora and LVM

Posted Oct 31, 2012 18:31 UTC (Wed) by dwmw2 (subscriber, #2063) [Link]

It's more than that. For most simple desktop/laptop installs, using LVM is a flagrant and gratuitous violation of the KISS principle. With the expected results.

Fedora and LVM

Posted Oct 31, 2012 20:55 UTC (Wed) by rleigh (guest, #14622) [Link]

There are some serious quality issues with LVM. I can (and have) locked up the kernel hard many times (no panic, just completely dead) using nothing more than "lvcreate -s" and "lvremove".

The schroot tool uses LVM snapshots to create and destroy transient scratch build environments. We use them on the Debian autobuilders. If you kick off 24 parallel builds on a 24 core system, the system will be dead as a doornail in a few tens of seconds. Entirely due to lvcreate/lvremote triggering what looks like some kernel locking bug. Even on systems only running a single build, we still regularly have lvcreate and lvremove failures. There's some fundamental bugs in LVM which really need fixing, and which I'm surprised haven't been addressed given that they are easily reproducible. schroot is admittedly a special case--most people don't churn through as many LVs as we do--rebuilding the whole archive is ~14 hours with 24 parallel builds, and ~18000 transient LVs (though it always died in under 5 mins, less than 100 LVs in). But it should certainly work without killing your system.

We now also support btrfs snapshots, and while the filesystem itself is still not perfect, I've not yet run into a single issue doing heavy parallelised snapshotting.

Fedora and LVM

Posted Oct 31, 2012 21:58 UTC (Wed) by BlueLightning (subscriber, #38978) [Link]

Sounds like a serious bug. Did you report it?

Fedora and LVM

Posted Oct 31, 2012 22:18 UTC (Wed) by rleigh (guest, #14622) [Link]

IIRC it was sent to the LVM and/or kernel lists.

Fedora and LVM

Posted Nov 1, 2012 21:39 UTC (Thu) by agk (guest, #23332) [Link]

> IIRC it was sent to the LVM and/or kernel lists.

Please would you dig up and post a link to this here?

Fedora and LVM

Posted Nov 1, 2012 23:23 UTC (Thu) by rleigh (guest, #14622) [Link]

I've had a good search, but I'm afraid I can't find it on either list, sorry. I may be misremembering, or just looking in the wrong place.

Fedora and LVM

Posted Nov 2, 2012 0:11 UTC (Fri) by agk (guest, #23332) [Link]

Well if you're still having problems, please let us know the details and we'll see what we can suggest. If it was 24 writeable snapshots of the same device, then it might be worth trying the new thin snapshots. (Set up the origin as a thin device, then drop the size parameter from CHROOT_LVM_SNAPSHOT_OPTIONS.)

Fedora and LVM

Posted Nov 2, 2012 0:28 UTC (Fri) by rleigh (guest, #14622) [Link]

Thanks Alasdair, it was indeed all writable snapshots of the same device in this instance. I'll give thin snapshots a go with a current kernel. I no longer have access to the 24 core system (which was also remote, making debugging lockups difficult), but I'll see what I can do on a local quad core system.

Fedora and LVM

Posted Nov 1, 2012 12:06 UTC (Thu) by Cato (guest, #7643) [Link]

I think most LVM users don't do much with snapshots, if they even use them, and the snapshot code is much more buggy as a result.

The non-snapshot LVM/DM code is not too bad, though there are some tools issues - e.g. pvmove can corrupt data if it runs out of memory - see http://serverfault.com/a/339899/79266 and http://deranfangvomende.wordpress.com/2009/12/28/a-primer...

Fedora and LVM

Posted Nov 1, 2012 17:44 UTC (Thu) by nix (subscriber, #2304) [Link]

pvmove uses snapshots internally, so this is just another indication of the general principle that LVM snapshots are dangerous.

Fedora and LVM

Posted Nov 1, 2012 21:32 UTC (Thu) by agk (guest, #23332) [Link]

> pvmove uses snapshots internally

pvmove uses mirrors, not snapshots.

It works by setting up temporary mirrors for the kernel to sync the data between the old and new locations.

Fedora and LVM

Posted Nov 1, 2012 22:29 UTC (Thu) by nix (subscriber, #2304) [Link]

Oh. You're right, of course. (I've only ever encountered one pvmove failure, anyway -- a deadlock -- and it restarted fine on reboot.)

Fedora and LVM

Posted Oct 31, 2012 23:32 UTC (Wed) by mezcalero (subscriber, #45103) [Link]

Actually I am concerned about the implementation. The fact that the LVM/dm userspace bits heavily rely on stuff such as sysv semaphores and things is just awful. If code uses SysV semaphores then this usually is a pretty strong sign that something is not right about the code, i.e. either that it hasn't been touched in decades, or that it simply is questionnable code.

But my main beef with LVM is and has been since years that it's assembly is just broken and wrong. They assume that during boot there was a time where all devices have shown up, and which point they can invoke vgchange -ay, and that's the only time where they need to enumerate devices. But that's really not how things work these days, and haven't been working in the last decade or so. Hardware devices show up all the time, and we do not know when all connected devices have been detected, so in the boot process we don't actually know when we could invoke "vgchange -ay". Also, harddisks in times of USB and iSCSI show up at any time, depending on network status and their own initialization time and there are no general rules about when initialization has to be complete. The way distributions hack around the fact that they don't know when to invoke vgchange -ay is by pulling in udev-settle and the atrocity that is scsi-wait-scan. These hacks make things work for the "majority" of runs, and as long as you only have SATA disks and other pretty standard stuff. But the question is whether the "majority" is good enough where reliability is required, and whether limiting stuff to SATA and friends is such a good choice. But on top of that, it's just slow, since it basically is little more than just delaying the boot arbitrarily in the hope that all possible devices might have shown up when some time passes. Of course, if you are unlucky the delay is not sufficient, but still everybody has to endure the delay.

This issue has been known by the LVM folks since many years, and pointed out to them again and again. But nothing ever happened. Now, they say they'll soon have the "option" to make LVM work like any other hw daemon and actually wait on its own for precisely the devices it needs and not longer, thus not delaying the boot any bit longer than necessary. And they'll investigate if they can make that "option" default one day... At that speed I am sure that LVM well get discovery/assembly right only after the time it already has been replaced by btrfs... (btrfs in turn does get all this right: assembly is based of device plug events and a btrfs raid will delay the boot only exactly until the point where all devices it actually needs have shown up. btrfs raid is hence hotplug-safe, snappy at boot and absolutely reliable).

Anyway, the take-away is: LVM is the one major slowness in Fedora's boot. It also adds fragility where it shouldn't. And this hasn't changed in years. LVM is written they way hardware was in the 80's and 90's, but it is not how hardware has beeen working in the past 15 years or so.

Fedora and LVM

Posted Nov 1, 2012 0:31 UTC (Thu) by marcH (subscriber, #57642) [Link]

While I use and like LVM on "normal" disks, I really never expected anyone would try to use it on removables or on top of iSCSI... What are the use cases here?

Fedora and LVM

Posted Nov 1, 2012 1:25 UTC (Thu) by Cyberax (✭ supporter ✭, #52523) [Link]

Using an external USB drive to temporarily expand a small internal SSD?

Fedora and LVM

Posted Nov 1, 2012 14:02 UTC (Thu) by TRS-80 (guest, #1804) [Link]

Proxmox VE uses it to store virtual machine images, which it can then LVM snapshot for crash-consistent backups while the VM is running. Being a VM hypervisor, iSCSI is a natural choice to allow shared storage and migration between hosts. I have it running at work and it's pretty awesome.

Fedora and LVM

Posted Nov 2, 2012 19:06 UTC (Fri) by phiggins (guest, #5605) [Link]

I used to run Fedora as my primary OS on my work laptop. I resized the Windows partition down but didn't remove it, and that left me with little space to actually work in. I put /home on a USB drive and used LVM. It was a huge mistake for exactly the reasons mentioned. It rarely was mounted automatically and caused big problems (I don't remember exactly what they were now) whenever the USB cable accidentally became disconnected.

I honestly can't remember why I used LVM in the first place, but Fedora using it by default probably influenced that decision.

I used to be in the "LVM is worthless confusing overhead for a desktop and even small servers" camp. Now that I have more experience with it after using it for years *because* Fedora made it the default, I have found its features useful a few times per year. However, I am still nervous that one day I will be unable to recover my data because LVM is too complicated and I won't know how to restore a non-booting system.

Fedora and LVM

Posted Nov 2, 2012 20:39 UTC (Fri) by nix (subscriber, #2304) [Link]

One saving grace of LVM is that the metadata backups are not just kept in /etc/lvm. They are *also* kept in a defined place on every PV (IIRC at the start), in ASCII. So if you are so badly shagged that you've lost / and vgscan can't reconstruct your VG, you can get started by sucking the metadata off the PV with dd. (But normally as long as the PVs are there the VG can be reconstructed. A VG doesn't have any existence beyond its PVs, after all: there is no 'VG area' that can get damaged to destroy your VG.)

Fedora and LVM

Posted Nov 1, 2012 21:06 UTC (Thu) by agk (guest, #23332) [Link]

> The fact that the LVM/dm userspace bits heavily rely on stuff such as sysv semaphores

Semaphores are used only by the LVM/dm code for synchronisation with the udev rules that have to handle asynchronous uevents.

On a system using udev, after LVM/dm creates a device (or group of related devices) it needs to wait until udev has finished setting up those particular devices before it continues. This is done by having the last udev rule decrement a (per-transaction) semaphore to zero, which the blocked LVM/dm code waits for.

Fedora and LVM

Posted Nov 2, 2012 2:17 UTC (Fri) by mezcalero (subscriber, #45103) [Link]

There is no excuse for every using SysV semaphores, unless you are living in the 80s. There are a multitude of alternatives around. But SysV semphores, na, thank you.

Also, LVM could just subscribe to udev devices coming and going with libudev like everyvody else, and things would be good...

Fedora and LVM

Posted Nov 2, 2012 3:58 UTC (Fri) by agk (guest, #23332) [Link]

> LVM could just subscribe to udev devices coming and going with libudev

If only! We had lengthy discussions with the udev developers which led to the existing synchronisation mechanism.

Fedora and LVM

Posted Nov 1, 2012 22:36 UTC (Thu) by agk (guest, #23332) [Link]

> This issue has been known by the LVM folks since many years, and pointed out to them again and again. But nothing ever happened.

If it had been easy, people would have submitted patches long ago:)

But the final piece of the assembly jigsaw is now passing our tests and should hit rawhide builds this week.

Fedora and LVM

Posted Nov 3, 2012 17:54 UTC (Sat) by Cato (guest, #7643) [Link]

I've just realised that I seem to have had this problem on a server using LVM a while back - I didn't have time to investigate so I just put a "vgchange -ay" into the /etc/init.d/checkfs script. This is on Ubuntu 8.04 LTS server, so it's a cross-distro issue, and the hard disks are SATA.

Presumably an earlier invocation had failed, with the result that the fsck step failed, causing boot to fail. A shame that LVM, which generally helps uptime in many cases, caused downtime here - presumably btrfs wouldn't have this issue as it doesn't require this extra 'vgchange' type step.

I really look forward to btrfs (or perhaps ZFS in-kernel) being mature enough to use, largely for the parent-block checksumming to catch various errors.

This is on a home server in an inconvenient location, where there is only voltage regulation not UPS, and the utility power is flaky - so reliable unattended reboots are really helpful.

Fedora and LVM

Posted Nov 5, 2012 10:51 UTC (Mon) by nmav (subscriber, #34036) [Link]

> Actually I am concerned about the implementation. The fact that the LVM/dm
> userspace bits heavily rely on stuff such as sysv semaphores and things is
> just awful. If code uses SysV semaphores then this usually is a pretty
> strong sign that something is not right about the code, i.e. either that
> it hasn't been touched in decades, or that it simply is questionnable code.

I like those generalizations. If a thing does A it is crap. While semaphores may be used in bad code, there is nothing to indicate bad code because it uses semaphores. Semaphores are a tool (arguably an old one), but as every tool it can be used in a bad way or _not_.

Fedora and LVM

Posted Nov 5, 2012 11:04 UTC (Mon) by dwmw2 (subscriber, #2063) [Link]

It's a generalisation. Of course it isn't 100% accurate but it's a good predictor. It's much the same as "code stored in BZR or SVN probably isn't worth the pain of trying to get it out of its antiquated version control system to look at it" — there are exceptions, but they are few.

Fedora and LVM

Posted Nov 6, 2012 13:33 UTC (Tue) by nix (subscriber, #2304) [Link]

The thing is, that's pretty much not true. Sure, dealing with such version control systems is painful, but if I followed those rules, I'd lose the source trees for Emacs, KDE (before the recent move to git), Enlightenment, Calibre... there's no real correlation between quality and choice of VCS, though if someone is still using CVS it is probably a sign that the project is not very actively maintained. Equally, there's no correlation between 'project is forced to use SysVIPC to interoperate with other software' and general quality -- only if the project used SysVIPC when it had another choice can such a conclusion be drawn.

Fedora and LVM

Posted Nov 6, 2012 16:19 UTC (Tue) by admax88 (guest, #75035) [Link]

OpenBSD uses CVS, and its pretty actively maintained and very high quality.

Fedora and LVM

Posted Nov 6, 2012 16:45 UTC (Tue) by nix (subscriber, #2304) [Link]

True. There are rare exceptions even here. (I can't think of many, though.)

Fedora and LVM

Posted Nov 6, 2012 16:52 UTC (Tue) by admax88 (guest, #75035) [Link]

Most of the original GNU software is still in CVS.

Just because a project doesn't adapt to the new hotness in version control doesn't say anything about the quality of the code.

The choice of VCS is more likely an indicator of the age of the project and/or the age of the developers.

Fedora and LVM

Posted Oct 31, 2012 18:50 UTC (Wed) by paulj (subscriber, #341) [Link]

My killer-app use-case for LVM is doing upgrades to a new root, while preserving ability to boot to the old. I snapshot my existing root, then clone it onto to a new root LV. This allows me to preserve my old root, and be able to fallback to it should something go wrong with the upgrade (which it does - Fedora Linux, perhaps Linux generally, seems to be getting ever more finicky about installed versions of initrd, kernel and inits).

Without LVM, I'd have to do the upgrades in place. With the risk of being fscked if it goes wrong. (Yes, I should burn recovery CDs in advance - Yum upgrade fails catastrophically infrequently enough that I often don't, but frequently enough though that I have lost day+ to reinstall and reconfigure more than once).

Fedora and LVM

Posted Oct 31, 2012 18:54 UTC (Wed) by paulj (subscriber, #341) [Link]

Oh, this is so useful, that I'm surprised that Fedora doesn't make use of LVM snapshots to do revertable upgrades.

If LVM snapshots could be promoted to writeable LVs, this process would be even easier. There doesn't seem be a way though. Since Solaris switched to ZFS and IPS, it does upgrades this way I think - through writeable snapshots.

Fedora and LVM

Posted Oct 31, 2012 20:11 UTC (Wed) by dtlin (subscriber, #36537) [Link]

Not sure what you mean by "writable LV" – LVM snapshots are already writable. If you want an wholly independent LV – perhaps you could just copy the snapshot to a new LV.

lvconvert --merge merges a snapshot back into the origin, for when you only want the snapshot's contents and not the origin's anymore.

(Hypothetically, at least. I've not yet tried it myself.)

Fedora and LVM

Posted Oct 31, 2012 22:28 UTC (Wed) by paulj (subscriber, #341) [Link]

They're writable now? That's changed then, and good news for me. Thanks! I'd heard DM might have merge back support somewhere, but hadn't noticed the LVM UI for it was in lvconvert - I've been looking at lvchange the whole time.

Thanks :)

Fedora and LVM

Posted Nov 1, 2012 12:10 UTC (Thu) by Cato (guest, #7643) [Link]

LVM snapshots are as buggy as a very buggy thing ... search "lvm bugs snapshots" for more and see the comment from the schroot developer above. They are also very slow because they multiply number of I/Os required for a changed block.

Seriously, do a lot of testing before you rely on LVM snapshots. Or just use btrfs.

Fedora and LVM

Posted Nov 1, 2012 23:02 UTC (Thu) by agk (guest, #23332) [Link]

> LVM snapshots are as buggy as a very buggy thing

They are pretty robust nowadays: the last kernel race I can recall that could lead to incorrect data was found a few years ago now.

But they are not designed to be efficient if they grow large or if you have many of them; and make sure they never run out of space (use the snapshot_autoextend* lvm.conf settings / --monitor y / dmeventd).

Fedora and LVM

Posted Oct 31, 2012 21:02 UTC (Wed) by dlang (guest, #313) [Link]

on my servers, I just do two root partitions and install the new OS into the currently unused parition.

works very well, no LVM needed.

I've also been bit my LVM and mount by UUID several times (did you know that mounting by UUID doesn't work if you have too many drives in your system? at least on some distros)

Fedora and LVM

Posted Nov 1, 2012 3:41 UTC (Thu) by faramir (subscriber, #2327) [Link]

>On my servers, I just do two root partitions and install the new OS into the currently unused parition.

That's fine for a fresh install. I believe the use case was for a easily revertable upgrade. Not the same thing.

Fedora and LVM

Posted Nov 7, 2012 13:00 UTC (Wed) by emmi3 (subscriber, #62443) [Link]

But it's not so much different either. I've ben using this "two primary root partition"-setup for quite some time on all my systems at work. Although I usually prefer to reinstall my desktop systems, this is how I would handle the "revertable upgrade" case:

- create an new filesystem with a different label on the unused partition
- copy the old system over
- change the label for the root filesystem in /etc/fstab to the new one (I would also grep through /etc/ for the old label eg. xubuntu1204, debian60, just in case)
- chroot into the new system and install grub to the new root partition and update-grub (or install and reconfigure extlinux... :)
- activate the new and deactivate the old partition
- reboot

If anything goes wrong just reboot into the old root. Using "MBR" this is a simple matter of pressing the shift-key and choosing the right partition at boot time.

Fedora and LVM

Posted Nov 7, 2012 18:26 UTC (Wed) by faramir (subscriber, #2327) [Link]

That's quite a lot of manual labor for every time you want to do a revertable upgrade. Which if it was easy enough, I think many would want to do for every upgrade.

Setting up LVM (with snapshots for /) might be a bit more difficult during the initial install, but it seems to me it is going to be a lot more convenient in the end.

In either case, you have to have done something up front during the initial install. i.e. Either used LVM or set aside a partition for your second root.

Fedora and LVM

Posted Nov 2, 2012 7:45 UTC (Fri) by Cato (guest, #7643) [Link]

I would far prefer to avoid buggy LVM snapshots, and the fragility of root on LVM that others have mentioned.

There's a simple non-LVM approach I've used a lot, which is to create two root FS partitions - install your current distro on one, then do 'rsync -avH' from one to the other, boot into that one, and do the upgrade there.

Or simply use a good backup tool to make a backup first - a 2TB drive is not much over $100 these days, just use rsnapshot or your preferred backup tool. If you run rsnapshot daily, it will complete very quickly on a root FS that doesn't change very much, and you can then easily do file-restores and inter-day comparisons of config files (not quite as nice as etckeeper but pretty good).

Once btrfs is more mature, its snapshots look really nice, and much faster than LVM's. Of course, backups are a really good idea either way.

Fedora and LVM

Posted Nov 1, 2012 23:55 UTC (Thu) by Tobu (subscriber, #24111) [Link]

Flexibility. It removes two restrictions that feel idiotic when one encounters them, namely: “oh you still have some space left but you can't give it to that filesystem, it's in the wrong place silly”; “oh you added a disk but you still can't give extra space to that filesystem”. These are punishment for not having supernatural foresight when buying drives and they are enraging. Now Btrfs would also fix these, but stability and performance aren't up to scratch yet.

The other benefit is not nearly as important, but still a good thing. LVM gives the ability to spin up VMs easily without relying on the host filesystem.

Fedora and LVM

Posted Nov 1, 2012 23:58 UTC (Thu) by Tobu (subscriber, #24111) [Link]

That was meant as a reply to dashesy, sorry.

Fedora and LVM

Posted Nov 2, 2012 0:19 UTC (Fri) by dlang (guest, #313) [Link]

the question is which issue do you run into more frequently

the need to resize anything other than the last partition on a disk (or have a filesystem span multiple drives)

or

the problames caused by LVM

for many of us, the cases where LVM would be useful are much more rare than the cases where LVM is a problem.

I almost never resize partitions after the system is created (especially on production systems)

I would not WANT to have a single filesystem that spanned multiple drives, that's what's known as RAID 0, and it means that if _either_ drive has problems, I can loose the entire filesystem.

meanwhile, the downsides have caused me problems more than once (including cases with colo systems where a drive has partially failed, the facility has replaced the drive and then 'helpfully' plugged in the old drive, now both have default LVM configs and the system is unusable)

Fedora and LVM

Posted Nov 2, 2012 0:46 UTC (Fri) by Tobu (subscriber, #24111) [Link]

That's “often” in the first column, and “huh?” in the second. The functionality is pretty basic and I've found it reliable. Most of my experience is from a desktop (long-lived in the same way as Theseus' ship).

That said, I don't mind learning from your colo problem. What made it hard to fix? Was the collision on UUIDs or logical names?

Fedora and LVM

Posted Nov 2, 2012 1:13 UTC (Fri) by dlang (guest, #313) [Link]

I think it was in logical names (others in this thread have mentioned being hit by that problem as well)

Fedora and LVM

Posted Nov 2, 2012 7:49 UTC (Fri) by Cato (guest, #7643) [Link]

I've seen similar issues on mailing lists when a hard disk from one Fedora machine is plugged into another Fedora machine - since they both use the default VG and LV names, much confusion results and it's not easy to recover from.

One tip for using LVM is to never use the default VG and LV names, to avoid this sort of thing.

I've lost far more time (and data) due to LVM complexities/issues than I have saved through easy expansion/moving of FSs. It makes upgrades and transferring to new PCs much more complex.

Fedora and LVM

Posted Nov 2, 2012 13:07 UTC (Fri) by Tobu (subscriber, #24111) [Link]

I've just tried it (using a VM to create a colliding VG name, then kpartx -a to make the nested partitions show up).

$ sudo pvscan
WARNING: Duplicate VG name V2: Existing 5daecde1-e30c-4ef8-bcf6-e501382f67b7 (created here) takes precedence over 8b814833-1a37-47d4-896d-5a8aa74f458f
  PV /dev/mapper/sda2p1   VG V2     lvm2 [1016,00 MiB / 0    free]
  PV /dev/sda5            VG V2     lvm2 [1,82 TiB / 13,00 GiB free]

$ sudo vgrename 8b814833-1a37-47d4-896d-5a8aa74f458f V3
  Volume group "V2" successfully renamed to "V3"

Accessing the partition was very easy, but then I had to edit the root= boot parameter to boot the VM (vgcfgrestore to undo the rename would also work). This could be improved by having root= be uuid-based (which Debian/Ubuntu don't do for LVM, don't know about Fedora), as well as by having the Fedora installer pick a more unique VG name.

Debian and Ubuntu pick the hostname as the VG name, this seems like a good way to prevent these collisions entirely.

Fedora and LVM

Posted Oct 31, 2012 17:59 UTC (Wed) by wagerrard (guest, #87558) [Link]

My issue with recent F18 nightlies hasn't been the presence or absence of LVM. It's been trying to put specific partitions on specific physical drives. I haven't figured out how to use the redesigned Anaconda to get that done. I thought I had with the 30 Oct nightly, only to discover that it had ignored one drive, used all of a 3TB drive for /home, created two swap partitions of different sizes, and put a 500MB /boot and a 58MB "/" on a 240GB SSD, leaving the remainder unpartitioned. That wasn't what I'd asked it to do.

The semantics of the partitioner have changed, as well. It talks about "reclaiming space" when it appears to mean creating a new partition table. How to go about that is not, to my thinking, made terribly obvious in the interface.

Looking forward to the Beta. This looks like a very nice release, Anaconda issues or no.

Fedora and LVM

Posted Oct 31, 2012 18:34 UTC (Wed) by dashesy (guest, #74652) [Link]

Is there any rationale to use LVM with normal desktop/laptops (other than being a test site for RH commercial customers). I always make sure LVM is not installed, but would like to hear if there is any benefits to it.

Fedora and LVM

Posted Oct 31, 2012 18:46 UTC (Wed) by marcH (subscriber, #57642) [Link]

Resizing and encryption made easier, aggregation made possible. If find it especially used on dual-boot systems where partition tables tend to be trickier anyway.

Fedora and LVM

Posted Oct 31, 2012 20:02 UTC (Wed) by nteon (subscriber, #53899) [Link]

encryption is provided by dm-crypt. I've used it without LVM successfully for a while. Is there a specific way LVM makes it easier?

Fedora and LVM

Posted Oct 31, 2012 22:37 UTC (Wed) by marcH (subscriber, #57642) [Link]

LVM allows several logical (and resizable) partitions, all encrypted at once with a single password in a single, big physical partition spanning almost the entire drive and going totally unnoticed at run time.

Can this be done without LVM? Dunno, maybe. In any case LVM looks like the standard way to do it: well documented, well supported, just works.

Fedora and LVM

Posted Nov 1, 2012 1:38 UTC (Thu) by mstefani (guest, #31644) [Link]

I have full disk encryption on my laptop with dm-crypt and *no* LVM but separate partitions. Works out of the box aka just the one password prompt at boot. And it works since at least F14 after 2-3 bugs in dracut were fixed after I reported them.

Fedora and LVM

Posted Nov 1, 2012 7:56 UTC (Thu) by marcH (subscriber, #57642) [Link]

Care to share more details? Is it really just one password or three times the same password?

Fedora and LVM

Posted Nov 1, 2012 21:34 UTC (Thu) by mstefani (guest, #31644) [Link]

I type the password only once at boot time and all partition (including swap) are decrypted. The UI is exact the same, if you use LVM or not; even in Anaconda.

Fedora and LVM

Posted Nov 1, 2012 23:55 UTC (Thu) by marcH (subscriber, #57642) [Link]

Sorry I wasn't clear. Let me rephrase: do you just have something like three partitions individually encrypted but all in the same way with the same password?

I'm not actually asking about the user interface or about how many times you type this or that but about the internal design. Once I understand the design I (we) will be able to draw my (our) own conclusions :->

Fedora and LVM

Posted Nov 2, 2012 1:15 UTC (Fri) by lacos (guest, #70616) [Link]

I think I can answer, because I have tested both "stackings" (not on Fedora but on RHEL-6).

/dev/sda1 is plaintext boot.

In experiment (a), /dev/sdb2 was handed to dm-crypt (--> /dev/mapper/luks-UUID), which was then formatted as the single PV in a VG, having three LVs (/, /home, and swap). In this case a single password is used.

In experiment (b), /dev/sdb2 was formatted as a single PV in a VG. Three LVs were created, individually encrypted with dm-crypt (using the same password), and then the three separate luks-UUID devices were formatted as /, /home, and swap. The boot process still only asks for "the" password once.

(Unfortunately, the real goal of this experimentation was not reached. The goal was to see if separately encrypting block devices (ie. in exp. (b)) would keep kcryptd from merging "request streams" targeting those separate devices, before they reach the IO scheduler. Alas, it's insufficient; as far as I understand, kcryptd instances (kernel threads?) are spawned per-CPU, not per-device, and whatever requests a given kcryptd instance issues looks same-origin to the IO scheduler, ie. serialized.

Even in experiment (b), an fsync() that follows a big, scattered write on "/" blocks a read request targeting "/home". I've seen stalls as long as 13 seconds on my laptop.

But it's my understanding that this is being worked on.)

Fedora and LVM

Posted Nov 5, 2012 10:26 UTC (Mon) by mstefani (guest, #31644) [Link]

There are four good old standard partitions, all encrypted and I have only one password. As it just worked, without being a nuisance, I happily ignored the implementation details.

Fedora and LVM

Posted Nov 1, 2012 21:01 UTC (Thu) by josh (subscriber, #17465) [Link]

I have the same use case for LVM: I want to encrypt both / and swap, but only enter my passphrase once at boot time. If that works without LVM, I'd happily stop using LVM.

Several encrypted partitions with one password and derived keys

Posted Nov 7, 2012 13:24 UTC (Wed) by emmi3 (subscriber, #62443) [Link]

On my Arch Linux and Ubuntu systems this works with "derived keys" see here: http://crunchbang.org/forums/viewtopic.php?id=4299 for a well written howto. It's a bit dated (now there is 'cryptsetup luksHeaderBackup') but still works.
But I remember reading that systemd did not support the "keyscript" option in /etc/crypttab, which is needed in this setup. Hope this is fixed by the time I upgrade to systemd on my Arch system.

Fedora and LVM

Posted Oct 31, 2012 19:09 UTC (Wed) by lolando (guest, #7139) [Link]

Resizing, as already mentioned, but also: moving data across disks when new disks appear (faster, bigger or simply new and without I/O errors); giving VMs a block device to use as storage rather than a file; snapshots for backups; or, quite simply, just wanting to have various bits of the filesystems on more different "partitions" than can be attained with physical ones.

Fedora and LVM

Posted Oct 31, 2012 22:28 UTC (Wed) by kris.shannon (subscriber, #45828) [Link]

I hate having to deal with systems that aren't using LVM. Growing partitions and moving data between physical disks all while the system is running have saved me so many times...

Fedora and LVM

Posted Oct 31, 2012 23:50 UTC (Wed) by dashesy (guest, #74652) [Link]

Thanks, that is exactly what I wanted to know. Specifically "giving VMs a block device to use as storage rather than a file" is something I find it useful too. I would have tried it if the new cool toy (Btrfs) was on the way.

Fedora and LVM

Posted Nov 1, 2012 12:12 UTC (Thu) by Cato (guest, #7643) [Link]

LVM is good when you require a server to be always up, but it's not really helpful on a desktop - Gparted etc are much easier for resizing or moving partitions (just copy and paste a partition to a new drive) and harder to get wrong for desktops.

Fedora and LVM

Posted Nov 1, 2012 12:42 UTC (Thu) by ricwheeler (subscriber, #4980) [Link]

If you need to change the allocation of space, you will always need something like LVM.

A specific example would be you have say "/" on /dev/sdb and "/home" on /dev/sdc. You discover that you have plenty of unused space in sdb and are running out of room in /home (due to say, storing too mail flame war threads on LVM use).

Obvious solution is to cut down the size of sdb and give that space to /home.

With LVM, the virtual block space can be composed of non-contiguous chunks of physical storage. Without LVM, you can only shrink a partition or grow it into unused space. There is no way to get ext4 or xfs to use that freed up space.

Traditional file system work only on a single device and that block space must be contiguous.

With btrfs, you could shrink sdb, make a new partition in the chunk you freed up and then feed that to btrfs, but that is not the default Fedora file system at the moment.

Fedora and LVM

Posted Nov 1, 2012 12:53 UTC (Thu) by Cato (guest, #7643) [Link]

The use case you mention is exactly what Gparted does - just reboot into Gparted Live CD, edit the partition boundaries (drag and drop one to be larger, other to be smaller), then hit commit and wait for everything to be done.

Gparted is excellent at this - easy to use and very safe in my experience. LVM is much harder unless you already have LVM skills, and even then it's easy to get something slightly wrong.

Fedora and LVM

Posted Nov 1, 2012 14:05 UTC (Thu) by TRS-80 (guest, #1804) [Link]

Gparted somehow has the ability to make filesystems span multiple disks, which is what was implied in the grandparent post? (Expanding /home over /dev/sdb and /dev/sdc)

Fedora and LVM

Posted Nov 1, 2012 15:17 UTC (Thu) by ricwheeler (subscriber, #4980) [Link]

You either misunderstand the example or just need to try it.

Gparted cannot add space from before the beginning of a file system to its end.

You could do a block by block (disk level/offline) copy, but that would be very slow and quite risky.

Fedora and LVM

Posted Nov 1, 2012 15:47 UTC (Thu) by Cato (guest, #7643) [Link]

I missed the part where you implied the free space was not at the end. Clearly some defragging would be needed before using Gparted (an rsnapshot backup and restore into a newly created FS would work fine).

So in this case, LVM might be less work.

Generally I find that partitions tend to fill up and you need to expand them by moving other partitions around that are not as full, and shrinking some of the less full ones - I've not yet had a case where fragmentation prevented this shrinking, so in the no-defrag-needed scenario, Gparted is still much less work than LVM, and a lot easier of course.

Fedora and LVM

Posted Nov 1, 2012 17:48 UTC (Thu) by nix (subscriber, #2304) [Link]

You see, with LVM that 'moving other partitions around that are not as full' case -- always rather hair-raising -- disappears. All you have to do is possibly shrink one fs and expand another one.

I've ended up leaving most space in a VG free until I need it, which means I hardly ever have to shrink fses at all (a good thing because most fses cannot be shrunk without being unmounted). This makes expanding an fs that's out of space, no matter whether it's immediately followed by another fs or not, a matter of five minutes' work with no unmounting, no loss of service, and a near-zero chance of data loss. You just *cannot* do that without some LVM-like indirection layer (in btrfs and ZFS's case, inside the filesystem itself).

Fedora and LVM

Posted Nov 1, 2012 21:29 UTC (Thu) by rleigh (guest, #14622) [Link]

I did this until very recently. I've used LVM on all my systems since LVM came into being, and did online resizing of LVs as and when required. But after recently acquiring an SSD, the system is on Btrfs, with subvolumes used where I would previously have had LVs. No problems so far, though I'm not yet so trusting that /home and /var are still on ext4 on LVM+mdraid. I might move them over once I have gained more trust in it, though after losing an entire RAID1 Btrfs filesystem after a SATA cable glitch earlier in the year, that won't be for a good while.

For me at least the Btrfs improvements are the immediate snapshotting at the FS level, and that the free space is available to all partitions--I don't have to allocate the space up front to the different subvolumes. It would be great if the distribution installers would automatically use subvolumes appropriately when installing onto Btrfs, though I've not checked recently to see how this improved.

Fedora and LVM

Posted Nov 2, 2012 7:17 UTC (Fri) by Cato (guest, #7643) [Link]

I guess it comes down to trusting GParted to get it right for the partition resizing and moving, with it generating all the various commands - I have yet to lose data when using a reasonably recent Gparted and kernel, whereas with LVM there are quite a few commands to get exactly right, and due to write caching/barrier problems on older kernels I have lost data through LVM.

Fedora and LVM

Posted Nov 1, 2012 23:57 UTC (Thu) by Tobu (subscriber, #24111) [Link]

Flexibility. It removes two restrictions that feel idiotic when one encounters them, namely: “oh you still have some space left but you can't give it to that filesystem, it's in the wrong place silly”; “oh you added a disk but you still can't give extra space to that filesystem”. These are punishment for not having supernatural foresight when buying drives and they are enraging. Now Btrfs would also fix these, but stability and performance aren't up to scratch yet.

The other benefit is not nearly as important, but still a good thing. LVM gives the ability to spin up VMs easily without relying on the host filesystem.

Fedora and LVM

Posted Oct 31, 2012 19:03 UTC (Wed) by drag (guest, #31333) [Link]

Having multiple partitions or LVs in desktop/mobile Linux is one of those things that people often do for historical or traditional reasons while having no real practical value. At best it is just a waste of a few moments during install, at worst you find yourself having to resize things later on.

Now if your having a server setup then there is good reasons for it, but you are not going to be u sing the defaults anyways. So whether or not LVM is on by default is really of little impact.

Fedora and LVM

Posted Oct 31, 2012 20:18 UTC (Wed) by nix (subscriber, #2304) [Link]

Your assumption here is that desktop systems contain no valuable data, so a bit of fs corruption in e.g. /var that takes /home with it is not a problem.

I'm not sure that's always true.

Fedora and LVM

Posted Nov 1, 2012 0:52 UTC (Thu) by butlerm (subscriber, #13312) [Link]

>a bit of fs corruption in e.g. /var that takes /home with it

That is a weakness in the filesystem that shouldn't require hard partitioning to resolve. It would make a lot more sense for a filesystem to be able to place files from different directory trees into internally independent allocation groups, such that a corruption in one of them would be no more likely to take another down than if they were in separate partitions.

That would be one way to radically speed fsck times as well.

Fedora and LVM

Posted Nov 1, 2012 17:55 UTC (Thu) by nix (subscriber, #2304) [Link]

To some degree, ext4 does this -- for that matter so does ext3. However, if one group gets full, an allocation is going to come from a different group, possibly one containing blocks from elsewhere, and they all share the same journal, the same inode tables, the same superblock and so on. Fundamentally there are a lot of shared data structures there, and if one of them gets corrupted, every related structure is at risk. (Also, e.g., a mv between two distant directories on the same filesystem is not normally expected to move all its blocks from one group to another, but on different filesystems, it does.)

With entirely independent filesystems, this problem goes away -- and moving *that* down into the filesystem is redundant, because we already have the ability to do just the same thing by making more than one filesystem.

Fedora and LVM

Posted Nov 1, 2012 18:43 UTC (Thu) by ssmith32 (subscriber, #72404) [Link]

I've heard this before.. but never quite understood the logic.

/home will always be on a partition with a given probability of failure.

Whether or not /var is on a separate partition does not seem like it would much affect probability of the fs metadata for /home getting corrupted.

I suppose /var may get written to more frequently (and thus increasing the chance of messing up the fs metadata), but on a desktop system, I would think the difference in the rate between which /home and /var is written is not that great.

And I haven't ever had trouble upgrading a system with a single partition (another common reason given).. installing a brand-new OS, yes.. upgrading no.

Fedora and LVM

Posted Nov 1, 2012 22:31 UTC (Thu) by nix (subscriber, #2304) [Link]

/var is written to very frequently: in particular, because wtmp is on /var, it is written to right before major changes of system state when the system is particularly likely to go wrong (suspend/resume, login, logout, reboot, shutdown, any event that triggers a log write). Thus it is likely dirty at such times, which makes it particularly prone to corruption.

Writes to /home are relatively rare by comparison (even for me, with subscriptions to dozens of mailing lists all going into nnml spools under /home).

Fedora and LVM

Posted Nov 2, 2012 0:25 UTC (Fri) by ssmith32 (subscriber, #72404) [Link]

That does make sense :)
Much better than the hand-waving I've heard before.. ;)

Fedora and LVM

Posted Nov 2, 2012 17:31 UTC (Fri) by nix (subscriber, #2304) [Link]

Oh it started as handwaving -- i.e. I didn't do more than simple blktrace benchmarking for a few minutes to look at the relative write rates after the initial mkfs -- but it became clear in the recent ext4 corruption fiasco that the handwaving had a basis in fact :) I corrupted /var repeatedly, and /home once or twice at most.

Fedora and LVM

Posted Nov 1, 2012 4:21 UTC (Thu) by nickbp (guest, #63605) [Link]

I keep /home on a separate partition so that reformatting / during eg an OS upgrade has no effect on my useful data. That's it though.

Fedora and LVM

Posted Oct 31, 2012 19:45 UTC (Wed) by mmcgrath (guest, #44906) [Link]

"""
My anaconda don't want none of those LVM Lun's.
"""

sorry, couldn't resist.

Fedora and LVM

Posted Oct 31, 2012 23:50 UTC (Wed) by mitchskin (guest, #32405) [Link]

I stopped using LVM on my desktop/laptops for two reasons: first was the lack of write barriers (now, happily, fixed according to the LVM wikipedia article).

The second reason is because of an awkward experience I had with it when I upgraded a laptop to a larger hard drive. I installed a fresh fedora installation with LVM on the new drive (since the HD upgrade was an opportunity for a clean fedora upgrade). Then I put the old drive into a USB enclosure to copy my /home LV to the new drive. But, since both drives had physical and logical volumes with the default names, that left me with multiple volumes with the exact same names. I've forgotten what I had to do to straighten things out, but it took much more R'ing of The FM than I had expected.

Fedora and LVM

Posted Nov 1, 2012 1:15 UTC (Thu) by PaulWay (guest, #45600) [Link]

One thing I love about LVM, and hate about not using it, and the fundamental reason why I think it should be used by default is:

Flexibility.

Sure, you can always do equivalent operations using raw partitions to the standard uses of LVM - setting up new partitions after your initial install, extending partitions, moving entire partitioning systems to new disks without downtime, etc. But they're painful, low-level operations that require a lot of hassle and are fraught with the possibility of adgering your entire system. Get one partition number wrong, forget that some numbers are written in 512-byte sectors and others in 2048-byte blocks and still others in 1024-byte kilobytes, and you might as well say goodbye to your system and start again.

Yes, you can use special graphical tools to reduce the likelihood of error on some of these things. LVM has one of those too.

Yes, a competent sysadmin can work around all these issues. LVM makes all of that easier.

Yes, if you know what you're doing you can set up your system with a spare set of partition entries just in case. But LVM saves you from having to know in advance that you might, at some point, need a second root partition or whatever.

Yes, the 'normal user' might not see those things. And the 'normal user' might never see a bash prompt, but we still install bash because of all the other uses of it.

LVM provides flexibility, future-proofing, and makes complicated operations simple.

I see lots of packages - systemd, LVM, SELinux - where there are plenty of vocal anecdotes of people who didn't understand it and disabled it and now never use it. I also see lots of anecdotes of people who swear off using AMD processors, or Seagate hard drives, or Asus motherboards, or whatever, because of that one time that they got hurt by some weirdness that they didn't understand at the time. This is magical thinking, people. Learn the new systems, rather than stepping away from them. Question your habits, rather than being a slave to them.

(Unfortunately for me, I installed F18 alpha at a stage where LVM didn't even seem to be offered as a partitioning option.)

Have fun,

Paul

Fedora and LVM

Posted Nov 2, 2012 0:23 UTC (Fri) by marcH (subscriber, #57642) [Link]

> Learn the new systems, rather than stepping away from them. Question your habits, rather than being a slave to them.

After reading the whole thread again, it's becoming very clear that any disk indirection layer like LVM is a "mobile phone-like" technology: people who never really used any of its features still don't see the point, while the people who got used to it can never go back.

Very same thing with Decentralized VCS.

This is of course independent of the quality of LVM as a specific product instance.

Fedora and LVM

Posted Nov 2, 2012 6:38 UTC (Fri) by cmccabe (guest, #60281) [Link]

I have used both LVM and non-LVM. I currently don't choose to install it on my desktop or laptop computers. I admit to not being the biggest expert on LVM, but I don't think my choice is irrational.

Here's why:
* I often move my old partitions to a new Linux distro. Since the initrd / initramfs / etc code gets rewritten approximately every release, porting a complex setup is painful. On the other hand, just mounting a partition is easy.
* If you use something like RAID0 (I forget what LVM calls it), and one drive fails, all of your data is gone. "Too big to fail," unfortunately doesn't apply to volume groups. I'm sure there's a way to RAID5 it, and so forth, but then you have to start worrying about things like whether the drives are the same size, what is the correct stripe size to use, whether write barriers are fully supported on your configuration, and so forth. Again-- if you value your time, simple is better.
* If I really need to change the size of an ext3, ext4, etc. partition, the gparted boot disk can do it easily. I can even move partitions with dd or rsync (although that is rarely necessary.)
* Sometimes I even have to give more space, or take space away from, the OS of the Beast (yes, I still have one computer that dual-boots.) LVM can't help me with this-- in fact, it hurts severely, because gparted can't resize a partition which LVM is managing. So if I forget to uncheck the LVM install checkbox on my dual-boot PC, and I need to shrink the Windows partition, I'm screwed.

LVM makes more sense in a server environment, I think. Of course, even in a server environment, you often have things like RAID cards doing this kind of thing for you. Like everything else in storage, at the end of the day, it really depends on your use case.

Fedora and LVM

Posted Nov 2, 2012 7:24 UTC (Fri) by dlang (guest, #313) [Link]

frankly, the way things are going today in server environments, you don't resize partitions, you create a new VM and trash the old one.

Even if you are running on bare hardware, the trend is strongly towards either using network storage, or just reimaging the system if you have something as major as partitioning wrong.

on desktop/laptop systems, there aren't a lot of reasons for doing anything other than 'one big partition' (although I modify this to two small partitions for / and everything else for /var, with /home being a link into /var to make major OS changes easier)

Yes, you can make lots of small partitions and leave space unallocated to add later, but the odds of that being better than just using the entire disk as one partition are pretty low (especially for the average user)

Fedora and LVM

Posted Nov 2, 2012 12:02 UTC (Fri) by marcH (subscriber, #57642) [Link]

> So if I forget to uncheck the LVM install checkbox on my dual-boot PC, and I need to shrink the Windows partition, I'm screwed.

I understand you are "screwed" only because you cannot live without gparted.

Dual-boot is where I found LVM really, really kicks ass.

Realize you allocated too much space for Windows. Shrunk Windows and re-allocate what you just got to ANY other partition ANYWHERE on the system without moving anything. Simply cannot be done without an indirection layer like LVM.

Fedora and LVM

Posted Nov 2, 2012 23:37 UTC (Fri) by cmccabe (guest, #60281) [Link]

I didn't realize that LVM could handle this scenario. Thanks for pointing that out.

To be honest, I never like to make changes to the partition table of a disk without rebooting or hotplugging the disk. The kernel sometimes doesn't refresh its view of the partition table (or has this been fixed in newer kernels?). So while online resize of physical (windows) partitions without rebooting may be possible in theory, I'm not sure if I would choose that route for an internal disk.

Fedora and LVM

Posted Nov 12, 2012 3:01 UTC (Mon) by mfedyk (guest, #55303) [Link]

I believe you can have the partition table reread while one or more of the partitions have mounted filesystems on them in the 3.6 kernel now.

That may be a reason for the attempted change in f18. The ability to extend a partition online without needing lvm.

Fedora and LVM

Posted Nov 12, 2012 3:46 UTC (Mon) by steffen780 (guest, #68142) [Link]

Posted this further above, but this has become a rather lengthy comment thread.. just run partprobe. I've used this with mounted in-use FSs many times without any problems.
Disclaimer: I have no idea if doing this is dangerous, but it has never bitten me.

Fedora and LVM

Posted Nov 3, 2012 18:14 UTC (Sat) by Cato (guest, #7643) [Link]

GParted can cover this fine including the Windows volume shrinking:

- shrink Windows volume
- move any partitions as required until the free space is next to the partition you want to enlarge
- drag the boundary of that partition to fill the free space
- hit Commit button
- come back some time later to find it's all done

For a desktop/laptop this can be done overnight, and is so much easier than having to mess with LVM (as I used to do, making copious notes on the right commands so I could remember them next time, since such rearrangements are not a weekly occurrence.)

LVM is great for other use cases but unless you have a very high uptime requirement for your PCs, and are expert in LVM, it's not for laptops/desktops.

Of course if there was a Gparted-like tool for LVM, this might change the picture - why reboot into Gparted if an "LVM edit" GUI tool does the same thing?

Fedora and LVM

Posted Nov 4, 2012 11:28 UTC (Sun) by marcH (subscriber, #57642) [Link]

> move any partitions as required until the free space is next to the partition you want to enlarge

The only reason you find this "easier" (I clearly don't) is because GParted has a graphical interface while LVM has not (yet?).

To the best tool is quite often the one you are the most familiar with.

When repartitioning I trust nothing and no one (neither GParted nor myself). So I much prefer spending 10 minutes googling and reading the LVM man pages and eventually do something conceptually simpler and that involves 5 or 10 times fewer operations, i.e, 5 or 10 times less chances for something to break.

Fedora and LVM

Posted Nov 3, 2012 18:10 UTC (Sat) by Cato (guest, #7643) [Link]

Actually you can just use Copy and Paste on entire partitions in Gparted - very nice feature e.g. if you want to move to a larger disk then expand some partitions.

Fedora and LVM

Posted Nov 4, 2012 7:13 UTC (Sun) by Cato (guest, #7643) [Link]

GParted has just added (as of mid Oct) support for read-write of LVM2 PVs - http://gparted-forum.surf4.info/viewtopic.php?id=16575 - of course, the usual caveats to bleeding edge code apply, but if you have good backups it would be worth a try.

Beginning LVM support in GParted

Posted Nov 15, 2012 17:37 UTC (Thu) by JanC_ (guest, #34940) [Link]

Thanks to our new GParted developer, Mike Fleetwood, for working on that... :)

Fedora and LVM

Posted Nov 3, 2012 18:08 UTC (Sat) by Cato (guest, #7643) [Link]

Actually I've used LVM a fair bit on various Linux systems, and got burnt by it, including significant data loss (write barriers not being implemented, mostly). Then I was very anti-LVM, now I have a more balanced position, in my view: it's good for servers where high uptime is needed, but overkill for most desktops where raw partitions and Gparted are safer and easier.

I am about to extend use of LVM on one server where I need to add a large disk, and want a single huge LV across several disks. (Something that the raw partition model can't deliver).

However, on a laptop/desktop I would not use it (perhaps for a desktop to span disks, but not within a single disk.)

I would not have spent this much time ranting about LVM if I had not used it quite a lot...

Fedora and LVM

Posted Nov 3, 2012 20:39 UTC (Sat) by dlang (guest, #313) [Link]

> t's good for servers where high uptime is needed,

being a bit picky here.

servers don't need high uptime, the services they provide need high availability time. This is not the same thing (even though it sounds like it should be)

pushing for high uptime on a single server will get you quite a ways towards high availability time, but then you hit a wall and you need to move to cluters of machines. Once you move to clusters of machines, the need for high uptime on a each individual server drops dramatically.

While the clustering adds complexity, this now allows for management of the indivudal servers to be much simpler as you are no longer racing the clock for each change. This (usually) results in a very dramatic improvement in service availability, and a dramatic _decrease_ in _unplanned_ server downtime. there is more _planned_ server downtime, but it's the unplanned downtime that your customers notice.

There is a small (and shrinking) pool of application types that are really hard to cluster and really do need high uptime, but far fewer than you would think.

Fedora and LVM

Posted Nov 1, 2012 1:42 UTC (Thu) by jwboyer (guest, #23296) [Link]

"Also relevant is that the current plan is for Fedora to switch to Btrfs during the Fedora 19 development cycle."

Actually, just to be clear, there is no such plan. There was a suggestion by someone that it be done, however it has no Feature page for it and FESCo has not reviewed anything along those lines. It might sound like splitting hairs, but Fedora as a distribution has no official plan to switch the default filesystem at this time.

Fedora and LVM

Posted Nov 1, 2012 15:21 UTC (Thu) by ricwheeler (subscriber, #4980) [Link]

There was an official Fedora Feature page to make btrfs the default, written up by Josef Bacik, that we killed at the last minute since the repair tool was not ready.

Have a look at:

https://fedoraproject.org/wiki/Features/F17BtrfsDefaultFs

The suggestion to make it the default was made by the btrfs people and will need a formal feature page (hopefully we will be able to leverage the old one to some extent).

Fedora and LVM

Posted Nov 1, 2012 20:08 UTC (Thu) by johannbg (guest, #65743) [Link]

With my QA hat one I would like to say the we ( the QA community ) would very much appreciate an whole development cycle dedicated to btrfs and related features strictly to do testing *before* we switch to it as the default filesystem for the coming years.

Which means F19 would be used to do testing along with the F20 development cycle and the "official" switch be made in F20. ( F19 experimental/testing, F20 official unless of course if we wind up lengthening the release cycle to say 9 months... )

And I would not be surprised if the documentation community would want to do that as well to properly document it and related features.

With lessons learned from this release cycle I also expect the distribution feature process to be completely different in F19 from what it has been in previous release cycles.

Fedora and LVM

Posted Nov 1, 2012 12:16 UTC (Thu) by etienne (guest, #25256) [Link]

There is also the initial meaning of partitions: what the OS is allowed to access and what it shall not touch.
If I want two different Linux distribution (or two different versions) on the same disk I do not want to use two LVM versions to manage it.
Now if the distribution wants to use LVM on its own partition, there is no problem, but trying automagic there is risky.

Fedora and LVM

Posted Nov 2, 2012 11:18 UTC (Fri) by tom.prince (guest, #70680) [Link]

LVM volumes play the same role. They also make it easy to migrate from one distribution to another, without needing to repartition, and beeing able to switch back easily. Certainly, as other people have pointed out elsewhere here, you can get that by leaving an extra parition, or by resizing them later. But it is much more convenient to do with LVM, since all you need is some unallocated space.

Fedora and LVM

Posted Nov 1, 2012 20:55 UTC (Thu) by johannbg (guest, #65743) [Link]

And this is just plain wrong

"The Fedora Engineering Steering Committee (FESCO) took up this issue and brought it to a vote on October 30. Full consensus was not to be found there either, but, in the end, FESCO voted in favor of the change back to the pre-F18 default. So, unless something gets derailed somewhere, the Fedora 18 will, like its predecessors, install and use LVM by default."

I brought it to their attentions since this was brought up *after*'we were in freeze and we in QA had been doing all our testing and decisions based on ext4 being the default filesystem.

The reason "Full consensus was not to be found" was because all the fesco members were unable to respond to that ticket in the time it was needed so once the majority was achieved we moved on.

If the newUI would have continued to offer users to hash or unhash lvm when the default partitioning was chosen ( as it did in F17 ) this discussion would never have taken place in the first place .

Having lvm as an default also destroys the ability for users to boot directly from an ext4 partition without initramfs which was entirely left out from "lvm as an default" discussion...

Fedora and LVM

Posted Nov 2, 2012 0:09 UTC (Fri) by Tobu (subscriber, #24111) [Link]

Having lvm as an default also destroys the ability for users to boot directly from an ext4 partition without initramfs which was entirely left out from "lvm as an default" discussion...

Why would this be supported? An initramfs provides a ton of flexibility and the cost is about zero, it's just a second file next to /vmlinuz.

Fedora and LVM

Posted Nov 2, 2012 10:03 UTC (Fri) by johannbg (guest, #65743) [Link]

I think it's better you explain to me why this should not be supported?

Like majority of laptop/desktop users I have absolutely no need for the "advanced requirements" that initramfs brings so why would I want to use it? Why would I want to have and use additional bug layer on my system for no benefits to me at all?

Fedora and LVM

Posted Nov 2, 2012 15:15 UTC (Fri) by raven667 (subscriber, #5198) [Link]

I doubt that's actually true, there are many different requirements for desktop/laptop users that work best with or require initramfs setup at boot time. The only way to not need it is to greatly reduce the capability of the system or increase the fragility of the boot process. If you want encrypted block devices, software RAID, dependency ordering for hardware initialization, etc. then it's best to do that from an initramfs. Maybe you don't want these things but other people do so it has to be supported by default.

Fedora and LVM

Posted Nov 2, 2012 16:32 UTC (Fri) by johannbg (guest, #65743) [Link]

Please enlighten me how this greatly reduce the capability of the system or increase the fragility of the boot process ( given that I have not been bit by several bugs we have encounter with the initramfs ) or how I cant use encrypted block devices ( like I'm currently doing ).

I dont need or want lvm I dont use hw or sw raid and if I need additional storage I buy external disks or rather use my spideroak account on the cloud to share across all my devices and where I dont have to worry about the disk failing and I could loose my data or I simply use my own local nas at home.

I'm not saying that users should not be able to setup and use initramfs but for laptop/desktop use cases I dont see the argument why they need it

I certainly dont and I prefer faster and more reliable bootup.

Fedora and LVM

Posted Nov 2, 2012 17:35 UTC (Fri) by nix (subscriber, #2304) [Link]

It doesn't even need to be a second file. You can link it into the kernel, and then you don't need to worry about *ever* ending up with a kernel without the initramfs, or vice versa, or version skew between them.


Copyright © 2012, Eklektix, Inc.
This article may be redistributed under the terms of the Creative Commons CC BY-SA 4.0 license
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds