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:
“CREATE AND CONFIGURE FILE SYSTEMS”
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:
CREATE, MOUNT, UNMOUNT, AND USE VFAT, EXT4, AND XFS FILE SYSTEMS
MOUNT AND UNMOUNT NETWORK FILE SYSTEMS USING NFS
š RHCSA v8 Practice Session: Mount and unmount network file systems using NFS
š Linux Server Administration - Network File System (NFS) Overview
EXTEND EXISTING LOGICAL VOLUMES
š RHCSA v8 Practice Session: Extend existing logical volumes
š Logical Volume Manager (LVM) versus standard partitioning in Linux
š How to resize a logical volume with 5 simple LVM commands
CREATE AND CONFIGURE SET-GID DIRECTORIES FOR COLLABORATION
š RHCSA v8 Practice Session: Create and configure set-GID directories for collaboration
š Special File Permissions in Linux: SUID, GUID and Sticky Bit
š Create and configure setgid directories for collaboration ā RHCSA Objective Preparation
CONFIGURE DISK COMPRESSION
MANAGE LAYERED STORAGE
š How To Manage Layered Local Storage With Stratis On RHEL 8
š 23.1. Setting up Stratis file systems (skip items: from 23.1.6 to 23.1.11)
š 23.2. Extending a Stratis volume with additional block devices
DIAGNOSE AND CORRECT FILE PERMISSION PROBLEMS
(This objective is also covered in: “understand and use essential tools / list, set, and change standard ugo/rwx permissions” and “manage security / create and use file access control lists”)
š Cheatsheet:
CREATE, MOUNT, UNMOUNT, AND USE VFAT, EXT4, AND XFS FILE SYSTEMS
mkfs.ext4 /dev/sdb1ā” create anext4file system in/dev/sdb1partition.mount /dev/sdb1 /testā” mount/dev/sdb1file system at/testmountpoint (won’t survive a system reboot).unmount /dev/sdb1ā” unmount/dev/sdb1filse system.On
/etc/fstabadd/dev/sdb1 /test ext4 defaults 0 0ā” to mount the file system on system startup.mount -aā” mount all filesystems mentioned in/etc/fstab.
MOUNT AND UNMOUNT NETWORK FILE SYSTEMS USING NFS
(Requires nfs-utils and autofs packages)
Setup NFS server (to serve a directory):
chmod 755 /commonā” add full permissions to dir, before sharing.firewall-cmd --permanent --add-service nfs&firewall-cmd --reloadā” allow NFS traffic to pass throughfirewalld.systemctl --now enable nfs-serverā” enable NFS server.- On
/etc/exportsfile add:/common/ 192.168.0.110(rw) exportfs -avā” export or unexport all items on/etc/exports(verbose mode).
exportfs -u 192.168.0.110:/commonā” unexport dir.Mount share on NFS client (old way to mount):
mkdir /localmount 192.168.0.120:/common /localā” to mount manually.- On
/etc/fstabadd:192.168.0.120:/common /local nfs _netdev 0 0ā” to mount on system startup. mount | grep localā” to confirm mounting success.
Mount share on client on-demand using AutoFS (preferred way to mount):
(If using AutoFS for a sharing, do not mount manually or via
/etc/fstab!)USING DIRECT MAP
mkdir /autodir- On
/etc/auto.masteradd/- /etc/auto.master.d/auto.dirā” to create the mapping. - Create
/etc/auto.master.d/auto.dirfile and add/autodir 192.168.0.120:/commonā” to automount the shared fs on/autodir.
USING INDIRECT MAP (preferred way)
- On
/etc/auto.masteradd/autoindir /etc/auto.master.d/auto.indirā” to create the indirect mapping. - Create
/etc/auto.master.d/auto.indirfile and addcommon 192.168.0.120:/commonā” to automount the shared fs on/autodir(name the mountpoint just like the shared folder’s name). systemctl enable --now autofsorsystemctl restart autofsā” to start.
- On
EXTEND EXISTING LOGICAL VOLUMES
vgextend vg100 /dev/vdcā” extend volume gropup adding a new physical volume.lvextend -L +200M /dev/vg100/lvol0ā” expand logical volume size.lvextend -r -L +80M /dev/vg200/lv200ā” extend local volume and its file system.resize2fs /dev/vg200/lv200 3Tā” resizeext4file system.xfs_growfs /dev/vg200/lv200ā” resizexfsfile system.
CREATE AND CONFIGURE SET-GID DIRECTORIES FOR COLLABORATION
chmod +2000 /usr/bin/write,chmod g+s /usr/bin/writeā” enablessetgidinwritefile without touching other predefined permissions.chmod +1000 /tmp,chmod o+t /tmpā” sets the sticky bit on the specified directory without altering existing underlying permissions. (sticky bit on public and shared writable dirs are used to protect files and subdirs owned by normal users from being deleted or moved by other normal users.)
CONFIGURE DISK COMPRESSION
(If kernel update was previously installed from file, you might need to download and install vdo and kmod-kvdo from file too.)
vdo list,vdostats,lsblkā” see vdo volumes.vdo create --name=testvdo --device=/dev/vdh --vdoLogicalSize=16G --vdoSlabSize=128Mā” create new vdo volume namedtestvdowith logical size of16GBand slab size of 128mb.vdo status --name testvdo | grep -i duplā” check if vdo volume has deduplication enabled.mkfs.xfs -K /dev/mapper/vdo-nameā” createxfsfilesystem on vdo volume.mkfs.ext4 -E nodiscard /dev/mapper/vdo-nameā” createext4filesystem on vdo volume, avoid discarding blocks.On
/etc/fstabadd/dev/mapper/vdo-name mount-point xfs defaults,x-systemd.device-timeout=0,x-systemd.requires=vdo.service 0 0to mount thexfsfile system.On
/etc/fstabadd/dev/mapper/vdo-name mount-point ext4 defaults,x-systemd.device-timeout=0,x-systemd.requires=vdo.service 0 0to mount theext4file system.vdo disableCompression --name testvdoā” disable compression to vdo volume.
MANAGE LAYERED STORAGE
(Requires stratisd and stratis-cli packages)
systemctl enable --now stratisdā” Start Stratis service.stratis pool create strpool /dev/vdgā” createstrpoolstratis pool using/dev/vdgblock device.stratis pool listā” list pools.stratis blockdevā” display information of block devices used bystratis.stratis fsā” display information ofstratisfilesystems.stratis pool add-data strpool /dev/vdhā” expand the stratis pool adding another block device.stratis fs snapshot my-pool my-fs my-fs-snapshotā” create a snapshot frommy-fsstratisfilesystem.mount /dev/stratis/my-pool/my-fs mount-pointā” mount astratissnapshot.stratis filesystem destroy my-pool my-fs-snapshotā” remove a stratis snapshot (you must unmount the snapshot first).stratis pool destroy strpoolā” remove stratis pool.stratis filesystem create strpool5 strfs5ā” createstrfs5filesystem onstrpool5stratis pool.On
/etc/fstabaddUUID=a1f0b64a-4ebb-4d4e-9543-b1d79f600283 /fs1 xfs defaults,x-systemd.requires=stratisd.service 0 0ā” to mount astratisfile system (it must be identified by it’sUUID).
DIAGNOSE AND CORRECT FILE PERMISSION PROBLEMS
chmod 644 somefile.txtā” set file permissions to u=rw,g=r,o=r.chmod +022 somefile.txtā” add g=w,o=w permissions to the file.chmod ug+x,o-wā” add user and group execute permission and remove write permission from others.chown root:sgrp /sdirā” change ownership and owning group torootandsgrprespectively.chmod +4000 /usr/bin/su,chmod u+s /usr/bin/suā” enablessetuidinsufile without touching other predefined permissions. (setuidis used to give special permissions on executable files)chmod +2000 /usr/bin/write,chmod g+s /usr/bin/writeā” enablessetgidinwritefile without touching other predefined permissions.chmod +1000 /tmp,chmod o+t /tmpā” sets the sticky bit on the specified directory without altering existing underlying permissions. (sticky bit on public and shared writable dirs are used to protect files and subdirs owned by normal users from being deleted or moved by other normal users.)chown user1:dba -R dir1ā” changedir1owner touser1and group todbarecursively (could change only group owning withchgrptoo).setfacl -m u:user100:6 file1,setfacl -m u:user100:rw file1ā” givesuser100read and write permissions onfile1by using Access Control Lists (ACLs).setfacl -x u:user100 file1ā” removes anyuser100ā” ACL permissions forfile1.setfacl -b file1ā” resets ACL permissions forfile1.setfacl -dm u:user100:7,u:user200:rwx projects/ā” allocate defaultrwxpermissions touser100anduser200onprojects/dir.setfacl -k projects/ā” deletes default ACL permissions forprojects/directory.
Next:
(RHCSA) Deploy, Configure, and Maintain 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.




