Advanced Storage part Flashcards
list availabe physical volumes
sudo pvs
-v for detailed output
list availabel Volume Groups
sudo vgs
explaing Physical Extent and how to see its current setting
An exten is the smallest allocatable unit of space in LVM. Default is 4 MB. In a 20GB physical volume, there would be 5,000 PE’s
sudo vgdisplay rhel | grep ‘PE Size’
list availabel logical volumes
sudo lvs
What is a Logical Extent
a set of physical extents allocated to the logical volume
create a physical volume and volume group
- Make partition - see previous chapter
- Set the flag on the partition to lvm - not required
sudo parted /dev/sdd set 1 lvm on - verify with print
- create PV with sdd1 and sde
sudo pvcreate /dev/sdd1 /dev/sde - Create Volume Group (-s = PE size)
sudo vgcreate -vs 16 vgbook /dev/sdd1 /dev/sde - Verify
sudo vgs vgbook
sudo vgdisplay -v vgbook
sudo pvs
sudo pvdisplay /dev/sdd1
“ “ /dev/sde
create logical volume
- create LV with default name, -L to specify volume size in MB (can specify GB or TB if needed)
sudo lvcreate -vL 120 vgbook
- with a different name and custome logical extent
sudo lvcreate -l 12 -n lvbook1 vgbook
2 verify
sudo lvs
sudo vgdisplay -v vgbook
sudo lvdisplay /dev/vgbook/lvol0
sudo lvdisplay /dev/vgbook/lvbook1
extend VG
sudo vgextend vgbook /dev/sdd2
sudo vgs
extend LV
sudo lvextend -L +144 /dev/vgbook/lvbook1
sudo vgdislplay -v vgbook
rename lvol0 to lvbook2
sudo lvrename vgbook lvol0 lvbook2
reduce size of LV lvbook2
sudo lvreduce -L 50 /dev/vgbook/lvbook2
add storage to LV
sudo lvresize -L +32 /dev/vgbook/lvbook2
(32MB)
remove LV
sudo lvremove /dev/vgbook/lvbook1 -f
***desrtuctive, back up all data!!!
reduce size of VG
then remove VG
sudo vgreduce vgbook /dev/sd1 /dev/sde
removes sdd1 and sde
sudo vgremove vgbook
uninitialize PV
sudo pvremove /dev/sdd1 /dev/sdd2 /dev/sde
create stratis pool
install stratis and enable with systemctl
sudo stratis pool create bookpool /dev/sdg
verify
sudo stratis pool list
list the block device that is used to form the stratis pool
sudo stratis bolckdev list bookpool
create stratis file system call bookfs in the bookpool
sudo stratis filesystem create bookpool bookfs
verify
sudo stratis filesystem list
create directoty call /bookfs1 and mount new file system
sudo mkdir /bookfs1
sudo mount /stratis/bookpool/bookfs /bookfs1
check stratis pool usage
sudo stratis pool list
expand stratis bookpool
sudo stratis pool add-data bookpool /dev/dsh
rename stratis pool
sudo stratis pool rename bookpool rhcsapool
destroy stratis file system and pool
sudo umount /bookfs1
sudo stratis filesystem destroy rhcsapoool rhcsafs