LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   LVM or btrfs (https://www.linuxquestions.org/questions/linux-newbie-8/lvm-or-btrfs-4175723711/)

bg368 04-03-2023 12:05 PM

LVM or btrfs
 
Hello all,
I have a sort of dilema and could use some help.
I recently wiped a hard drive and installed linux (Linuxmint if it matters), and since I am trying to stop distro hopping so much I gave the installation the whole disk.

The installer gave me the option to automatically set the disk for LVM. I did this. I know NOTHING about lvm other than I understand it allows for snapshots. I like that idea because I've used btrfs with Timeshift and it was good for me.

Little did I know what a rabbit hole LVM is. I am wondering if I should just reinstall the whole thing with btrfs (mainly for snapshots w/ Timeshift), or try to learn something about LVM.
I don't want to get into the same situation as when grub came to be. I didn't bother to figure out what was going on and just used it and now I have a hard time trying to catch up.

As usual, any and all advice is greatly appreciated.

wpeckham 04-03-2023 02:00 PM

It depends upon your life choices and objectives. If you want to administrate servers, there is more power and utility in LVM, which is quite mature and feature rich (and still improving from time to time). If you plan on just using commodity client side devices like laptops with only one or two drives (No RAID-5/6) then BTRFS is a more modern option that should age well without requiring the learning curve.

Note that BTRFS serves the same purposes as LVM PLUS the filesystem layed onto the LVM devices. (Normally EXT4)

LVM gives you more power and growth options, BTRFS has some power and options built-in. For a one or two drive system simple has the advantage. For large storage and data servers the extra power and utility of EXT4 on LVM pays off in the long run.

The nature of the media may matter more. BTRFS has SSD recognition and automatic tuning for digital storage, something LVM and EXT4 lack. (Although they may include some of that in the future.)

Also, EXT4 is faster for most applications at this time. BTRFS does not have BAD performance, in general, but it has some catching up to do. On the other hand if you have digital (SSD) storage then storage speed is probably no longer your bottleneck anyway and either is fine.)

If installing on a laptop or small desktop (One or two internal drives only) then I would go with BTRFS. If you have a server class machine with 6 to 24 fast internal drives or a fast-wide SCSI drawer for multiple drives then go LVM and run EXT4 on top.

rclark 04-03-2023 02:06 PM

For a home user (like me), I'd just stick with ext4 and be done with it. Backup your data periodically and your golden. Keep It Simple and fast. My 2 and 1/2 cents.

syg00 04-03-2023 05:52 PM

Use what you got. LVM has all you will likely need (as a home user too), but you apparently need to do some learning in your current setup. I don't like the snapshot setup in LVM compared to btrfs, but it can be made to work.

If LVM is a rabbit-hole, btrfs is the warren - your use of it in the past likely just skimmed the surface and used significant constraints imposed by the distro. And tool in this case. I've used it for over a decade, but it needs a lot of study to use fully. And when it breaks you get to keep the pieces.
I also use LVM when appropriate, so either will do the job.

sundialsvcs 04-03-2023 06:08 PM

LVM = Logical Volume Management is something that you do want, even if you don't need it yet. It doesn't cost you anything to have it.

Simply stated, LVM separates the idea of "a physical volume or partition" from "a mount point." A mount-point can now be divided among multiple physical resources, and it all happens behind the scenes. One day, when this-or-that volume runs out of space, you will be glad that you have it. You can simply "expand the physical storage pool" by adding another drive, and blissfully ignore how it actually works ... because "it just works." And, until that day happens, you can simply ignore the fact that LVM is there.

rclark 04-03-2023 06:53 PM

Quote:

One day, when this-or-that volume runs out of space, you will be glad that you have it.
That day is far far far far away here. When you have Terra bytes of space and only using a fraction of relatively 'cheap' disk space, it isn't going to happen. By the time it does, you'll be upgrading the system anyway years down the road or you'll be six feet under... On the other hand, if you 'know' your are accumulating data in Terra bytes per year (video surveillance, maybe?) , then it 'may' be worth it to use LVM. However it is easier to stick in another 18 TB HDD or 4 TB SSD and off you go. LVM just doesn't need to be on running on most home machines (and probably most business machines).... IMHO. Extra complication that just isn't needed.

bg368 04-03-2023 08:09 PM

Thanks fellas, all sage advice. For the record, I am going to re-install with ext4. Maybe its a good idea to stick to some familiarity. I shouldn't have too much need to recover from my usual distro-hopping fiascos, because I'm done with that. Famous last words?

sundialsvcs 04-06-2023 09:14 PM

I respect your professional opinion, @rclark, but do not share it. I perceive no "complication" from having LVM installed. Most of the time I simply ignore the fact that it is there, and it very kindly lets me do so. But I've always been glad to have it when I needed it.

rclark 04-06-2023 11:41 PM

That's ok :) . We all have different opinions and even the reasons for them -- even good reasons. All good. That said, tonight, I created a current backup of a a running 500GB SATA SSD drive which was getting a bit long in the tooth so to speak (over 3 years old and half full) -- just in case. Then used clonezilla to clone it to a new 2TB m.2 PCIe SSD. Took all of 30 minutes at the most and I was back up and running on the new drive with oodles of space. Hopefully the 800 TBW rating of the new drive will keep it going for another 3-5 years.

vincix 04-07-2023 06:57 PM

One advantage that you can profit from directly with btfs as an end user is that you can create snapshots, make some changes, such as testing things that might break your system, and you can (in most cases) restore it to a previous state selecting the snapshot directly from the grub menu, even for the root partition. LVM doesn't allow that (well not as easily and the snapshots are limited by size – if you exceed the size difference, they disappear). You can also very easily create subvolumes with btrfs, whereas with LVM it's much more complicated, also because LVM will be limited by whatever filesysem you're using on top of it.

For reference: https://sysguides.com/install-fedora...nd-grub-btrfs/

CzarStoat 05-03-2024 01:44 PM

Quote:

Originally Posted by vincix (Post 6423080)
One advantage that you can profit from directly with btfs as an end user is that you can create snapshots, make some changes, such as testing things that might break your system, and you can (in most cases) restore it to a previous state selecting the snapshot directly from the grub menu, even for the root partition. LVM doesn't allow that (well not as easily and the snapshots are limited by size – if you exceed the size difference, they disappear). You can also very easily create subvolumes with btrfs, whereas with LVM it's much more complicated, also because LVM will be limited by whatever filesysem you're using on top of it.

Sorry this is an old thread. But just wanted to chime in.

I find LVM snapshots are very easy to do and, other than the root partition, they have the added advantage of not requiring a reboot to restore to the previous state. No need to mess with grub. I just have to be able to unmount the lv first. You can restore the root partition just fine, it just requires a reboot to go through the process as it is active.
A common use case for me is to snapshot my web application and database before an upgrade. And if I find I don't think the upgrade is ready for prime time, I can easily revert back without rebooting. I don't worry about the storage limits as the way LVM is designed, generally, you have a lot of smaller partitions and plenty of free space yet to be allocated. Just assign what you need, or if you must, make it the size of the LV it's snapping. Yes it's something to watch out for, but it's not really a problem as there is rarely a need to be stingy. The snapshot is only temporary after all.

In LVM land, each LV is a different device and you can use different filesystems on each logical volume (Some think ext4 is better for a database for instance) including btrfs itself. Which brings me to the point. Honestly I have yet to see any real compelling reason not to use both and just use the advantages of both. BTRFS is an excellent file management system with a lot of useful tools. LVM is an excellent volume manager with its own set of tools for allocating, resizing volumes on the fly. Yes, there is a bit of overlap in functionality but they are very different. LVM gives you the ability to handle things on the block level if you need it including moving whole partitions, live, across filesystems while the system is running (Very handy when I once remotely swapped to an upgraded RAID array).


All times are GMT -5. The time now is 08:46 PM.