6 ms·
Stop using partitions. Use LVM!
by holowoodman 6d ago
Stop using partitions. Use LVM!
- greedo 6d agoLVM for a *nix sysadmin is cheat mode for managing storage.
- jenders 6d agoHow often are you needing to change partition geometry after install, on a server?
- holowoodman 6d agoDepends. Some customers do run a lot of "pets, not cattle" servers, and those can get a few extra hard disks if space runs out. Some security guidelines prescribe separate volumes/filesystems for e.g. /home or /var/log, so log spam doesn't kill the whole system as easily. But of course, this means that sometimes the initial sizes aren't right and you need to extend something. In those cases, which happen a few times per year, not using LVM would be a huge problem. But even for the "frequently reinstalled cattle"-usecase, LVM has benefits, e.g. snapshots for backups, debugging and forensics.
- simoncion 5d agoMy short answer is "Not frequently, but when I do, I'd be very angry about having to screw around repartitioning a disk instead of fiddling with an LV, VG, or some PVs.". I use LVM on all my non-appliance Linux systems, [0] both servers and desktops. Given that few (no?) filesystems support online shrinking but every one that you'd use as '/' supports online growing, my strategy is to take a fairly conservative guess at how big my various subdirectories need to be and leave most of my available space unallocated. Later on, if I -say- find that I need more space in '/' or '/home', or prevent a blowup in '/var/log' from eating up all the space in '/' by putting that on a separate LV, etc, etc, it's just a few commands [1] and the job's done. [0] ...someone else has configured the storage scheme for the appliances, and I'm not going to override their choices... [1] ...and some data copying in the case of backing a subdirectory with a new volume...
- Kim_Bruning 6d agoStop using LVM. Use ZFS! (ZFS might be described as the love child of lvm and btrfs, 'cept ZFS got there first) ( Very briefly: you hand ZFS a stack of disks (in mirrors or raidz groups, for redundancy) and it makes a zpool. Then you carve the pool into datasets as needed. Each dataset looks like an ordinary directory and takes only the space its files actually use, so you never guess partition sizes again. And each one can have its own compression, snapshot schedule, quota, encryption, and send/receive backups, etc etc etc. )
- holowoodman 6d agoZFS is overrated and mostly a hobbyist/enthusiast thing. Performance of zvol is worse than for LVM logical volumes. Last I've looked, zvol for swap is just asking for trouble, up to and including deadlocks. ZFS filesystems do have weird edge cases and incompatibilities, e.g. around free space reporting, quota and the like. And support with software vendors e.g. for enterprise distributions or backup software is spotty at best.
- jenders 6d ago>> ZFS is overrated and mostly a hobbyist/enthusiast thing. Not true at all.. but most large object storage redundancy has moved to the application layer. There are still workloads that are a great fit but I agree OpenZFS is currently not well suited as a general purpose FS.
- throw0101d 5d ago> ZFS is overrated and mostly a hobbyist/enthusiast thing. As someone who originally ran it on Solaris when it came out ~20 years ago, and have continued to run it on FreeBSD and Linux, I would disagree.
- jenders 6d agoNot a btrfs user but OpenZFS u til recently didn’t even support O_DIRECT and may still duplicate page cache in arc. It’s not well suited as a general purpose FS where you can’t anticipate the workload, like on a desktop.