|
PE - physical extents
|
The smallest unit of disk space that can be managed by LVM. It's set when you create a volume group. It determines the "granularity" of of disk space allocation.All physical volumes in a volume group will use the same extent size.
|
|
LE - logical extents
|
The same as PE but for Logical Volumes
|
|
PV - physical volume
|
Disks, partitions, RAID volumes
|
|
VG - volume group
|
Group of one or more physical volumes
|
|
LV - logical volume
|
Entity that contains information, store on physical volumes, grouped within a volume group
|
|
lvm
|
pseudo shell for LVM
|
|
lvmconfig
|
prints LVM configuration from /etc/lvm/lvm.conf
|
|
lvmdiskscan
|
prints devices that could be used as physical volumes
|
|
lvmdump
|
dumps LVM configuration to tar file
|
|
lvmetad
|
caching service for LVM metadata
|
|
/etc/lvm/
|
LVM configuration directory
|
|
/etc/lvm/lvm.conf
|
LVM configuration file
|
|
/etc/lvm/{archive|backup}
|
Backup and archive of LVM configuration
|
|
/etc/lvm/profile
|
Aa set of selected customizable configuration settings that can be used to achieve certain characteristics in various environments or uses. Normally, the name of the profile should reflect that environment or use. An LVM profile overrides existing configuration.
|
|
pvcreate
|
create PV
|
|
pvchange
|
change attributes of PV
|
|
pvs|pvdisplay
|
display information about PV
|
|
pvmove
|
moves extents from one PV to another
|
|
pvremove
|
removes a PV
|
|
pvresize
|
resizes a PV
|
|
pvscan
|
scans for changes in PV configuration and size
|
|
vgs|vgdisplay
|
displays VG information
|
|
vgmknodes
|
create the special files for VG devices in /dev
|
|
vgck
|
check VG consistency
|
|
vgcfgbackup
|
make a backup of VG metadata
|
|
vgcfgrestore
|
restore VG metadata from backup
|
|
vgrename
|
rename a VG
|
|
vgsplit
|
move PVs to a new or existing VG
|
|
vgconvert
|
change VG metadata format
|
|
vgimport
|
register exported VG in the system
|
|
vgexport
|
unregister VG from the system
|
|
vgimportclone
|
import a VG from cloned PVs
|
|
vgcreate
|
create VG from one or more PVs
|
|
vgremove
|
remove VG
|
|
vgreduce
|
remove PVs from VG
|
|
vgchange
|
change VG attributes
|
|
vgextend
|
extend VG with one or more PVs
|
|
vgmerge
|
merge VGs
|
|
vgscan
|
scan VGs for changes in metadata and size
|
|
lvs|lvdisplay
|
print LV metadata
|
|
lvchange
|
change attributes of LV
|
|
lvcreate
|
create a new LV
|
|
lvextend
|
extend size of LV
|
|
lvreduce
|
reduce size of LV (offline!)
|
|
lvresize
|
change size of LV
|
|
lvrename
|
rename a LV
|
|
lvconvert
|
change layout of LVM
|
|
lvscan
|
scan LVs for metadata changes and size
|
|
lvremove
|
remove LV
|
|
pvcreate /dev/<disk_device>
|
create a new PV from device
|
|
pvcreate /dev/sdb
|
|
|
vgcreate <VG> <PV> <PV>
|
create a volume groups that consists of one or more PVs
|
|
vgcreate data_vg /dev/sdb /dev/sdc
|
|
|
lvcreate -n <LV_NAME> -L <SIZE> <VG>
|
create a LV of a given size in a VG
|
|
lvcreate -n data_lv -L 100G data_vg
|
|
|
lvcreate -n <LV_NAME> -l 100%FREE <VG>
|
create a LV that fills 100% of free space in VG
|
|
lvcreate -n data_lv -l 100%FREE data_vg
|
|
|
lvcreate -L <SIZE> -s -n <NAME_OF_SNAPSHOT> <PATH_TO_LV>
|
Create a snapshot of an LV
|
|
lvcreate -L 4G -s -n data_lv-snapshot /dev/mapper/data--vg_data--lv
|
|
|
lvremove <PATH_TO_SNAPSHOT>
|
Remove snapshot
|
|
lvremove /dev/mapper/data--vg_data--lv
|
|
|
lvextend -L <SIZE> <PATH_TO_LV>
|
Extend snapshot
|
|
lvextend -L +10G /dev/mapper/data--vg_data--lv
|
|
|
lvconvert --merge <PATH_TO_SNAPSHOT>
|
Restore data from snapshot
|
|
lvconvert --merge /dev/mapper/data--vg_data--lv
|
|
|
modify snapshot_autoextend_treshold and snapshot_autoextend_percent in lvm.conf
|
Enable automatic extension of snapshots by adjusting the values
|
|
lsblk -o name,mountpoint,label,size,uuid
|
List block devices with useful information
|
|
multipathd show maps status
|
Print path status of multipath devices
|
|
lvs -o +devices
|
Print LVs, VGs and device paths
|
|
vgs -o +lv_size,lv_name
|
Print information about LVs, VGs, sizes and attributes
|
|
mkfs.ext4 <FS>
|
Format a filesystem for EXT4
|
|
mkfs.xfs <FS>
|
Format a filesystem for XFS
|
|
mount <PATH_TO_LV> <MOUNTPOINT>
|
Mount a filesystem in a given location
|
|
mount -a
|
Mount all filesystems listed in /etc/fstab
|
|
rescan-scsi-bus.sh|echo 1 > /sys/block/<DEVICE>/device/rescan
|
Rescan underlying storage to detect change in disk size
|
|
rescan-scsi-bus.sh|echo 1 > /sys/block/sdb/device/rescan
|
|
|
partprobe
|
Detect changes in partition size (if necessary)
|
|
pvresize <PV>
|
Resize PV to the maximum possible size of partition or disk/LUN
|
|
pvresize /dev/sdb
|
|
|
vgextend <VG> <PV> <PV>
|
Extend existing VG with one or more PVs
|
|
vgextend data_vg /dev/sdb /dev/sdc
|
|
|
lvextend -L <SIZE> /dev/mapper<PATH_TO_LV>
|
extend logical volume by given size (add 10GB to existing size)
|
|
lvextend -L +10G /dev/mapper/data--vg_data--lv
|
|
|
lvextend -r -L <SIZE> /dev/mapper<PATH_TO_LV>
|
extend logical volume and its filesystem by given size (add 10GB to existing size)
|
|
lvextend -r -L +10G /dev/mapper/data--vg_data--lv
|
|
|
umount <FS>
|
Unmount filesystem
|
|
umount /data
|
|
|
e2fsck -f <PATH_TO_LV>
|
Check and fix potential errors
|
|
e2fsck -f /dev/mapper/data--vg_data--lv
|
|
|
resize2fs <PATH_TO_LV> <SIZE>
|
Reduce size of filesystem
|
|
resize2fs /dev/mapper/data--vg_data--lv 10G
|
|
|
lvreduce -L <SIZE> <PATH_TO_LV>
|
Reduce size of LV
|
|
lvreduce -L 10G /dev/mapper/data--vg_data--lv
|
|
|
e2fsck -f <PATH_TO_LV>
|
Check for errors once more
|
|
e2fsck -f /dev/mapper/data--vg_data--lv
|
|
|
mount <FS>
|
Mount filesystem
|
|
mount /data
|
|
No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.