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.

BEFORE YOU BEGIN

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.

  2. Generate a disk usage report of the /usr/share directory, and save the result in the /mnt/freespace/results.txt file.

  3. Use the locate command to find all rsyslog.conf configuration files and store the result in the /mnt/freespace/search1.txt file.

  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.

  5. Exit from serverb.

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.

SOLUTION: 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.

BEFORE YOU BEGIN

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.1 Use the ssh command to log in to serverb as the student user.

    [student@workstation ~]$ ssh student@serverb
    ...output omitted...
    [student@serverb ~]$
    

    1.2 Use the su - command to switch to root.

    [student@serverb ~]$ su -
    Password: redhat
    [root@serverb ~]#
    

    1.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
    

    1.4 Create the /mnt/freespace directory.

    [root@serverb ~]# mkdir /mnt/freespace
    

    1.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
    

    1.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.

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

    [root@serverb ~]# updatedb
    

    3.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.