LVM Flashcards
What is LVM?
Logical Volume Manager can partition logical volumes (which are flexible) without needing to close the primary partition (dynamically allocated).
What is a dev mapper?
It’s a directory that maps the logical devices to their physical volumes.
What are the advantages we take from LVM?
No downtime, is flexible, can resize (reduce or extend) volumes using a pool (volume group)
What are the three stages of LVM?
pvcreate (physical volume) -> vgcreate (volume group) -> lvcreate (logical volume)
What does the “vgcreate” command do?
Creates a new volume group, which is a pool of volumes made up of 4 mib physical extents. The volume group is created from physical volumes and can, in turn, create logical volumes.
What is the physical extent?
A physical extent is a small (4 MiB) chunking of data in a volume group. It’s the smallest building block of a logical volume.
What is a Logical Unit Number?
A storage device that can be mounted as a volume
What does LVS command do?
Summarizes the logical volume
How to create physical volume?
pvcreate <device_name1> <device_name2></device_name2></device_name1>
What is volume group? How to list volume groups?
A volume group is a pool of physical volumes. It can be listed with vgs or vgdisplay
How to create a volume group?
vgcreate <name_of_vg> </pv_to_include1> </pv_to_include2> ...</name_of_vg>
What are the types of logical volume?
Linear, striped, mirrored
How to extend a volume group?
vgextend <name_of_vg> </new_pv_to_include></name_of_vg>
How to extend a logical volume?
lvextend -L/-l [+1G/+100%FREE/+extents] </dev/vg/lv>
How to reduce a logical volume?
lvreduce -L/-l [-1G/-10%/-extents] </dev/vg/lv>