LWN.net Logo

Fedora and LVM

Fedora and LVM

Posted Nov 1, 2012 12:53 UTC (Thu) by Cato (subscriber, #7643)
In reply to: Fedora and LVM by ricwheeler
Parent article: Fedora and LVM

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.


(Log in to post comments)

Fedora and LVM

Posted Nov 1, 2012 14:05 UTC (Thu) by TRS-80 (subscriber, #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 (subscriber, #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 (subscriber, #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 (subscriber, #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.

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