Logical Volume Manager Flashcards
What is a physical volume?
Underlying physical storage unit used by LVM
Can use partition or entire block device
*partition type must be initialised/marked as Linux LVM to provide metadata to LVM
What is the structure for LVM?
── Logical Volume
└── Volume Group
├─── Physical Volume 1
└─── Physical Volume 2
What is an extent in a Volume Group?
Smallest amount of space that can be assigned to a volume group, also knows as physical extents. They are mapped to logical volumes
How do you create a Physical Volume?
pvcreate {/block/device}
How do you view Physical Volumes on the system?
pvdisplay
How do you create a Volume Group?
vgcreate {vgname} {/physical/volume}
How do you view Volume Groups on the system?
vgdisplay
How do you create a Logical Volume?
lvcreate -n {name} -L {size} {vgname}
How do you view Logical Volumes?
lvdisplay
On a Logical Volume what are the limitations of xfs vs ext4?
LVM using xfs can only be increased
LVM using ext4 can be increased and decreased
How do you delete a Physical Volume?
pvremove
How do you delete a Volume Group?
vgremove
How do you delete a Logical Volume?
lvremove
How do you format an LVM to be used as swap space?
mkswap {/lv/path}
i. e mkswap /dev/vg1/lvswap1
* formats with swap signature
How do you mount a swap disk?
swapon
i.e swapon /dev/vg1/lvswap1