Task
First, inspect all application data partitions and find partitions utilizing more than 85% disk space.
Then, save the absolute path of these partitions' device files, one per line, to ~/partitions.txt.
Next, in data partitions using more than 85% disk space, delete the *.log files greater than 5 MB.
Do not modify any other data partitions.
See the complete solution in Explanation.
Step 1: Connect to the correct Linux server.
The video specifies that this task must be completed on host lfcs00077.
From the candidate terminal, execute:
ssh lfcs00077
All disk inspection, file creation, and deletion operations must be performed on this host.
Step 2: Inspect all mounted filesystems and disk utilization.
Execute:
df -hT
This displays information about mounted filesystems, including their utilization.
An illustrative output is:
Filesystem Type Size Used Avail Use% Mounted on
/dev/sda1 ext4 40G 16G 24G 40% /
/dev/sdb1 ext4 20G 18G 2G 90% /data/app1
/dev/sdc1 ext4 30G 27G 3G 90% /data/app2
/dev/sdd1 ext4 50G 30G 20G 60% /data/app3
This output is an example, not data obtained from the actual exam host.
Explanation of the columns:
Column
Description
Filesystem
Device or filesystem source
Type
Filesystem type, such as ext4 or XFS
Size
Total filesystem capacity
Used
Used disk space
Avail
Available disk space
Use%
Percentage of disk space utilized
Mounted on
Directory where the filesystem is mounted
The task requires identifying application data partitions utilizing more than 85%.
For example:
/dev/sdb1 — 90% utilized — qualifies.
/dev/sdc1 — 90% utilized — qualifies.
/dev/sdd1 — 60% utilized — does not qualify.
The system partition /dev/sda1 should not be included merely because it appears in df output. The task specifically refers to application data partitions.
Step 3: Identify the available block devices.
Execute:
lsblk
For more detailed output:
lsblk -p -o NAME,SIZE,FSTYPE,MOUNTPOINTS
lsblk lists available block devices.
-p displays full device paths.
-o specifies the output columns.
NAME identifies the device.
SIZE displays its capacity.
FSTYPE shows the filesystem type.
MOUNTPOINTS lists its mountpoints.
An illustrative output is:
NAME SIZE FSTYPE MOUNTPOINTS
/dev/sda 40G
└─/dev/sda1 40G ext4 /
/dev/sdb 20G
└─/dev/sdb1 20G ext4 /data/app1
/dev/sdc 30G
└─/dev/sdc1 30G ext4 /data/app2
/dev/sdd 50G
└─/dev/sdd1 50G ext4 /data/app3
The output establishes the relationship between block devices, filesystems, and application data mountpoints.
This is necessary because the task requires saving device file paths, not mountpoint paths.
Step 4: Display filesystems using a consistent output format.
Execute:
df -P
The -P option uses the POSIX output format, which displays each filesystem on a single line.
This is useful when processing filesystem information with awk.
To identify all mounted filesystems whose reported utilization exceeds 85%, execute:
df -P | awk 'NR > 1 {
usage = $5
gsub(/%/, "", usage)
if (usage > 85)
print $1, usage "%", $6
}'
NR > 1 skips the header.
$5 extracts the utilization percentage.
gsub(/%/, "", usage) removes the percentage symbol.
usage > 85 selects filesystems whose reported utilization exceeds 85%.
$1 displays the filesystem source.
$6 displays the mountpoint.
An illustrative result is:
/dev/sdb1 90% /data/app1
/dev/sdc1 90% /data/app2
Important: This command identifies all filesystems over the threshold, not necessarily only application data filesystems. You must inspect the results and exclude unrelated system partitions.
Official GNU documentation confirms the purpose and output format of df -P.
Step 5: Verify the mountpoint associated with each qualifying device.
Execute:
findmnt -rno SOURCE,TARGET,FSTYPE
This shows the source devices, their mountpoints, and filesystem types.
For an individual qualifying mountpoint, use:
findmnt --mountpoint /data/app1
And:
findmnt --mountpoint /data/app2
These paths are illustrative. Replace them with the actual qualifying application data mountpoints.
Ensure that each selected filesystem:
Is an application data partition.
Has reported utilization greater than 85%.
Has an identified block-device path.
Is mounted at a known location.
Only proceed once these conditions are confirmed.
Step 6: Create the required ~/partitions.txt file.
The task requires saving the absolute paths of qualifying device files, one per line.
For example, suppose the qualifying devices are:
/dev/sdb1
/dev/sdc1
Execute:
printf '%s\n' /dev/sdb1 /dev/sdc1 > ~/partitions.txt
Replace /dev/sdb1 and /dev/sdc1 with the actual device paths identified on the exam server.
printf '%s\n' prints each supplied argument on a separate line.
/dev/sdb1 and /dev/sdc1 represent the qualifying device files.
> redirects output into the required file.
~/partitions.txt is the output file specified in the task.
The file must contain device paths rather than utilization percentages or mountpoint paths.
Step 7: Verify the contents of partitions.txt.
Execute:
cat ~/partitions.txt
For the illustrative devices, the expected content is:
/dev/sdb1
/dev/sdc1
Each qualifying device must appear on a separate line.
You can also number the lines to inspect the format:
cat -n ~/partitions.txt
Example:
1 /dev/sdb1
2 /dev/sdc1
Verify that no device from an application data filesystem at 85% or below appears in this file.
Step 8: Confirm that each saved path is a block device.
Execute:
while IFS= read -r device; do
ls -l "$device"
done < ~/partitions.txt
The device entries should represent valid block devices.
To check one device directly:
test -b /dev/sdb1
echo $?
An exit status of 0 indicates that the path refers to a block device.
Use the actual path from partitions.txt.
Step 9: Identify log files larger than 5 MB on qualifying partitions.
The next requirement is to delete *.log files greater than 5 MB, but only from qualifying data partitions.
For example, if /dev/sdb1 is mounted at /data/app1, execute:
sudo find /data/app1 -xdev -type f \
-name '*.log' -size +5000000c -print
Parameter
Purpose
/data/app1
Searches the selected qualifying filesystem
-xdev
Prevents descending into other mounted filesystems
-type f
Selects regular files
-name '*.log'
Selects filenames ending with .log
-size +5000000c
Selects files larger than 5,000,000 bytes
Displays matching files without deleting them
The task says 5 MB. The command above uses the strict decimal definition of 5 MB.
In GNU find, the alternative:
-size +5M
uses 5 MiB (5,242,880 bytes) rather than decimal megabytes. Both conventions occur in Linux administration, but they are not numerically identical. GNU Findutils documents these units explicitly.
Step 10: Preview the matching files on every qualifying partition.
For example, if /data/app1 and /data/app2 are the two qualifying mountpoints, execute:
sudo find /data/app1 -xdev -type f \
-name '*.log' -size +5000000c -print
Then:
sudo find /data/app2 -xdev -type f \
-name '*.log' -size +5000000c -print
Example results might be:
/data/app1/logs/application.log
/data/app1/logs/error.log
/data/app2/reports/debug.log
These filenames are illustrative.
Review the output before deleting anything.
This matters because the task expressly prohibits modifying other data partitions.
Step 11: Delete qualifying log files from the first selected partition.
After confirming the filesystem and matching files, execute:
sudo find /data/app1 -xdev -type f \
-name '*.log' -size +5000000c -delete
The -delete action removes the matching files permanently.
Do not execute the command against the entire root filesystem or an unqualified data partition.
The -xdev option is particularly important. It prevents traversal into other mounted filesystems located beneath the selected mountpoint.
Step 12: Delete qualifying log files from any additional qualifying partition.
For the second illustrative mountpoint:
sudo find /data/app2 -xdev -type f \
-name '*.log' -size +5000000c -delete
Repeat only for the remaining application data partitions whose utilization was greater than 85% during the initial inspection.
Do not apply deletion commands to other partitions.
GNU Findutils documents that -delete performs deletion directly and that its predicates should be tested using -print first.
Step 13: Verify that the matching log files have been removed.
Execute:
sudo find /data/app1 -xdev -type f \
-name '*.log' -size +5000000c -print
Then:
sudo find /data/app2 -xdev -type f \
-name '*.log' -size +5000000c -print
If there are no matching files remaining, the commands should produce no output.
If files remain, investigate permission errors or files that changed during the operation.
Step 14: Verify disk utilization after deletion.
Execute:
df -hT
Compare the disk utilization with the initial results.
For example:
Partition
Before
After
/dev/sdb1
90%
77%
/dev/sdc1
90%
82%
/dev/sdd1
60%
60%
These percentages are illustrative, not measured results.
There is no requirement to reduce the qualifying partitions below 85%; the task asks only to delete matching log files.
If a deleted file remains open in a running process, its storage space might not be released until the process closes the file. That does not justify stopping unrelated services without evidence.
Step 15: Confirm that other data partitions were not modified.
Review the original list of partitions and verify that deletion was limited to the selected qualifying mountpoints.
For example, do not execute:
sudo find /data/app3 -name '*.log' -delete
if /data/app3 had utilization of only 60%.
The task explicitly states:
Do not modify any other data partitions.
Therefore, applying a blanket cleanup command across /data, /, or all mounted filesystems would be incorrect.
Step 16: Verify the saved device list again.
Execute:
cat ~/partitions.txt
Confirm that it still contains the original qualifying device paths.
Do not regenerate this list after deletion.
For example, suppose /dev/sdb1 was initially 90% utilized but dropped to 77% after cleanup. It must still appear in ~/partitions.txt because it qualified during the initial inspection.
Step 17: Perform final verification.
Execute:
cat ~/partitions.txt
df -hT
lsblk -p -o NAME,FSTYPE,MOUNTPOINTS
Then run the file search on each qualifying mountpoint once more.
The completed task must meet these conditions:
Requirement
Expected result
Application data partitions inspected
Yes
Partitions greater than 85% identified
Yes
Device paths saved in ~/partitions.txt
Yes
One absolute device path per line
Yes
Matching log files greater than 5 MB deleted
Yes
Only qualifying partitions affected
Yes
Unrelated data partitions unchanged
Yes
Final Solution
The essential command sequence below illustrates the procedure. The two device paths and mountpoints are examples and must be replaced with the actual qualifying values on lfcs00077.
Copy commands
# Connect to the correct host
ssh lfcs00077
# Inspect disk utilization and mounted devices
df -hT
lsblk -p -o NAME,SIZE,FSTYPE,MOUNTPOINTS
# Find filesystems over 85%
df -P | awk 'NR > 1 {
usage=$5
gsub(/%/, "", usage)
if (usage > 85)
print $1, usage "%", $6
}'
# Confirm actual device-to-mountpoint relationships
findmnt -rno SOURCE,TARGET,FSTYPE
# EXAMPLE DEVICES: replace after identifying qualifying partitions
printf '%s\n' /dev/sdb1 /dev/sdc1 > ~/partitions.txt
# Verify the saved list
cat ~/partitions.txt
# EXAMPLE MOUNTPOINTS: preview before deleting
sudo find /data/app1 -xdev -type f \
-name '*.log' -size +5000000c -print
sudo find /data/app2 -xdev -type f \
-name '*.log' -size +5000000c -print
# Delete only on confirmed qualifying partitions
sudo find /data/app1 -xdev -type f \
-name '*.log' -size +5000000c -delete
sudo find /data/app2 -xdev -type f \
-name '*.log' -size +5000000c -delete
# Final verification
df -hT
cat ~/partitions.txt
Technical Verification and References
The procedures are consistent with the following official documentation:
GNU Coreutils — df command
Linux lsblk(8) — Block Device Inspection
GNU Findutils — File Size Matching
GNU Findutils — Filesystem Boundary Control
GNU Findutils — Deleting Files
Video verification finding: I located Question 6 at approximately 28:04–28:10 of the recording and confirmed the task wording and required host. The video moves to Question 7 without showing a completed terminal solution for Question 6. Therefore, the commands above are an independently documented solution, not a reproduction of commands successfully executed in the recording.
Expected result: The file ~/partitions.txt contains the absolute device paths of the application data partitions that initially exceeded 85% disk utilization. All qualifying .log files larger than the specified threshold are deleted from those partitions only, without modifying any other data partitions.

Submit