[SOLVED] An Idle Question About Using LVM, Should I Look Into It Or Not?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
An Idle Question About Using LVM, Should I Look Into It Or Not?
{{{I had a stroke in 2011, am brain-damaged, and I have short term memory loss}}}
A few years ago {before my stroke} I had played with LVM (Logical Volume Management).
Now I have a damnable computer with only a 2TB SSD, and I have most of my real stuff in some HDD's totaling 6TB of space available, which is less than half full.
My problem is with the /home/$user partition on the SSD, since most of the system files is on that /home/$user (it contains ALL if the "dot" files, like .local, etc)
I am considering using LVM to try to deal with this nonsense and have a /home/$user and a /home/PUBLIC/$user in a single LVM partition.
QUESTIONS:
* does this make sense?
* will it make it easier for my life to use LVM in this manner?
* is the potential for any problems/disasters if I do this?
from my side you don't have to do it, but you can do it if you wish. Using LVM is a bit more complex (than without it), but obviously it has benefits too.
I would rather keep it simple.
I recommend using LVM. It is a very well-thought-out facility which trivializes what is otherwise a very difficult problem: "when a system is about to run out of disk space."
But it also greatly simplifies another equally serious problem: when a physical hard drive begins to make "ominous clicking noises." You can use LVM to reliably retire the failing drive.
And, the facility is basically invisible. Such that most "distros" simply install it by default.
I'd be inclined to leave LVM to servers. The first time I installed Linux myself, Fedora 1 offered LVM — after a quick read up, my reaction was not on my computer you don't. It may be useful for large systems with lots of drives and multiple partitions, but (as pan64 points out) if anything goes wrong there's more work needed to put it right.
OK, read both types of replies {negative and positive}.
I have another question about LVM with respect to rsync:
I use rsync for every backup I make, how does "--one-file-system" handle LVM, is a 2 partition volume group call it as 1 file system or 2 file systems.
OK, that is a little complicated/scary/whatever.........
rsync has no any idea about the structure of the underlying filesystem(s) (if it is a raid, lvm, nfs, pendrive or anything else). It will just read and write it.
LVM as posted is a way to extend a filesystem over physical hard drive boundaries and still appear as one. If you are using the other drives for a backup then IMHO you do not want to combine them with your SSD. I believe there is a python script to convert to LVM on the fly but have never looked at it.
The basic LVM uses striping just like RAID 0 and as far as I know if you lose one drive you lose everything. LVM can be used to create a RAID but using MDADM is probably simpler and easier to setup. Yes you can move a PV to another drive (no raid) and I have not had the pleasure of performing that procedure but replacing a mdadm RAID drive looks much simpler and hopefully you have a good backup just in case.
"Pardon me for correcting you, Michael," but LVM does not use "striping." In fact, LVM has no idea at all how the physical layer does its work, and it is utterly reliant upon that layer to "do its work" correctly. LVM therefore has nothing(!) to do with "RAID," which is a purely physical concept.
The essential concept of LVM is to entirely divide(!) the logical picture, "as seen by the operating system and its various applications," from the physical pictures. It accomplishes this magick by "purely software" means. But by doing so, it is utterly reliant upon the physical integrity of these various physical pictures. It utterly relies on them, and upon their physical integrity. It has no idea how those pictures are achieved.
Last edited by sundialsvcs; 06-01-2022 at 05:43 PM.
Sorry, I meant to use spanning versus striping. As far as I know if the LV spans multiple disks and a physical disk fails you lose the LV if not using some sort of redundancy.
"-i|--stripes Stripes
Gives the number of stripes. This is equal to the number of physical volumes to scatter the logical volume. When creating a RAID 4/5/6 logical volume, the extra devices which are necessary for parity are internally accounted for. Specifying -i 3 would use 3 devices for striped logical volumes, 4 devices for RAID 4/5, and 5 devices for RAID 6. Alternatively, RAID 4/5/6 will stripe across all PVs in the volume group or all of the PVs specified if the -i argument is omitted.
"-I|--stripesize StripeSize
Gives the number of kilobytes for the granularity of the stripes. StripeSize must be 2^n (n = 2 to 9) for metadata in LVM1 format. For metadata in LVM2 format, the stripe size may be a larger power of 2 but must not exceed the physical extent size."
I'd disagree on that. For just about anyone it is an amazing thing. Never having to repartition and screw it up and then have to restore from backups. Just create a lv and go for it. I've done entire switches from Debian > Ubuntu and vice versa by doing a chroot install with debootstrap. I'd imagine any other distro can do something similar. Total system downtime is whatever the reboot is. Snapshots make it foolproof to create tarballs of the system while online instead of having to take it down. Definitely has it's uses even on the home machine. It's more than earned it's place around my home even on the machines I don't mess with daily. One try and I was sold on it.
Last edited by jmgibson1981; 06-02-2022 at 11:05 AM.
I'd disagree on that. For distro hoppers it is an amazing thing. Never having to repartition and screw it up and then have to restore from backups. Just create a lv and go for it. I've done entire switches from Debian > Ubuntu and vice versa by doing a chroot install with debootstrap. I'd imagine any other distro can do something similar. Total system downtime is whatever the reboot is. Snapshots make it foolproof to create tarballs of the system while online instead of having to take it down. Definitely has it's uses even on the home machine. It's more than earned it's place around my home even on the machines I don't mess with daily. One try and I was sold on it.
sorry, that can be done without lvm too (as far as I see)
"Pardon me for correcting you, Michael," but LVM does not use "striping." In fact, LVM has no idea at all how the physical layer does its work, and it is utterly reliant upon that layer to "do its work" correctly. LVM therefore has nothing(!) to do with "RAID," which is a purely physical concept.
The essential concept of LVM is to entirely divide(!) the logical picture, "as seen by the operating system and its various applications," from the physical pictures. It accomplishes this magick by "purely software" means. But by doing so, it is utterly reliant upon the physical integrity of these various physical pictures. It utterly relies on them, and upon their physical integrity. It has no idea how those pictures are achieved.
Quote:
LVM RAID uses both Device Mapper (DM) and Multiple Device (MD) drivers from the Linux kernel.
If I want to do serious storage management I would prefer to do RAID in MD or hardware, and I trust the RAID 0 and 1 levels more in BTRFS for the simple cases. I love LVM, but it only really shines in multi-device storage and the more devices the more it has value. If you have that many devices you want more powerful RAID than LVM alone provides at your command.
For reliability, remember to keep it simple. Everything you can avoid using and still get full functionality and performance is one more thing you cannot break. If you can do it in LVM alone, that is a valid answer. If you can do it in mdm alone, then the only reason to add LVM is to allow management of storage when adding and removing devices or reallocating space.
To make clear, I use all of the tools and love how powerful they have become. I do not recommend one over the other, I just recommend not using more than you need.
For my home use, I stay as far away from LVM as possible. No need for that 'extra' layer. I run straight off of ext4 partitions. My desktops all have one drive for OS and user folders. Data (pictures, programs, part designs, spreadsheets, user directory backups, and such) is stored on the home server. The home server has large enough drives to last years before I'd ever fill them up at the current rate. Point is I'd be replacing them long before I ran out of space... And when I do, it is as simple as slapping in a bigger drive (drives are relatively cheap any more) and restore old contents from backup. No brainer there. I like the 'keep it simple stupid' (Kiss) principle myself. Not saying LVM is bad, not at all. It just needs to be used in the 'right' places where there is an obvious benefit.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.