LWN.net Logo

Fedora and LVM

Fedora and LVM

Posted Oct 31, 2012 19:03 UTC (Wed) by drag (subscriber, #31333)
Parent article: Fedora and LVM

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.


(Log in to post comments)

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 (subscriber, #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.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds