This is part of the independent and unofficial RHCSA Exam Study Guide series providing free π€ resources to prepare for the exam.
This post covers the objectives under the section:
βCONFIGURE LOCAL STORAGEβ
It contains two main parts:
- Resources: with links to learn and practice for each objective.
- Cheatsheet: containing some examples of commands and actions performed in each objective (when applied).
π Resources:
Attention: You must add more virtual disks to the RHEL virtual machine in order to practice for this objective.
π How to add new drives to a VirtualBox virtual machine (this is s setup step! Follow the βAdding the diskβ section only.)
π RHCSA v8 Practice Session: Configure local storage (a single video presenting of all the objectives below)
LIST, CREATE, DELETE PARTITIONS ON MBR AND GPT DISKS
π gdisk Command: How to Create GUID Partitions (GPT) in Linux (skip βFormatting the partition in Linuxβ and following sections.)
CREATE AND REMOVE PHYSICAL VOLUMES / ASSIGN PHYSICAL VOLUMES TO VOLUME GROUPS / CREATE AND DELETE LOGICAL VOLUMES
CONFIGURE SYSTEMS TO MOUNT FILE SYSTEMS AT BOOT BY UNIVERSALLY UNIQUE ID (UUID) OR LABEL
π Using mkfs command in Linux to Format the Filesystem on a Disk or Partition
π Linux Essentials - Automatically mounting storage volumes with /etc/fstab
ADD NEW PARTITIONS AND LOGICAL VOLUMES, AND SWAP TO A SYSTEM NON-DESTRUCTIVELY
π What is Linux swap?
π Cheatsheet:
LIST, CREATE, DELETE PARTITIONS ON MBR AND GPT DISKS
lsblkβ‘ list block devices.parted /dev/vdb mklabel msdosβ‘ label a new disk asmsdos.parted /dev/vdb printβ‘ display disk info.parted /dev/vdb mkpart primary 1 101mβ‘ create a newprimarypartition on disk, with size of 100mb.parted /dev/vdb rm 1β‘ remove partition1.gdisk /dev/vdcβ‘ create/modify partitions on disk usinggdisk.partprobeβ‘ inform the OS of partition table changes.wipefs --all /dev/vdgβ‘ wipe any partition table, fs, RAID signatures from block device.
CREATE AND REMOVE PHYSICAL VOLUMES / ASSIGN PHYSICAL VOLUMES TO VOLUME GROUPS / CREATE AND DELETE LOGICAL VOLUMES
vgs,pvs,lvsβ‘ listvolume groups,physical volumesandlogical volumes.pvcreate /dev/vdcβ‘ initialize physical volume to use in LVM.pvremove /dev/vdb /dev/vdcβ‘ uninitialize physical volumes.vgcreate vg100 /dev/vdb -s 16Mβ‘ createvolume groupusing/dev/vdbphysical volume, withPEsize of 16MB.vgdisplay vg100β‘ checkvg100attributes.vgextend vg100 /dev/vdcβ‘ extend volume gropup adding a new physical volume.vgremove vg100β‘ remove volume group.lvcreate -L 100M vg100 -n lvol0β‘ create logical volumelvol0onvg100with 100MB of size.lvextend -L +200M /dev/vg100/lvol0β‘ expand logical volume size.lvextend -r -L +80M /dev/vg200/lv200β‘ extend local volume and its file system.lvreduce -L -252M /dev/vg100/lvol0β‘ reduce logical volume size.lvremove /dev/vg100/lvol0β‘ remove logical volume.
CONFIGURE SYSTEMS TO MOUNT FILE SYSTEMS AT BOOT BY UNIVERSALLY UNIQUE ID (UUID) OR LABEL
blkidβ‘ locate/print block devices attributes (ex.: UUID).df -hβ‘ show file distem disk usage.du -sh /usr/binβ‘ show dir disk usage.du -sc /etc /usr/binβ‘ show disk usage for each dir and the sum of both.lsblk -fβ‘ list block devices, show file system type and UUID.mkfs.vfat /dev/sdd1β‘ initialize the partition with the VFAT filesystem type./etc/fstabexample entries:UUID=3C65-A634 /vfatfs5 vfat defaults 0 0UUID=7eaf462a-ecd2-4d09-91d0-09bdba6fa491 /ext4fs5 ext4 defaults 0 0UUID=d9cdb722-ad2d-4d2c-901d-d274950ccc55 /xfsfs5 xfs defaults 0 0/dev/mapper/vdo5 /vdofs5 xfs _netdev-systemd.requires=vdo.service 0 0/dev/vg200/lv200 /lvmfs5 ext4 defaults 0 0/dev/vg200/lv300 /lvmfs6 xfs defaults 0 0UUID=a30f9774-a11d-4a01-ad87-4bfa6f74ba64 /strfs5 xfs _netdev-systemd.requires=stratisd.service 0 0/dev/vde1 swap swap defaults 0 0/dev/vg200/swapvol swap swap defaults 0 0
mount -aβ‘ mount all fs mentioned onfstab.mount -o rw /stratis/strpool5/strfs5 /strfs5β‘ mountstrfs5stratis fs on/strfs5dir.lsblk /stratis/strpool5/strfs5 -o UUID > /tmp/uuidβ‘ savestrfs5fs UUID on a temp file.
ADD NEW PARTITIONS AND LOGICAL VOLUMES, AND SWAP TO A SYSTEM NON-DESTRUCTIVELY
mkswap /dev/vde1β‘ initialize partition with swap structures.mkswap -L swappart /dev/vde1β‘ applyswappartlabel to partition.swapon -aβ‘ activate all swap partitions described onfstab.swapon -sβ‘ list all active swap partitions.
Next:
(RHCSA) Create and Configure File Systems
β¦or back to Red Hat Certified System Administrator (RHCSA) Exam Study Guide
Useful links & references:
Enable Sysadmin (a blog from Red Hat)
Footnotes:
- Follow me on Twitter to get more posts like this and other quick tips in your feed.
- If you have any doubts or tips about this article, Iβd appreciate knowing and discussing it via email.
- Do you have any other Linux tips? Would you like to publish that in this blog? Please send an email to all drops.
- As English is not my native language, I apologize for the errors. Corrections are welcome.
- Contact: contact [@] alldrops [.] info.




