Difference between revisions of "Talk:LVM"

From ArchWiki
Jump to: navigation, search
(Remove old question. ArchWiki Translation Team has clear instruction.)
(Replying regarding upvoting the bug)
 
(39 intermediate revisions by 16 users not shown)
Line 1: Line 1:
== Addition for /arch/setup LVM install ==
+
== systemd services ==
  
It is possible, as of Arch 2009.08, to set up and install on LVM directly from /arch/setupHere is how I did it - probably this info could be merged into the main article somehow? [[User:Redlever|Redlever]] 01:11, 17 November 2009 (EST)
+
{{pkg|lvm2}} has lvm2-lvmetad.service, lvm2-monitor.service, and lvm2-pvscan@.serviceThose should probably be listed with explanations of what they do, and what effects there are from having or not having them running. The wiki does mention lvmetad in the context of its conf file, but not as a systemd service to consider enabling. (Could also mention use_lvmetad = 0 in conf if you don't want it.)  [[User:Jamespharvey20|Jamespharvey20]] ([[User talk:Jamespharvey20|talk]]) 21:38, 28 July 2015 (UTC)
  
 +
:Yes, yes, YES! A million times YES. I've just spent hours figuring out why my system would hang for 90 seconds on reboot/shutdown. I had a setup with LVM on LUKS where a number of moving parts could be causing it (and were causing it for other people at one point or another) until I figured out... heh... let's leave LUKS out of the picture since it seems to be the culprit and things were working fine. Until I decided to create snapshots of my LVM volumes today before performing a system update and... TADA! It started hanging on reboot/shutdown again. Again, I had a million moving parts that could have been causing it (it's a fresh system that I'm still setting up) and it turns out all I needed was to enable lvm2-monitor... sadly I didn't scroll all the way to the bottom of this wiki page to figure out this could be a problem. I definitely vote to make this a more prominent topic... I don't know if this only affects me but it might be unsuspectingly affecting more people and both degrading their perception of their Arch install as well as getting some data loss. [[User:Tiago|Tiago]] ([[User talk:Tiago|talk]]) 19:10, 1 May 2017 (UTC)
  
=== (2) Manually Partition Hard Drives ===
+
::As you discovered, the issue is already documented in the Troubleshooting section - [[LVM#Delay on shutdown]]. There's no point in making it more prominent, since manually enabling {{ic|lvm2-monitor.service}} should not be the standard practice, it should be enabled by default in {{Pkg|lvm2}}. Vote on {{Bug|50420}} and hope the devs will fix it. (Or contact them directly.) -- [[User:nl6720|nl6720]] ([[User talk:nl6720|talk]]) 07:04, 2 May 2017 (UTC)
  
* Type 82, 100M, for /boot partition
+
:::Good point, it didn't occur to me that {{ic|lvm2-monitor.service}} should be on by default, but reading that bug report makes me really scared that unsuspecting LVM users out there are running their LVM systems without the monitor enabled... Let's just hope the bug gets fixed soon and nobody gets hurt in the process (I upvoted the bug report). --[[User:Tiago|Tiago]] ([[User talk:Tiago|talk]]) 19:57, 2 May 2017 (UTC)
* Type 8E, the rest, for LVM physical volume
 
  
=== (3) Manage Filesystems ===
+
== Move physical extents ==
  
82 partition gets EXT2 fs, mount at /boot
+
Ok, I'm confused. This section mentions 92468, 92467 and 92466 PEs. There may be more than one off-by-one error going on here.
  
8E partition gets lvm-pv fs.
+
Which of these is correct? [[User:Ataraxy|Ataraxy]] ([[User talk:Ataraxy|talk]]) 10:35, 28 October 2016 (UTC)Ataraxy
This adds a new entry to the "Manage Filesystems", showing "/dev/sda3+".
 
  
Select that entry, say "YES", it has only one possible value, "lvm-vg", and you can label your volume group (e.g., "vg0").
+
== Volume operations ==
This adds a new entry to "Manage Filesystems", showing "/dev/mapper/vg0".
 
  
Select that entry, which brings up a new "Manage LV's on this VG" menu. Be careful here, as it is confusing to try to edit / delete logical volumes.
+
This section says we should discuss Thin Provisioning here....
  
Select "empty NEW", then select "YES" to creat the filesystem.  It will select lvm-lv for you, and then you can enter a label (e.g., "root", "home", "whatever").
+
Go! [[User:Ataraxy|Ataraxy]] ([[User talk:Ataraxy|talk]]) 10:47, 28 October 2016 (UTC)Ataraxy
  
Repeat these steps (select "/dev/mapper/vg0", then "empty NEW", etc.) for each logical volume you want.
+
== Create physical volumes ==
  
Each logical volume you create will be added to the "Manage Filesystems" menu, like "/dev/mapper/vg0-LABEL".  Select each one of those, and create a filesystem on it as desired.  Probably you want to choose mount points and labels that match each other (e.g., mount /dev/mapper/vg0-root on /), but this is up to you.  You should have at least "/" and "swap" logical volumes.
+
It is written that -
 
+
"If LVM has to be set on the entire disk, there is no need to create any partitions", and also "DEVICE can be '''a disk''' or a partition",
 
+
but I think it is worth mentioning somewhere in this wiki that GRUB cannot be installed on a disk with LVM installed on it as a whole (see [https://bbs.archlinux.org/viewtopic.php?id=214315 grub-install with LVM on entire disk]). Any thoughts?
Here is a complete example from my recent simple setup.  I have one disk, /dev/sda.  sda1 is an NTFS partition, sda2 is /boot, and sda3 is my LVM physical volume.  I have a single volume group, called vg0.  On that volume group, i have logical volumes for root, swap, var and home.  This is what I see on "Manage filesystems" (copied from the screen, so I can't see the end of the lines):
+
[[User:Duduedri96|Duduedri96]] ([[User talk:Duduedri96|talk]]) 22:57, 30 November 2016 (UTC)
 
 
/dev/sda1            raw->no_fs
 
/dev/sda2            raw->ext2;yes;/boot;no_opts;no_label;no_params
 
/dev/sda3            raw->lvm-pv;yes;no_mountpoint;no_opts;no_label;no_
 
/dev/sda3+            lvm-pv->lvm-vg;yes;no_mountpoint;no_opts;vg0;/dev/
 
/dev/mapper/vg0      lvm-vg(vg0)->lvm-lv;yes;no_mountpoint;no_opts;root
 
/dev/mapper/vg0-root  lvm-lv(root)->ext4;yes;/;no_opts;no_label;no_param
 
/dev/mapper/vg0-swap  lvm-lv(swap)->swap;yes;no_mountpoint;no_opts;no_la
 
/dev/mapper/vg0-var  lvm-lv(var)->ext4;yes;/var;no_opts;no_label;no_par
 
/dev/mapper/vg0-home  lvm-lv(home)->ext4;yes;/home;no_opts_no_label;no_p
 
 
 
== Templates ==
 
 
 
I notice this article has several areas marked with '''Attention:''', '''Information:''', '''Hint:''', etc. Before I go on an editing frenzy, are templates (like <nowiki>{{Warning|...}}</nowiki>) the preferred format? If so, I will quite happily go through and change all of them. I'm new to this wiki, so I thought I'd ask before stirring up dust. :-) [[User:Infiniteh|Infiniteh]] 16:56, 27 August 2010 (EDT)
 
 
 
:I went ahead and added templates to the first few sections and did some minor restructuring. However, I may revert my changes (or rethink them). All these colored text boxes seem to make the page less readable... Any thoughts? [[User:Infiniteh|Infiniteh]] 21:11, 28 August 2010 (EDT)
 
 
 
::The page looks nicer with new templates :). I think a few colored text boxes could be removed. For example: "Note: You may need to load the device-mapper kernel module (modprobe dm-mod) for the above commands to succeed" could be easily removed, because that info is stated at the begining of the article. I think that warnings should stay though. [[User:Billy|billy]] 04:46, 5 September 2010 (EDT)
 
 
 
== LVM-recovery section ==
 
 
 
Would a section on LVM un-borkage be useful and/or within the scope of this article? [[User:Buhman|Buhman]] 13:45, 29 April 2012 (UTC)
 
:All constructive contributions are welcome. However if you're going to simply rewrite some existing and well maintained documentation, it'd be better to just write an introduction and link to it; if instead you want to write an Arch-oriented section or something more original in general, then go for it :) -- [[User:Kynikos|Kynikos]] 09:53, 30 April 2012 (UTC)
 
 
 
 
 
== PROS and CONS (citing needed) ==
 
 
 
Can anybody please come up with and elaborate on some of the cons as to what the drawbacks in performance and wear and tear would be when having multple LVM partitions spread and intertwined across several hard drives? (vs. keeping partitions spread evenly and limited to one drive only)
 
 
 
Cons should be clearly listed on the main 'page' ("cons", or "disadvantages", maybe near "advantages")
 
 
 
In fact, upon reading the 'advantages' section is what had me anticipating there would be something on disadvantages.  I'm concerned about hard performance testing results.  Has anyone seen any good data on this?
 

Latest revision as of 19:57, 2 May 2017

systemd services

lvm2 has lvm2-lvmetad.service, lvm2-monitor.service, and lvm2-pvscan@.service. Those should probably be listed with explanations of what they do, and what effects there are from having or not having them running. The wiki does mention lvmetad in the context of its conf file, but not as a systemd service to consider enabling. (Could also mention use_lvmetad = 0 in conf if you don't want it.) Jamespharvey20 (talk) 21:38, 28 July 2015 (UTC)

Yes, yes, YES! A million times YES. I've just spent hours figuring out why my system would hang for 90 seconds on reboot/shutdown. I had a setup with LVM on LUKS where a number of moving parts could be causing it (and were causing it for other people at one point or another) until I figured out... heh... let's leave LUKS out of the picture since it seems to be the culprit and things were working fine. Until I decided to create snapshots of my LVM volumes today before performing a system update and... TADA! It started hanging on reboot/shutdown again. Again, I had a million moving parts that could have been causing it (it's a fresh system that I'm still setting up) and it turns out all I needed was to enable lvm2-monitor... sadly I didn't scroll all the way to the bottom of this wiki page to figure out this could be a problem. I definitely vote to make this a more prominent topic... I don't know if this only affects me but it might be unsuspectingly affecting more people and both degrading their perception of their Arch install as well as getting some data loss. Tiago (talk) 19:10, 1 May 2017 (UTC)
As you discovered, the issue is already documented in the Troubleshooting section - LVM#Delay on shutdown. There's no point in making it more prominent, since manually enabling lvm2-monitor.service should not be the standard practice, it should be enabled by default in lvm2. Vote on FS#50420 and hope the devs will fix it. (Or contact them directly.) -- nl6720 (talk) 07:04, 2 May 2017 (UTC)
Good point, it didn't occur to me that lvm2-monitor.service should be on by default, but reading that bug report makes me really scared that unsuspecting LVM users out there are running their LVM systems without the monitor enabled... Let's just hope the bug gets fixed soon and nobody gets hurt in the process (I upvoted the bug report). --Tiago (talk) 19:57, 2 May 2017 (UTC)

Move physical extents

Ok, I'm confused. This section mentions 92468, 92467 and 92466 PEs. There may be more than one off-by-one error going on here.

Which of these is correct? Ataraxy (talk) 10:35, 28 October 2016 (UTC)Ataraxy

Volume operations

This section says we should discuss Thin Provisioning here....

Go! Ataraxy (talk) 10:47, 28 October 2016 (UTC)Ataraxy

Create physical volumes

It is written that - "If LVM has to be set on the entire disk, there is no need to create any partitions", and also "DEVICE can be a disk or a partition", but I think it is worth mentioning somewhere in this wiki that GRUB cannot be installed on a disk with LVM installed on it as a whole (see grub-install with LVM on entire disk). Any thoughts? Duduedri96 (talk) 22:57, 30 November 2016 (UTC)