Red Hat System Administration I
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
serverbmachine as therootuser, identify the UUID for the/dev/vdb1device, and mount it by using its UUID on the/mnt/freespacedirectory.Log in to the
serverbmachine as thestudentuser, and switch to therootuser.[student@workstation ~]$
ssh student@serverb...output omitted... [student@serverb ~]$sudo -i[sudo] password for student:student[root@serverb ~]#Query the UUID of the
/dev/vdb1device.[root@serverb ~]#
lsblk -fp /dev/vdbNAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS /dev/vdb └─/dev/vdb1 xfs 44bfb7c8-970c-4d0b-b53d-90ae31cb27caCreate the
/mnt/freespacedirectory.[root@serverb ~]#
mkdir /mnt/freespaceMount the
/dev/vdb1device by using the UUID on the/mnt/freespacedirectory.[root@serverb ~]#
mount UUID="44bfb7c8-970c-4d0b-b53d-90ae31cb27ca" /mnt/freespaceVerify that the
/dev/vdb1device is mounted on the/mnt/freespacedirectory.[root@serverb ~]#
lsblk -fp /dev/vdb1NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS /dev/vdb1 xfs 44bfb7c8-970c-4d0b-b53d-90ae31cb27ca 4.9G 1% /mnt/freespace
Generate a disk usage report for the
/usr/sharedirectory. Save the result in the/mnt/freespace/results.txtfile.Locate all the files that match the
rsyslog.confkeyword, and store the result in the/mnt/freespace/search1.txtfile.Store in the
/mnt/freespace/search2.txtfile the search result of all files in the/usr/sharedirectory that are greater than 50 MB and less than 100 MB.Return to the
workstationsystem as thestudentuser.