In this lab, you mount a local file system and locate specific files on that file system.
Outcomes
Mount a file system.
Generate a disk usage report.
Find files in the local 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-review
Instructions
On the serverb machine as the root user, identify the UUID for the /dev/vdb1 device, and mount it by using its UUID on the /mnt/freespace directory.
Log in to the serverb machine as the student user, and switch to the root user.
[student@workstation ~]$ssh student@serverb...output omitted... [student@serverb ~]$sudo -i[sudo] password for student:student[root@serverb ~]#
Query the UUID of the /dev/vdb1 device.
[root@serverb ~]# lsblk -fp /dev/vdb
NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS
/dev/vdb
└─/dev/vdb1 xfs 44bfb7c8-970c-4d0b-b53d-90ae31cb27caCreate the /mnt/freespace directory.
[root@serverb ~]# mkdir /mnt/freespaceMount the /dev/vdb1 device by using the UUID on the /mnt/freespace directory.
[root@serverb ~]# mount UUID="44bfb7c8-970c-4d0b-b53d-90ae31cb27ca" /mnt/freespaceVerify that the /dev/vdb1 device is mounted on the /mnt/freespace directory.
[root@serverb ~]# lsblk -fp /dev/vdb1
NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS
/dev/vdb1
xfs 44bfb7c8-970c-4d0b-b53d-90ae31cb27ca 4.9G 1% /mnt/freespaceGenerate a disk usage report for the /usr/share directory.
Save the result in the /mnt/freespace/results.txt file.
Locate all the files that match the rsyslog.conf keyword, and store the result in the /mnt/freespace/search1.txt file.
Store in the /mnt/freespace/search2.txt file the search result of all files in the /usr/share directory that are greater than 50 MB and less than 100 MB.
Return to the workstation system as the student user.
This concludes the section.