Red Hat System Administration I
Practice mounting and unmounting file systems.
Outcomes
Identify and mount a new file system at a specified mount point, and then unmount the file system.
As the student user on the workstation machine, use the lab command to prepare your system for this exercise.
This command prepares your environment and ensures that all required resources are available.
[student@workstation ~]$ lab start fs-mount
Instructions
Log in to the
serveramachine as thestudentuser and switch to therootuser.[student@workstation ~]$
ssh student@servera...output omitted... [student@servera ~]$sudo -i[sudo] password for student:student[root@servera ~]#A new partition with a file system is added to the
/dev/vdbdisk on theserveramachine. Mount the newly available partition by using the UUID at the/mnt/part1mount point.Create the
/mnt/part1directory.[root@servera ~]#
mkdir /mnt/part1Query the UUID of the
/dev/vdb1device.[root@servera ~]#
lsblk -fp /dev/vdbNAME FSTYPE LABEL UUID MOUNTPOINT /dev/vdb └─/dev/vdb1 xfsa04c511a-b805-4ec2-981f-42d190fc9a65Mount the file system by using the UUID on the
/mnt/part1directory. Use the/dev/vdb1UUID from the previous command output.[root@servera ~]#
mount \UUID="a04c511a-b805-4ec2-981f-42d190fc9a65" /mnt/part1Verify that the
/dev/vdb1device is mounted on the/mnt/part1directory.[root@servera ~]#
lsblk -fp /dev/vdbNAME FSTYPE LABEL UUID MOUNTPOINT /dev/vdb └─/dev/vdb1 xfs a04c511a-b805-4ec2-981f-42d190fc9a65/mnt/part1
Change to the
/mnt/part1directory and create thetestdirsubdirectory. Create the/mnt/part1/testdir/newmountfile.Change to the
/mnt/part1directory.[root@servera ~]#
cd /mnt/part1Create the
/mnt/part1/testdirdirectory.[root@servera part1]#
mkdir testdirCreate the
/mnt/part1/testdir/newmountfile.[root@servera part1]#
touch testdir/newmount
Unmount the file system that is mounted on the
/mnt/part1directory.Unmount the
/mnt/part1directory when the shell is in the/mnt/part1directory. Theumountcommand fails to unmount the device.[root@servera part1]#
umount /mnt/part1umount: /mnt/part1: target is busy.Change the current directory on the shell to the
/rootdirectory.[root@servera part1]#
cd[root@servera ~]#Unmount the
/mnt/part1directory.[root@servera ~]#
umount /mnt/part1
Return to the
workstationmachine as thestudentuser.[root@servera ~]#
exitlogout [student@servera ~]$exitlogout Connection to servera closed. [student@workstation]$