Saltar la navegación

Instalación de LVM

Para trabajar en GNU/Linux con volúmenes lógicos vamos a utilizar el software LVM (Logical Volume Management), para lo cual debemos instalar el paquete Debian lvm2.

# apt install lvm2

Tras esto se instalan múltiples comandos relacionados con la gestión de los volúmenes lógicos. Uno de ellos es lvm, el cual, tiene su propio entorno desde donde ejecutar el resto de comandos. Desde aquí, podemos ejecutar el comando help y se nos mostrará un listado de todos los posibles comandos que podemos ejecutar junto con una breve descripción. Para salirnos del entorno, ejecutamos quit.

# lvm
lvm> help
Available lvm commands:
Use 'lvm help <command>' for more information

devtypes Display recognised built-in block device types
dumpconfig Dump configuration
formats List available metadata formats
help Display help for commands
lvchange Change the attributes of logical volume(s)
lvconvert Change logical volume layout
lvcreate Create a logical volume
lvdisplay Display information about a logical volume
lvextend Add space to a logical volume
lvmchange With the device mapper, this is obsolete and does nothing.
lvmdiskscan List devices that may be used as physical volumes
lvmsadc Collect activity data
lvmsar Create activity report
lvreduce Reduce the size of a logical volume
lvremove Remove logical volume(s) from the system
lvrename Rename a logical volume
lvresize Resize a logical volume
lvs Display information about logical volumes
lvscan List all logical volumes in all volume groups
pvchange Change attributes of physical volume(s)
pvresize Resize physical volume(s)
pvck Check the consistency of physical volume(s)
pvcreate Initialize physical volume(s) for use by LVM
pvdata Display the on-disk metadata for physical volume(s)
pvdisplay Display various attributes of physical volume(s)
pvmove Move extents from one physical volume to another
pvremove Remove LVM label(s) from physical volume(s)
pvs Display information about physical volumes
pvscan List all physical volumes
segtypes List available segment types
tags List tags defined on this host
vgcfgbackup Backup volume group configuration(s)
vgcfgrestore Restore volume group configuration
vgchange Change volume group attributes
vgck Check the consistency of volume group(s)
vgconvert Change volume group metadata format
vgcreate Create a volume group
vgdisplay Display volume group information
vgexport Unregister volume group(s) from the system
vgextend Add physical volumes to a volume group
vgimport Register exported volume group with system
vgmerge Merge volume groups
vgmknodes Create the special files for volume group devices in /dev
vgreduce Remove physical volume(s) from a volume group
vgremove Remove volume group(s)
vgrename Rename a volume group
vgs Display information about volume groups
vgscan Search for all volume groups
vgsplit Move physical volumes into a new or existing volume group
version Display software and driver version information
lvm> quit
Exiting.
#

Para obtener una breve ayuda de un comando LVM podemos ejecutarlo con la opción --help.

# lvmdiskscan --help
  lvmdiskscan: List devices that may be used as physical volumes

lvmdiskscan
	[--commandprofile ProfileName]
	[-d|--debug]
	[-h|--help]
	[-l|--lvmpartition]
	[--readonly]
	[--version]