Difference between revisions of "Logical Volume Manager (Linux)"

From wikieduonline
Jump to navigation Jump to search
Line 35: Line 35:
 
* Ls commands: <code>[[pvs]]</code>, <code>[[lvs]]</code><ref>http://man7.org/linux/man-pages/man8/lvs.8.html</ref>, <code>[[vgs]]</code>
 
* Ls commands: <code>[[pvs]]</code>, <code>[[lvs]]</code><ref>http://man7.org/linux/man-pages/man8/lvs.8.html</ref>, <code>[[vgs]]</code>
 
* Scan commands: <code>[[pvscan]]</code><ref>http://man7.org/linux/man-pages/man8/pvscan.8.html</ref>, <code>[[vgscan]]</code>
 
* Scan commands: <code>[[pvscan]]</code><ref>http://man7.org/linux/man-pages/man8/pvscan.8.html</ref>, <code>[[vgscan]]</code>
* PV commands: <code>[[/pvdisplay/]]</code><ref>http://man7.org/linux/man-pages/man8/pvdisplay.8.html</ref>, <code>pvresize</code>, <code>[[/pvscan/]]</code>, <code>[[/pvcreate/]]</code> or <code>[[/pvcreate/]] -vv</code>
+
* PV commands: <code>[[pvdisplay]]</code><ref>http://man7.org/linux/man-pages/man8/pvdisplay.8.html</ref>, <code>pvresize</code>, <code>[[/pvscan/]]</code>, <code>[[pvcreate]]</code> or <code>[[pvcreate]] -vv</code>
* LV commands: <code>[[/lvcreate/]]</code><ref>http://man7.org/linux/man-pages/man8/lvcreate.8.html</ref>, [[lvconvert]]
+
* LV commands: <code>[[lvcreate]]</code><ref>http://man7.org/linux/man-pages/man8/lvcreate.8.html</ref>, [[lvconvert]]
* VG commands: <code>[[/vgdisplay/]]</code>, <code>[[/vgcreate/]]</code>, <code>vgcfgbackup</code>, <code>[[/vgscan/]]</code>
+
* VG commands: <code>[[vgdisplay]]</code>, <code>[[vgcreate]]</code>, <code>vgcfgbackup</code>, <code>[[vgscan]]</code>
* LVM commands: <code>lvm dumpconfig</code>
+
* LVM commands: <code>[[lvm dumpconfig]]</code>
  
 
=== Advanced commands ===
 
=== Advanced commands ===

Revision as of 11:42, 16 December 2019

LVM[1] available in Linux allows manage multiple physical volumes or entire hard disks. It supports among other functionalities:

  • Create single logical volumes of multiple physical volumes or entire hard disks
  • Add or remove volumes/disk dynamically
  • Increase or decrease size of Logical Volumes (LVs)
  • Create snapshots

LVM introduces the concept of Volume Groups (VGs) and Logical Volumes (LVs).

Configuration file: /etc/lvm/lvm.conf


Components

Basic commands

  • Display commands:
pvdisplay[4]
lvdisplay
vgdisplay
  • Create commands:
pvcreate[5]
lvcreate[6]
vgcreate
vgreduce

Advanced commands

  • lvchange[11] — Change attributes of the Logical Volume Manager.
  • lvmdiskscan — Scan for all devices visible to LVM2.
  • lvmdump — Create lvm2 information dumps for diagnostic purposes.

Activities

Basic

  1. Read StackOverflow LVMs questions: https://superuser.com/questions/tagged/lvm?tab=Votes
  2. Read Configuring and Managing Logical Volumens in RHEL 8: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/configuring_and_managing_logical_volumes/index
  3. Configure an LVM Volume with an ext File Sytem: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/high_availability_add-on_administration/s1-lvmsetupnfs-haaa

Advanced

Before doing these exercises make your you have a backup of your data.

  1. Convert a Linear Device to a RAID device: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/configuring_and_managing_logical_volumes/index#proc_converting-linear-to-raid-configure-manage-raid
  2. Read LVM Changelog: sourceware.org/git/?p=lvm2.git;a=blame;f=WHATS_NEW;hb=9cad26be321844868a904c7b07bebe37be4e0169

See also

scan: pvscan vgscan
LVM: lvs lvmscan lvm fullreport lvmreport lvmconfig lvmdump lvmcheck lvm dumpconfig
Scan: pvs vgs lvs pvscan vgscan
PV: pvcreate pvremove pvscan pvremove pvscan pvs pvchange pvck pvdisplay pvresize
LV: lvdisplay lvcreate lvremove, lvresize, lvextend, lvreduce, lvrename
VG: vgdisplay,vgcreate,vgremove, vgextend, vgreduce, vgscan, vgchange, vgrename, vgcfgbackup, vgcfgrestore, vgimportclone, vgck
Check commands: pvck vgck


Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy.

Original Source: https://en.wikiversity.org/wiki/Linux_Administration/Devices_and_Filesystems/LVM

Advertising: