Logical Volume Management Flashcards
1
Q
Steps in Creating a logical volume
A
- create lvm partitions
- create PVs
- create VG
- create LV
- Format LV
- mount the volume
1
Q
Create physical volume
A
pvcreate /dev/vdb1 /dev/vdb2
1
Q
Create volume group
A
vgcreate vg01 /dev/vdb1 /dev/vdb2
2
Q
Create logical volume
A
lvcreate -n lv01 -L 300M vg01
lvcreate -n lv01 -l 32 vg01
3
Q
Show details of PV
A
pvdisplay
4
Q
Show details of LV
A
lvdisplay
5
Q
Show details of VG
A
vgdisplay
6
Q
Add a new PV to VG
A
vgextend vg01 /dev/vdb3
7
Q
extend the LV
A
lvextend -L +500M /dev/vg01/lv01
8
Q
Extend an XFS FS to the LV size
A
xfs_growfs /mnt/data/
9
Q
Extend an EXT4 FS to the LV size
A
resize2fs /dev/vg01/lv01
10
Q
Extend the size of a LV
A
- Create partition
- Create PV
- Add PV to VG
- Extend LV
- Resize FS
11
Q
Extend Swap Space Logical Volumes
A
swapoff -v /dev/vg01/swap
lvextend -L +300M /dev/vg01/swap
mkswap /dev/vg01/swap
swapon /dev/vg01/swap
12
Q
Reduce Volume Group Storage
A
pvmove /dev/vdb3
vgreduce vg01 /dev/vdb3
13
Q
FS that support shrinking
A
ext3 ext4