RHCSA Rapid Track
In this exercise, you will practice mounting and unmounting file systems.
Outcomes
You should be able to identify and mount a new file system at a specified mount point, then unmount it.
Log in as the student user on workstation using student as the password.
From workstation, run the lab fs-mount start command.
The command runs a start script that determines if the host, servera, is reachable on the network.
The script also creates a partition on the second disk attached to servera.
[student@workstation ~]$lab fs-mount start
Use the ssh command to log in to
serveraas thestudentuser.[student@workstation ~]$ssh student@servera...output omitted...[student@servera ~]$A new partition with a file system has been added to the second disk (
/dev/vdb) onservera. Mount the newly available partition by UUID at the newly created mount point/mnt/newspace.Use the sudo -i command to switch to
root, as only therootuser can manually mount a device.[student@servera ~]$sudo -i[sudo] password for student:student[root@servera ~]#Create the
/mnt/newspacedirectory.[root@servera ~]#mkdir /mnt/newspaceUse the lsblk command with the
-fpoption to discover the UUID of the device,/dev/vdb1.[root@servera ~]#lsblk -fp /dev/vdbNAME FSTYPE LABEL UUID MOUNTPOINT /dev/vdb └─/dev/vdb1 xfsa04c511a-b805-4ec2-981f-42d190fc9a65Mount the file system by using UUID on the
/mnt/newspacedirectory. Replace the UUID with that of the/dev/vdb1disk from the previous command output.[root@servera ~]#mount \UUID="a04c511a-b805-4ec2-981f-42d190fc9a65" /mnt/newspaceVerify that the
/dev/vdb1device is mounted on the/mnt/newspacedirectory.[root@servera ~]#lsblk -fp /dev/vdbNAME FSTYPE LABEL UUID MOUNTPOINT /dev/vdb └─/dev/vdb1 xfs a04c511a-b805-4ec2-981f-42d190fc9a65/mnt/newspace
Change to the
/mnt/newspacedirectory and create a new directory,/mnt/newspace/newdir, with an empty file,/mnt/newspace/newdir/newfile.Change to the
/mnt/newspacedirectory.[root@servera ~]#cd /mnt/newspaceCreate a new directory,
/mnt/newspace/newdir.[root@servera newspace]#mkdir newdirCreate a new empty file,
/mnt/newspace/newdir/newfile.[root@servera newspace]#touch newdir/newfile
Unmount the file system mounted on the
/mnt/newspacedirectory.Use the umount command to unmount
/mnt/newspacewhile the current directory on the shell is still/mnt/newspace. The umount command fails to unmount the device.[root@servera newspace]#umount /mnt/newspaceumount: /mnt/newspace: target is busy.Change the current directory on the shell to
/root.[root@servera newspace]#cd[root@servera ~]#Now, successfully unmount
/mnt/newspace.[root@servera ~]#umount /mnt/newspace
Exit from
servera.[root@servera ~]#exitlogout[student@servera ~]$exitlogout Connection to servera closed.[student@workstation]$
This concludes the guided exercise.