Configure local storage Flashcards
Display disk partition table for disk /dev/vdb
parted /dev/vdb print
Write an MBR disk label to disk /dev/vdb
parted /dev/vdb mklabel msdos
Write a GPT disk label to disk /dev/vdb
parted /dev/vdb mklabel gpt
Create an MBR partition on disk /dev/vdb
parted /dev/vdb mkpart primary xfs 2048s 1000MB
udevadm settle
Create a GPT partition on disk /dev/vdb
parted /dev/vdb mkpart usersdata xfs 2048s 1000MB
udevadm settle
Delete a partition 1 on disk /dev/vdb
parted /dev/vdb rm 1
Create 3 physical volumes on /dev/vdb
pvcreate /dev/vdb1 /dev/vdb2 /dev/vdb3
Remove physical volumes /dev/vdb2 and /dev/vdb1
pvremove /dev/vdb2 /dev/vdb1
Display physical volume /dev/vdb1
pvdisplay /dev/vdb1
Display volume group vg01
vgdisplay vg01
Create volume group vg01 and assign physical volumes /dev/vdb2 and /dev/vdb1 to it
vgcreate vg01 /dev/vdb2 /dev/vdb1
Add physical volume /dev/vdb3 to volume group vg01
vgextend vg01 /dev/vdb3
Remove physical volume /dev/vdb3 from volume group vg01
pvmove /dev/vdb3
vgreduce vg01 /dev/vdb3
Volume group vg01 is no longer needed. Delete it.
vgremove vg01
Create a 700 MB logical volume called lv01 in volume group vg01
lvcreate -n lv01 -L 700M vg01
Remove logical volume lv01 in volume group vg01
lvremove /dev/vg01/lv01
Display logical volume /dev/vg01/lv01
lvdisplay /dev/vg01/lv01
It is important to correctly identify disk and disk partitions. What commands are used to identify devices on your system?
lsblk, blkid, or cat /proc/partitions commands
Persistent mounts are configured where?
/etc/fstab
How do you configure a persistent mount by UUID or its label?
vim /etc/fstab
By Label:
/dev/vg01/lv01 /mnt/data xfs defaults 1 2
By UUID:
31b9363b-add8-4b46-a4bf-c199cd478c55 /mnt/data xfs defaults 1 2
systemctl daemon-reload
How to add 500MB more swap space to the system
swapoff -v /dev/vg01/lv01
lvextend -L +500MB /dev/vg01/lv01
mkswap /dev/vg01/lv01
swapon -va /dev/vg01/lv01
how to create a logical volume with exactly 128 extents
lvcreate -l 128