Bookmark this page

Lab: Accessing Linux File Systems

Performance Checklist

In this lab, you will mount a local file system and locate specific files on that file system.

Outcomes

You should be able to:

  • Mount a file system.

  • Generate a disk usage report.

  • Search files in the local file system.

Log in as the student user on workstation using student as the password.

From workstation, run the lab fs-review start command. The command runs a start script that determines if the host, serverb, is reachable on the network. The script also creates a partition on the second disk attached to serverb.

[student@workstation ~]$ lab fs-review start
  1. On serverb as root, identify the UUID for /dev/vdb1 and mount /dev/vdb1 by its UUID on the /mnt/freespace directory.

    1. Use the ssh command to log in to serverb as the student user.

      [student@workstation ~]$ ssh student@serverb
      ...output omitted...
      [student@serverb ~]$ 
    2. Use the su - command to switch to root.

      [student@serverb ~]$ su -
      Password: redhat
      [root@serverb ~]# 
    3. Use the lsblk command to determine the UUID of the /dev/vdb1 device.

      [root@serverb ~]# lsblk -fp /dev/vdb
      NAME        FSTYPE LABEL UUID                                 MOUNTPOINT
      /dev/vdb
      └─/dev/vdb1 xfs          a04c511a-b805-4ec2-981f-42d190fc9a65
    4. Create the /mnt/freespace directory.

      [root@serverb ~]# mkdir /mnt/freespace
    5. Mount the /dev/vdb1 device by using the UUID on the /mnt/freespace directory.

      [root@serverb ~]# mount UUID="a04c511a-b805-4ec2-981f-42d190fc9a65" /mnt/freespace
    6. Verify that the /dev/vdb1 device is mounted on the /mnt/freespace directory.

      [root@serverb ~]# lsblk -fp /dev/vdb1
      NAME        FSTYPE LABEL UUID                                 MOUNTPOINT
      /dev/vdb
      └─/dev/vdb1 xfs          a04c511a-b805-4ec2-981f-42d190fc9a65 /mnt/freespace
  2. Generate a disk usage report of the /usr/share directory, and save the result in the /mnt/freespace/results.txt file.

    [root@serverb ~]# du /usr/share > /mnt/freespace/results.txt
  3. Use the locate command to find all rsyslog.conf configuration files and store the result in the /mnt/freespace/search1.txt file.

    1. Use the updatedb command to update the database used by locate.

      [root@serverb ~]# updatedb
    2. Locate rsyslog.conf configuration files and save the result in the /mnt/freespace/search1.txt file.

      [root@serverb ~]# locate rsyslog.conf > /mnt/freespace/search1.txt
  4. Store the search result of all files in the /usr/share directory that is greater than 50 MB and less than 100 MB in the /mnt/freespace/search2.txt file.

    [root@serverb ~]# find /usr/share -size +50M -size -100M > \
    /mnt/freespace/search2.txt
  5. Exit from serverb.

    [root@serverb ~]$ exit
    logout
    [student@serverb ~]$ exit
    logout
    Connection to serverb closed.
    [student@workstation]$ 

Evaluation

On workstation, run the lab fs-review grade script to confirm success on this lab.

[student@workstation ~]$ lab fs-review grade

Finish

On workstation, run the lab fs-review finish script to complete this exercise.

[student@workstation ~]$ lab fs-review finish

This concludes the lab.

Revision: rh124-8.2-df5a585