LWN.net Logo

Fedora and LVM

Fedora and LVM

Posted Nov 2, 2012 7:26 UTC (Fri) by Cato (subscriber, #7643)
In reply to: Fedora and LVM by tialaramex
Parent article: Fedora and LVM

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.


(Log in to post comments)

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

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