Bookmark this page

Guided Exercise: Mounting and Unmounting File Systems

In this lab, you will mount and unmount file systems.

Outcomes

The user identifies and mounts a new file system at a specified mount point, then unmounts it.

Reset your serverX system. Run the script lab fs setup before starting the exercise.

  1. A new partition with a file system has been added to the second disk (vdb) on your serverX machine. Mount the newly available partition by UUID at the newly created mount point /mnt/newspace.

    1. Use the blkid to discover the UUID of the newly added partition, vdb1, on serverX.

      [root@serverX ~]# blkid
      /dev/vda1: UUID="46f543fd-78c9-4526-a857-244811be2d88" TYPE="xfs" 
      /dev/vdb1: UUID="7c5e3fbb-34eb-4431-a4a5-9b887c1b6866" TYPE="xfs"
    2. Create the mount point /mnt/newspace on serverX.

      [root@serverX ~]# mkdir /mnt/newspace
    3. Mount the file system by UUID on the /mnt/newspace directory of the serverX machine.

      [root@serverX ~]# mount UUID="7c5e3fbb-34eb-4431-a4a5-9b887c1b6866" /mnt/newspace
  2. Change to the /mnt/newspace directory and create a new directory, /mnt/newspace/newdir, with an empty file, /mnt/newspace/newdir/newfile, on serverX.

    1. Change to the /mnt/newspace directory on serverX.

      [root@serverX ~]# cd /mnt/newspace
    2. Create a new directory, /mnt/newspace/newdir, on serverX.

      [root@serverX newspace]# mkdir newdir
    3. Create a new empty file, /mnt/newspace/newdir/newfile, on serverX.

      [root@serverX newspace]# touch newdir/newfile
  3. Unmount the file system mounted on the /mnt/newspace directory on serverX.

    1. Try to unmount /mnt/newspace while the current directory on the shell is still /mnt/newspace on serverX.

      [root@serverX newspace]# umount /mnt/newspace
    2. Change the current directory on the shell to /root.

      [root@serverX newspace]# cd
      [root@serverX ~]# 
    3. Successfully unmount /mnt/newspace on serverX.

      [root@serverX ~]# umount /mnt/newspace
Revision: rh199-7-d0984a3