RHCSA Ch9 Flashcards
create a partition with gdisk
sudo gdisk /dev/vdb
Command (? for help): n =for new partition
partition number
first sector
last sector = +500M
Command (? for help): p = to print
Command (? for help): w = write
cat /proc/partitions
where is partition info stored
/proc/partitions
create a physical volume
sudo pvcreate /dev/vdb1
list physical volumes
sudo pvs
sudo pvdisplay
create a volume group
sudo vgcreate vgdata /dev/vdb1
show virtual groups
sudo vgs
sudo vgdisplay
create logical volume
sudo lvcreate –name lvdata –size 495 vgdata
vgdata is the volume group
show logical volume
sudo lvs
sudo lvdisplay
where are logical volumes stored
/dev/VolumeGroupName/LogicalVolumeName
Example = /dev/vgdata/lvdata
linux formatting tools
mkfs
mke2fs
format a logical volume to xfs
sudo mkfs -t xfs /dev/vgdata/lvdata
show format type of all drives
sudo blkid
mount drive
mount source destination
mount /dev/vgdata/lvdata /media/lvdata
to make persistant, edit fstab
vim /etc/fstab
/dev/vgdata/lvdata /media/lvdata xfs defaults 1 2
UUID=13546464984565198 media/lvdata etc….. = this way is better bc /dev/sdb or sdc can change on boot
to test this, unmount the run
mount -a
this will mount all in the /etc/fstab
get the UUID of a partition
sudo blkid
give a partition a label
sudo e2label /dev/vdb3 backups
can use label in /etc/fstab
LABEL=backups /media/vdb3 etc…..