LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 05-30-2022, 07:44 PM   #1
kevinbenko
Member
 
Registered: Jun 2005
Location: Fargo, North Dakota
Distribution: Debian Stable {Probably forever}
Posts: 656

Rep: Reputation: 174Reputation: 174
Question 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?

{PS: it will be Thursday before I can answer}

Have an awesome day!
 
Old 05-31-2022, 12:15 PM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,035

Rep: Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344
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.
 
Old 05-31-2022, 02:46 PM   #3
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,688
Blog Entries: 4

Rep: Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947
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.
 
Old 06-01-2022, 10:25 AM   #4
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Salix
Posts: 6,148

Rep: Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314
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.
 
Old 06-01-2022, 01:03 PM   #5
kevinbenko
Member
 
Registered: Jun 2005
Location: Fargo, North Dakota
Distribution: Debian Stable {Probably forever}
Posts: 656

Original Poster
Rep: Reputation: 174Reputation: 174
Question

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.........

Thank you for your responses.

Have an excellent day!
 
Old 06-01-2022, 02:14 PM   #6
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,035

Rep: Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344
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.
 
Old 06-01-2022, 02:16 PM   #7
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,688
Blog Entries: 4

Rep: Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947
A "n-partition physical volume group" is perceived by the host filesystem as a single contiguous logical "block of available storage."

The logical filesystem has no idea what the physical picture looks like, and it does not [have to ...] care.

Nor is it ever aware if that physical picture ("click click! click click! I'm dying...") changes.

The two levels of concern are cleanly separated.

LVM stays politely out-of-the-way until and unless you need it. At which time you will be very(!) glad you have it.

Last edited by sundialsvcs; 06-01-2022 at 02:19 PM.
 
Old 06-01-2022, 03:29 PM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,781

Rep: Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936
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.
 
Old 06-01-2022, 05:38 PM   #9
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,688
Blog Entries: 4

Rep: Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947
"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.
 
Old 06-01-2022, 06:20 PM   #10
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,781

Rep: Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936
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.

LVM does have builtin RAID capability.
 
Old 06-01-2022, 10:06 PM   #11
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,784

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
From the lvcreate manpage:
"-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."
 
Old 06-02-2022, 10:53 AM   #12
jmgibson1981
Senior Member
 
Registered: Jun 2015
Location: Tucson, AZ USA
Distribution: Debian
Posts: 1,151

Rep: Reputation: 393Reputation: 393Reputation: 393Reputation: 393
Quote:
I'd be inclined to leave LVM to servers.
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.
 
Old 06-02-2022, 10:59 AM   #13
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,035

Rep: Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344
Quote:
Originally Posted by jmgibson1981 View Post
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)
 
Old 06-02-2022, 11:11 AM   #14
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS, Manjaro
Posts: 5,762

Rep: Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763
Quote:
Originally Posted by sundialsvcs View Post
"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.
LVM does support some degree of RAID functionality in recent versions. see https://hetmanrecovery.com/recovery_...5-with-lvm.htm

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.

Last edited by wpeckham; 06-02-2022 at 11:20 AM.
 
Old 06-02-2022, 04:36 PM   #15
rclark
Member
 
Registered: Jul 2008
Location: Montana USA
Distribution: KUbuntu, Fedora (KDE), PI OS
Posts: 496

Rep: Reputation: 182Reputation: 182
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.

Last edited by rclark; 06-02-2022 at 04:41 PM.
 
  


Reply

Tags
lvm, my life sucks, stupid computer



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
kernel panic attempted to kill the idle task! in idle task - not syncing dudutworld Linux - Newbie 2 09-16-2013 01:50 PM
LVM - creating extra logical volumes (using extra space outside LVM) rhbegin Linux - Server 1 01-30-2013 07:08 PM
Adding an LVM hard disk to a system already running/using LVM firewiz87 Linux - Hardware 5 08-15-2010 12:59 AM
log into or log off an idle session avtandil_k Linux - Newbie 2 02-25-2010 12:52 PM
System busy when should be idle atharapos SUSE / openSUSE 3 01-28-2005 01:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration