RHCSA Rapid Track
In this review, you will create an LVM logical volume, mount a network file system, create a swap partition that is automatically activated at boot, configure temporary unused files to be cleaned from the system.
Outcomes
You should be able to:
Create an LVM logical volume.
Mount a network file system.
Create a swap partition that is automatically activated at boot.
Configure temporary unused files to be cleaned from the system.
Copy any files or work you wish to keep to other systems before resetting.
Reset the workstation, servera, and serverb systems now, unless you just finished resetting them at the end of the last exercise.
Log in to workstation as student using student as the password.
On workstation, run lab rhcsa-compreview2 start to start the comprehensive review.
This script creates the necessary files to set up the environment correctly.
[student@workstation ~]$lab rhcsa-compreview2 start
Instructions
Perform the following tasks on serverb to complete the comprehensive review.
Configure a new 1 GiB logical volume called
vol_homein a new 2 GiB volume group calledextra_storage. Use the unpartitioned/dev/vdbdisk to create partitions.The logical volume
vol_homeshould be formatted with theXFSfile-system type, and mounted persistently on/home-directories.Ensure that the network file system called
/shareis persistently mounted on/local-shareacross reboot. The NFS serverservera.lab.example.comexports the/sharenetwork file system. The NFS export path isservera.lab.example.com:/share.Create a new 512 MiB partition on the
/dev/vdcdisk to be used as swap space. This swap space must be automatically activated at boot.Create a new group called
production. Create theproduction1,production2,production3, andproduction4users. Ensure that they use the new group calledproductionas their supplementary group.Configure your system so that it uses a new directory called
/run/volatileto store temporary files. Files in this directory should be subject to time based cleanup if they are not accessed for more than 30 seconds. The octal permissions for the directory must be0700. Make sure that you use the/etc/tmpfiles.d/volatile.conffile to configure the time based cleanup for the files in/run/volatile.
From
workstation, open an SSH session toserverbasstudent.Switch to the
rootuser.Create a 2 GiB partition on
/dev/vdb.Create a logical volume called
vol_homeusing the 2 GiB partition you created on/dev/vdb. Name the volume groupextra_storage.Declare the
/dev/vdb1block device as a physical volume.[root@serverb ~]#pvcreate /dev/vdb1...output omitted...Create the
extra_storagevolume group using/dev/vdb1.[root@serverb ~]#vgcreate extra_storage /dev/vdb1...output omitted...Create a 1 GiB logical volume named
vol_home.[root@serverb ~]#lvcreate -L 1GiB -n vol_home extra_storage...output omitted...
Format
vol_homewith theXFSfile-system type, and mount it on/home-directories.Create a directory called
/home-directories.[root@serverb ~]#mkdir /home-directoriesFormat
/dev/extra_storage/vol_homewith theXFSfile-system type.[root@serverb ~]#mkfs -t xfs /dev/extra_storage/vol_home...output omitted...Persistently mount
/dev/extra_storage/vol_homeon/home-directories. Use the structure's UUID when creating the entry in/etc/fstab.[root@serverb ~]#lsblk -o UUID /dev/extra_storage/vol_homeUUID 988cf149-0667-4733-abca-f80c6ec50ab6[root@serverb ~]#echo "UUID=988c...0ab6/home-directories \xfs defaults 0 0" >> /etc/fstab[root@serverb ~]#mount -a
Ensure that the network file system called
/shareis persistently mounted on/local-shareacross reboot. The NFS serverservera.lab.example.comexports the/sharenetwork file system. The NFS export path isservera.lab.example.com:/share.Create the
/local-sharedirectory.[root@serverb ~]#mkdir /local-shareAppend the appropriate entry to
/etc/fstabso that the network file system available atservera.lab.example.com:/shareis persistently mounted on/local-shareacross reboot.[root@serverb ~]#echo "servera.lab.example.com:/share /local-share \nfs rw,sync 0 0" >> /etc/fstabMount the network file system on
/local-sharebased on the entry in/etc/fstab.[root@serverb ~]#mount /local-share
Create a new 512 MiB partition on the
/dev/vdcdisk to be used as swap space. This swap space must be automatically activated at boot time.Create a 512 MiB partition on
/dev/vdc.[root@serverb ~]#parted /dev/vdc mklabel msdos[root@serverb ~]#parted /dev/vdc mkpart primary linux-swap 1MiB 513MiBMake the swap space on
/dev/vdc1.[root@serverb ~]#mkswap /dev/vdc1...output omitted...Activate the swap space so that it persists across reboot. Use the structure's UUID when creating the entry in
/etc/fstab.[root@serverb ~]#lsblk -o UUID /dev/vdc1UUID cc18ccb6-bd29-48a5-8554-546bf3471b69[root@serverb ~]#echo "UUID=cc18...1b69swap \swap defaults 0 0" >> /etc/fstab[root@serverb ~]#swapon -a
Create the
production1,production2,production3, andproduction4users. Ensure that they use the new group calledproductionas their supplementary group.Configure your system so that it uses a new directory called
/run/volatileto store temporary files. Files in this directory should be subject to time based cleanup if they are not accessed for more than 30 seconds. The octal permissions for the directory must be0700. Make sure that you use the/etc/tmpfiles.d/volatile.conffile to configure the time based cleanup for the files in/run/volatile.Create a file called
/etc/tmpfiles.d/volatile.confwith the following content.d /run/volatile 0700 root root 30s
Use the
systemd-tmpfiles --createcommand to create the/run/volatiledirectory if it does not exist.[root@servera ~]#systemd-tmpfiles --create /etc/tmpfiles.d/volatile.confExit the
rootuser's shell.[root@serverb ~]#exitlogoutLog off from
serverb.[student@serverb ~]$exitlogout Connection to serverb closed.