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, and use ACLs to protect a directory.
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.
Use ACLs to protect a directory.
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_home in a new 2 GiB volume group called extra_storage.
Use the unpartitioned /dev/vdb disk to create partitions.
The logical volume vol_home should be formatted with the XFS file-system type, and mounted persistently on /home-directories.
Ensure that the network file system called /share is persistently mounted on /local-share across reboot.
The NFS server servera.lab.example.com exports the /share network file system.
The NFS export path is servera.lab.example.com:/share.
Create a new 512 MiB partition on the /dev/vdc disk to be used as swap space.
This swap space must be automatically activated at boot.
Create a new group called production.
Create the production1, production2, production3, and production4 users.
Ensure that they use the new group called production as their supplementary group.
Configure your system so that it uses a new directory called /run/volatile to 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 be 0700.
Make sure that you use the /etc/tmpfiles.d/volatile.conf file to configure the time based cleanup for the files in /run/volatile.
Create the new directory called /webcontent.
Both the owner and group of the directory should be root.
The group members of production should be able to read and write to this directory.
The production1 user should only be able to read this directory.
These permissions should apply to all new files and directories created under the /webcontent directory.
From workstation, open an SSH session to serverb as student.
Switch to the root user.
Create a 2 GiB partition on /dev/vdb.
Create a logical volume called vol_home using the 2 GiB partition you created on /dev/vdb.
Name the volume group extra_storage.
Declare the /dev/vdb1 block device as a physical volume.
[root@serverb ~]#pvcreate /dev/vdb1...output omitted...
Create the extra_storage volume 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_home with the XFS file-system type, and mount it on /home-directories.
Create a directory called /home-directories.
[root@serverb ~]#mkdir /home-directories
Format /dev/extra_storage/vol_home with the XFS file-system type.
[root@serverb ~]#mkfs -t xfs /dev/extra_storage/vol_home...output omitted...
Persistently mount /dev/extra_storage/vol_home on /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 /share is persistently mounted on /local-share across reboot.
The NFS server servera.lab.example.com exports the /share network file system.
The NFS export path is servera.lab.example.com:/share.
Create the /local-share directory.
[root@serverb ~]#mkdir /local-share
Append the appropriate entry to /etc/fstab so that the network file system available at servera.lab.example.com:/share is persistently mounted on /local-share across reboot.
[root@serverb ~]#echo "servera.lab.example.com:/share /local-share \nfs rw,sync 0 0" >> /etc/fstab
Mount the network file system on /local-share based on the entry in /etc/fstab.
[root@serverb ~]#mount /local-share
Create a new 512 MiB partition on the /dev/vdc disk 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 513MiB
Make 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, and production4 users.
Ensure that they use the new group called production as their supplementary group.
Configure your system so that it uses a new directory called /run/volatile to 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 be 0700.
Make sure that you use the /etc/tmpfiles.d/volatile.conf file to configure the time based cleanup for the files in /run/volatile.
Create a new directory called /webcontent.
Both the owner and group owner of the directory should be root.
The group members of production should be able to read and write to this directory.
The production1 user should only be able to read this directory.
These permissions should apply to all new files and directories created under the /webcontent directory.
Create the /webcontent directory.
[root@serverb ~]#mkdir /webcontent
Use setfacl to configure permissions on /webcontent so that the group members of production have both read and write permissions to it, with the exception of the production1 user, who should only be granted read permission.
[root@serverb ~]#setfacl -m u:production1:rx /webcontent[root@serverb ~]#setfacl -m g:production:rwx /webcontent
Use setfacl to set the default permissions on /webcontent so that the permissions you applied in the preceding step also apply to all new files and directories created under the /webcontent directory.
[root@serverb ~]#setfacl -m d:u:production1:rx /webcontent[root@serverb ~]#setfacl -m d:g:production:rwx /webcontent
Exit the root user's shell.
[root@serverb ~]#exitlogout
Log off from serverb.
[student@serverb ~]$exitlogout Connection to serverb closed.