You've reached the limit of preview questions.
Register now to access more real Linux Foundation LFCS exam questions for free!
Context
An LVM-backed filesystem is filling up.
Task
Without unmounting the LVM-backed filesystem mounted at /var/log, add 0.2GB of disk space from the volume group system.
See the complete solution in Explanation.
Objective: Increase the storage capacity of the LVM-backed filesystem mounted at /var/log by approximately 0.2 GB, using free space from the existing volume group system, without unmounting the filesystem or interrupting access to existing log files.
The solution requires two operations:
Extend the logical volume using lvextend.
Grow the filesystem online so that it can use the additional capacity.
For the ext4 filesystem demonstrated in the video, the principal commands are:
sudo lvextend -L +0.2G /dev/system/log
sudo resize2fs /dev/system/log
The commands must be executed in the correct order. The first expands the underlying logical volume, while the second expands the ext4 filesystem. Both operations can be performed without unmounting a supported ext4 filesystem.
Linux manual page
+1
Step 1: Connect to the correct Linux server.
The video identifies the required host as lfcs00093.
From the candidate terminal, execute:
ssh lfcs00093
This establishes an SSH session with the server containing the LVM-backed /var/log filesystem.
All subsequent commands must be executed on this host.
Step 2: Verify that /var/log is a separate mounted filesystem.
Execute:
findmnt /var/log
This displays the source device, filesystem type, mountpoint and mount options.
For a more concise result:
findmnt -no SOURCE,FSTYPE,TARGET /var/log
The recording identifies the logical volume as:
/dev/system/log
The mountpoint is:
/var/log
This matters because /var/log could otherwise simply be a directory inside the root filesystem. The task specifically concerns a separate LVM-backed filesystem mounted there.
Step 3: Inspect the existing filesystem capacity.
Execute:
df -hT /var/log
This reports:
Filesystem device.
Filesystem type.
Total filesystem capacity.
Used space.
Available space.
Utilization percentage.
Mountpoint.
Record the existing size before extending the volume.
Step 4: Inspect the LVM configuration.
Execute:
sudo pvs
sudo vgs
sudo lvs
These commands provide three levels of LVM information:
Command
Information displayed
pvs
Physical volumes contributing disk capacity
vgs
Volume groups and their available space
lvs
Logical volumes and their current sizes
Confirm that the volume group system contains the logical volume log.
Step 5: Verify the logical volume directly.
Execute:
sudo lvdisplay /dev/system/log
Inspect the logical volume name, volume group, current size, logical extent allocation and status.
The logical volume must belong to:
system
And its name must be:
log
You can also execute:
sudo lvs /dev/system/log
This provides a concise overview.
Step 6: Check available free capacity in the volume group.
Execute:
sudo vgs system
For specific fields:
sudo vgs -o vg_name,vg_size,vg_free,vg_extent_size system
The VFree value must be sufficient to allocate the requested extension.
LVM allocates storage in units called physical extents. Consequently, an extension requested as 0.2G may be rounded to an appropriate extent boundary.
Do not add a new disk or create another volume group. The question requires using available capacity from the existing volume group system.
Step 7: Confirm the filesystem type before resizing.
Execute:
findmnt -no FSTYPE --mountpoint /var/log
The filesystem type determines which utility must be used to expand it.
Filesystem
Online expansion command
ext4
resize2fs /dev/system/log
XFS
xfs_growfs /var/log
The commands demonstrated for this task use resize2fs, which is appropriate for ext4.
Important: Do not run resize2fs against XFS or xfs_growfs against ext4.
Step 8: Check the size of the logical volume before modification.
Execute:
sudo lvs -o lv_name,vg_name,lv_size --units m /dev/system/log
This displays the current logical volume capacity in MiB.
For example, the original volume might have a size of 96 MiB. That is an illustrative starting point; use the actual value reported by the server.
You should record the initial capacity to verify the increase afterward.
Step 9: Extend the logical volume by 0.2 GB.
Execute:
sudo lvextend -L +0.2G /dev/system/log
This is the principal LVM expansion command.
sudo executes the command with administrative privileges.
lvextend increases the capacity of an existing logical volume.
-L specifies the capacity adjustment.
+0.2G requests an additional 0.2 GiB, subject to LVM's extent allocation.
/dev/system/log is the existing logical volume.
The plus sign is essential.
Compare:
sudo lvextend -L +0.2G /dev/system/log
with:
sudo lvextend -L 0.2G /dev/system/log
The first command adds capacity to the existing logical volume.
The second requests an absolute resulting size of 0.2 GiB, which would not correctly implement the task's requirement.
The official LVM documentation confirms that + makes the size relative to the current logical volume capacity.
Linux manual page
Step 10: Understand the effect of LVM extent allocation.
LVM allocates logical volume storage in physical extents.
For example, if the existing volume was 96 MiB and the requested increase was 0.2 GiB:
0.2
×
1024
=
204.8
MiB
0.2×1024=204.8 MiB
If the volume group uses 4 MiB physical extents, LVM may round the increase upward to 208 MiB.
The resulting size would then be:
96
+
208
=
304
MiB
96+208=304 MiB
This illustrates why the final capacity may differ slightly from the mathematical increase.
Such rounding is normal and does not indicate that LVM incorrectly extended the volume.
Step 11: Verify that the logical volume extension succeeded.
After the command completes, execute:
sudo lvs /dev/system/log
For more detailed output:
sudo lvdisplay /dev/system/log
Confirm that the logical volume has increased by the requested approximate capacity.
Also verify that the volume group has allocated free extents to the extended logical volume:
sudo vgs system
Important: The block device may now have additional capacity, but the filesystem itself may still show its previous size.
This is expected when lvextend is run without its filesystem-resizing option.
Step 12: Extend the ext4 filesystem without unmounting.
For the ext4 filesystem, execute:
sudo resize2fs /dev/system/log
This is the second essential command.
resize2fs expands or resizes ext2, ext3 and ext4 filesystems.
/dev/system/log specifies the logical volume containing the filesystem.
No explicit size is given, so resize2fs expands the filesystem to occupy the available device capacity.
On a supported modern Linux kernel, ext4 supports online expansion while mounted.
The official resize2fs(8) manual explicitly confirms that mounted ext4 filesystems can be expanded online.
Linux manual page
Step 13: Examine the filesystem expansion output.
An illustrative successful output might be:
resize2fs 1.46.5
Filesystem at /dev/system/log is mounted on /var/log; on-line resizing required
The filesystem on /dev/system/log is now 77824 (4k) blocks long.
The version, block count and other details will vary.
The critical points are that online resizing is performed and the command completes successfully.
Immediately check the command's exit status:
echo $?
Expected:
0
If resize2fs reports an error, diagnose it rather than running lvextend again. The logical volume may already have been extended successfully, and a second lvextend would request additional capacity beyond the task's requirement.
Step 14: Verify the new filesystem capacity.
Execute:
df -hT /var/log
The filesystem's total size should now reflect the extended logical volume.
To inspect the size using MiB units:
df -BM /var/log
Compare the result against the initial measurement taken before performing the extension.
There may be a small difference between logical volume capacity and usable filesystem space because the filesystem maintains its own metadata and reserved structures.
Step 15: Verify that /var/log remains mounted.
Execute:
findmnt --mountpoint /var/log
The command should identify the same filesystem mounted at:
/var/log
You can also execute:
mount | grep ' on /var/log '
The task states:
Without unmounting the LVM-backed filesystem mounted at /var/log
Therefore, do not execute:
sudo umount /var/log
Unnecessary unmounting could interrupt running services and would violate the task.
Step 16: Verify the filesystem remains accessible.
Execute:
ls -ld /var/log
Then:
sudo ls -la /var/log
Confirm that the directory and its existing log files remain accessible.
There is no requirement to delete logs, format the filesystem, or recreate the mount.
Do not execute commands such as:
sudo mkfs.ext4 /dev/system/log
That command creates a new filesystem and would risk destroying existing data.
The task requires expanding the current filesystem, not recreating it.
Step 17: Alternative method using automatic filesystem expansion.
LVM also provides the option:
sudo lvextend -r -L +0.2G /dev/system/log
The -r or --resizefs option requests that the filesystem be resized along with the logical volume.
This can simplify the procedure when the installed LVM filesystem tooling supports the mounted filesystem's online expansion.
The official LVM documentation describes --resizefs as resizing the underlying filesystem together with the logical volume.
Linux manual page
However, do not execute this alternative after already running the two-command solution. Doing so would request another 0.2 GiB increase.
For this question, the explicit two-command procedure is preferable because each stage can be inspected separately:
sudo lvextend -L +0.2G /dev/system/log
sudo resize2fs /dev/system/log
Step 18: Confirm that no unnecessary storage changes were made.
The task does not require:
Creating a new logical volume.
Adding a physical disk.
Creating another volume group.
Modifying unrelated logical volumes.
Unmounting /var/log.
Reformatting the filesystem.
Rebooting the server.
Avoid commands such as:
sudo lvcreate
sudo vgcreate
sudo mkfs.ext4
sudo umount /var/log
These operations are not needed for the requested online expansion.
Step 19: Perform final verification.
Execute:
sudo lvs /dev/system/log
df -hT /var/log
findmnt --mountpoint /var/log
The completed task must satisfy the following:
Requirement
Expected result
Correct host
lfcs00093
Volume group
system
Logical volume
log
Mountpoint
/var/log
Requested increase
Approximately 0.2 GiB
Logical volume extended
Yes
Filesystem expanded
Yes
Filesystem unmounted
No
Existing data preserved
Yes
Filesystem accessible
Yes
Final Solution
The essential command sequence for the ext4 filesystem is:
# Connect to the designated server
ssh lfcs00093
# Verify the filesystem mount
findmnt --mountpoint /var/log
# Record the current filesystem size
df -hT /var/log
# Inspect the volume group and logical volume
sudo vgs system
sudo lvs /dev/system/log
# Confirm the filesystem is ext4
findmnt -no FSTYPE --mountpoint /var/log
# Extend the logical volume by 0.2G
sudo lvextend -L +0.2G /dev/system/log
# Expand the ext4 filesystem online
sudo resize2fs /dev/system/log
# Verify the new logical volume size
sudo lvs /dev/system/log
# Verify filesystem expansion
df -hT /var/log
# Confirm the filesystem remains mounted
findmnt --mountpoint /var/log
Technical Verification and References
The solution has been checked against the relevant official Linux storage manuals:
LVM lvextend(8)
— Documents relative logical volume expansion using the + prefix and the optional filesystem-resizing feature.
Linux resize2fs(8)
— Documents online ext4 filesystem expansion.
Linux xfs_growfs(8)
— Documents the corresponding online expansion utility for XFS.
Video review: The demonstrated procedure uses lvextend to increase the logical volume and resize2fs to grow the filesystem. That is the correct operational sequence for a mounted ext4 filesystem. The commands should be considered successfully verified on the target host only after their exit statuses, updated capacity and mounted state are checked.
Expected result: The existing LVM-backed filesystem at /var/log has approximately 0.2 GiB of additional capacity allocated from the system volume group. The filesystem is expanded online and remains mounted and accessible throughout the operation.
next batch now
Worked for 3m 42s
Task
First, configure the NFS server to allow access to /srv/backup for host lfcs00098nfs1 to store backups.
You must include the insecure option.
Next, configure the NFS server to allow access to /srv/backup for host lfcs00098nfs2 to restore backups only.
You must include the insecure option.
See the complete solution in Explanation.
Objective: Configure the Linux NFS (Network File System) server so that two specified client hosts can access the same backup directory with different permissions.
The required configuration is:
NFS client
Required access
Export options
lfcs00098nfs1
Read and write (store backups)
rw,sync,insecure
lfcs00098nfs2
Read-only (restore backups)
ro,sync,insecure
The essential distinction is that the first client must be able to create and modify backup files, while the second client must be restricted to reading existing backup data.
The task explicitly requires the insecure option for both client hosts.
Linux NFS uses /etc/exports to configure which directories are shared, which hosts can access them, and which permissions apply.
Step 1: Connect to the correct Linux server.
The video specifies that this task must be completed on host lfcs00098.
From the candidate terminal, execute:
ssh lfcs00098
This establishes an SSH connection to the designated NFS server.
All NFS export configuration changes must be performed on this server, not on the client hosts.
Step 2: Verify that the NFS server software is installed.
On the Ubuntu environment shown in the video, the NFS server package is normally:
nfs-kernel-server
Check whether the package is installed:
dpkg -l nfs-kernel-server
You can also inspect the service:
systemctl status nfs-kernel-server
If the package is installed and the service is running, continue.
The task is to configure an existing NFS server, so do not reinstall packages unnecessarily.
Step 3: Verify that the backup directory exists.
The task specifies the NFS export directory:
/srv/backup
Execute:
ls -ld /srv/backup
This displays the directory's permissions, owner and group.
For example:
drwxr-xr-x 2 root root 4096 Oct 12 10:00 /srv/backup
The output above is illustrative.
If the directory does not exist, first establish whether the task environment is incomplete. If it is genuinely necessary to create the specified export point, execute:
sudo mkdir -p /srv/backup
Do not modify existing backup files or directory ownership unless needed for authorized client access.
Step 4: Inspect the existing NFS export configuration.
The primary NFS export configuration file is:
/etc/exports
Display its contents:
sudo cat /etc/exports
You can also inspect the configuration using:
sudo nano /etc/exports
The file defines local directories exported to NFS clients.
The general format is:
/directory client1(options) client2(options)
Each client hostname is immediately followed by its own parenthesized options.
There must be no space between the hostname and the opening parenthesis.
This syntax is explicitly documented in the Linux NFS exports(5) manual.
Step 5: Check the currently active NFS exports.
Execute:
sudo exportfs -v
This lists the currently active exports and their effective options.
Check whether /srv/backup is already exported and whether either required client already has an entry.
If an existing configuration is present, modify it carefully rather than creating overlapping or conflicting export entries.
Step 6: Verify that the NFS client hostnames can be resolved.
The task identifies two clients:
lfcs00098nfs1
lfcs00098nfs2
Check name resolution:
getent hosts lfcs00098nfs1
Then:
getent hosts lfcs00098nfs2
These commands query the operating system's configured hostname-resolution services.
Both hostnames should resolve correctly in the exam environment.
Do not replace these hostnames with invented IP addresses.
NFS export configuration supports hostnames, including single hostnames recognized by the system resolver.
Step 7: Back up the existing NFS exports configuration.
Before making changes, execute:
sudo cp -a /etc/exports /etc/exports.bak
This creates a backup copy while preserving file metadata.
It allows recovery if the configuration is accidentally modified incorrectly.
Step 8: Edit the /etc/exports file.
Execute:
sudo nano /etc/exports
Alternatively:
sudo vim /etc/exports
Navigate to the end of the file, or locate the existing export for /srv/backup if one is already present.
Step 9: Configure read/write access for the backup-storage client.
The first requirement is:
First, configure the NFS server to allow access to /srv/backup for host lfcs00098nfs1 to store backups.
The corresponding export configuration is:
/srv/backup lfcs00098nfs1(rw,sync,insecure)
/srv/backup
This is the directory that the NFS server makes available to the specified client.
lfcs00098nfs1
This is the only client identified by this entry.
rw — Read/Write
Allows the NFS client to perform both read and write operations, subject to the underlying filesystem permissions.
This is necessary because the client must store backups.
sync — Synchronous Writes
Makes the NFS server acknowledge write requests only after the relevant changes have been committed to stable storage, as defined by the NFS server's write semantics.
This is appropriate for backup data where durability matters.
insecure — Allow Unprivileged Source Ports
Normally, NFS's secure export behavior requires certain client requests to originate from a privileged port below 1024.
The insecure option relaxes this restriction, permitting requests from unprivileged source ports.
The task explicitly requires this option.
The official NFS manual confirms the behavior of rw, sync and insecure.
Step 10: Configure read-only access for the backup-restore client.
The second requirement is:
Next, configure the NFS server to allow access to /srv/backup for host lfcs00098nfs2 to restore backups only.
The corresponding configuration is:
/srv/backup lfcs00098nfs2(ro,sync,insecure)
lfcs00098nfs2
Specifies the second authorized NFS client.
ro — Read Only
Allows the client to read existing backup files but prevents writes through the NFS export.
This matches the requirement to restore backups only.
sync
Specifies synchronous server behavior. It is safe to include this option even though the export is read-only.
insecure
Allows requests from unprivileged client source ports, as explicitly requested.
The most important difference between the two client definitions is:
lfcs00098nfs1(rw,sync,insecure)
lfcs00098nfs2(ro,sync,insecure)
The second client must not be given rw access.
Step 11: Add the complete NFS export configuration.
The preferred combined entry in /etc/exports is:
/srv/backup lfcs00098nfs1(rw,sync,insecure) lfcs00098nfs2(ro,sync,insecure)
This single line defines the same exported directory with separate permissions for the two clients.
The configuration can also be expressed as two client-specific entries, provided the resulting export table is valid and does not contain conflicting definitions.
Using one line is concise and follows the official exports(5) syntax for multiple clients sharing an export path.
NFS server export table
Step 12: Save the NFS configuration file.
If using Nano, press Ctrl+O, Enter and Ctrl+X.
If using Vim, press Esc, type :wq, and press Enter.
Verify the saved configuration:
sudo cat /etc/exports
The file must contain:
/srv/backup lfcs00098nfs1(rw,sync,insecure) lfcs00098nfs2(ro,sync,insecure)
Preserve any unrelated exports already present on the system.
Step 13: Apply the NFS export configuration.
Execute:
sudo exportfs -ra
exportfs manages the NFS export table.
-r refreshes the export table from the configuration.
-a applies the operation to all configured exports.
This command reloads export definitions without requiring a complete operating system reboot.
For verbose output, you can execute:
sudo exportfs -rav
Ubuntu's official NFS server documentation and the Linux NFS manual describe using exportfs to apply changes made to /etc/exports.
Step 14: Verify the active NFS export configuration.
Execute:
sudo exportfs -v
The output should show /srv/backup exported to both client hosts.
The effective configuration must include the following permissions:
Client
Required effective access
lfcs00098nfs1
rw,insecure
lfcs00098nfs2
ro,insecure
The command may also display other default export options such as root_squash, wdelay, sec=sys, or no_subtree_check, depending on the installed version and configuration.
Their presence does not necessarily indicate an error.
What matters is that the two specified clients have the correct effective access and the required insecure option.
Step 15: Check the NFS server service.
Execute:
sudo systemctl status nfs-kernel-server
The service should report an active operating state.
For a concise check:
systemctl is-active nfs-kernel-server
Expected:
active
If the service is inactive, inspect the logs:
sudo journalctl -u nfs-kernel-server -n 50 --no-pager
If the service is installed and configured correctly but stopped, start it:
sudo systemctl start nfs-kernel-server
There is ordinarily no need to restart a healthy NFS server merely because export rules changed; exportfs -ra is designed to refresh the export table.
Step 16: Verify the backup directory permissions.
Execute:
ls -ld /srv/backup
NFS export permissions and Unix filesystem permissions are separate controls.
Even if lfcs00098nfs1 has an export configured with rw, its application user must also have the necessary filesystem permissions to write to the directory.
Likewise, ro at the export level prevents NFS writes from lfcs00098nfs2, regardless of permissive underlying file permissions.
Do not automatically execute:
sudo chmod 777 /srv/backup
This would unnecessarily grant broad filesystem access.
Also avoid adding:
no_root_squash
unless explicitly required.
The task does not request disabling NFS root squashing, and doing so could expose unnecessary privileges to clients.
Step 17: Verify NFS access from the backup-storage client.
If the client is accessible, connect to:
ssh lfcs00098nfs1
Create a temporary mountpoint:
sudo mkdir -p /mnt/lfcs-backup-test
Mount the NFS export, using the actual NFS server hostname and a protocol version supported by the server:
sudo mount -t nfs lfcs00098:/srv/backup /mnt/lfcs-backup-test
Verify the mount:
findmnt /mnt/lfcs-backup-test
Using a client identity authorized to write to the backup directory, test file creation:
touch /mnt/lfcs-backup-test/lfcs-write-test
If the directory permissions permit this identity to write, the command should succeed.
This tests the read/write access requested for lfcs00098nfs1.
Root access from the client may be mapped to an unprivileged user because of NFS root squashing, so a failure when using root does not automatically mean that the export is configured incorrectly.
Step 18: Verify read-only access from the restore client.
Connect to:
ssh lfcs00098nfs2
Create a mountpoint if necessary:
sudo mkdir -p /mnt/lfcs-backup-test
Mount the export:
sudo mount -t nfs lfcs00098:/srv/backup /mnt/lfcs-backup-test
Verify that backup files can be listed and read:
ls -la /mnt/lfcs-backup-test
Where a readable file is available, open or inspect it using a suitable command.
Next, attempt to create a temporary file:
touch /mnt/lfcs-backup-test/lfcs-readonly-test
This operation must fail because the export is read-only.
An illustrative error is:
Read-only file system
Even if the error wording differs, the important result is that write access is denied by the server.
Step 19: Clean up any test resources.
On the writing client, remove only the temporary verification file you created:
rm -f /mnt/lfcs-backup-test/lfcs-write-test
Unmount the temporary client mount:
sudo umount /mnt/lfcs-backup-test
Repeat the unmount on the other client.
Do not delete or alter actual backup files.
Step 20: Perform final verification on the NFS server.
Reconnect to the NFS server:
ssh lfcs00098
Verify the persistent configuration:
sudo grep '/srv/backup' /etc/exports
Expected:
/srv/backup lfcs00098nfs1(rw,sync,insecure) lfcs00098nfs2(ro,sync,insecure)
Verify the active exports:
sudo exportfs -v
Confirm NFS service health:
systemctl is-active nfs-kernel-server
The final state must satisfy every requirement.
Requirement
Expected result
Exported directory
/srv/backup
Backup-storage client
lfcs00098nfs1
Backup-storage access
Read/write
Backup-restore client
lfcs00098nfs2
Backup-restore access
Read-only
insecure for first client
Present
insecure for second client
Present
Active exports
Correctly refreshed
NFS service
Active
Final Solution
The essential server-side commands are:
# Connect to the NFS server
ssh lfcs00098
# Check the export directory
ls -ld /srv/backup
# Examine existing exports
sudo cat /etc/exports
sudo exportfs -v
# Back up the configuration
sudo cp -a /etc/exports /etc/exports.bak
# Edit the exports file
sudo nano /etc/exports
Add or update the /srv/backup entry to read:
/srv/backup lfcs00098nfs1(rw,sync,insecure) lfcs00098nfs2(ro,sync,insecure)
Save and execute:
# Apply changes
sudo exportfs -ra
# Verify active exports
sudo exportfs -v
# Confirm NFS service status
systemctl is-active nfs-kernel-server
# Verify persistent configuration
sudo grep '/srv/backup' /etc/exports
Technical Verification and References
The solution has been checked against the official Linux NFS manuals and Ubuntu Server documentation.
Linux NFS exports(5) — Defines the export configuration syntax, rw, ro, sync and insecure options.
Ubuntu Server — Network File System (NFS) — Documents the NFS server configuration and export-management procedure.
Linux exportfs(8) — Documents reloading, managing and displaying active exports.
Video verification finding: Task 10 identifies the NFS server lfcs00098 and requires separate access modes for lfcs00098nfs1 and lfcs00098nfs2. The essential answer is the NFS export configuration above. Actual client access must be tested on the relevant systems; correct syntax alone does not establish that network connectivity and filesystem permissions are functioning.
Expected result: The NFS server exports /srv/backup to lfcs00098nfs1 with read/write access and to lfcs00098nfs2 with read-only access. Both client configurations explicitly include insecure, and the settings remain persistent in /etc/exports.
Task
Persistently configure the OpenSSH daemon to allow keyboard-interactive authentication for user jack.
Do not modify the user's password.
Do not modify any other user's ability to log in.
See the complete solution in Explanation.
Step 1: Connect to the correct Linux server.
The video specifies that this task must be performed on host lfcs00073.
From the candidate terminal, execute:
ssh candidate@lfcs00073
This establishes an SSH connection to the designated Linux server.
All subsequent configuration changes must be performed on this host.
Step 2: Verify that user jack exists.
Execute:
id jack
This displays the user's UID, primary group and supplementary groups.
An example of valid output is:
uid=1001(jack) gid=1001(jack) groups=1001(jack)
The numerical IDs may differ.
You can also verify the account through the system user database:
getent passwd jack
The task requires modifying SSH authentication, not creating or modifying the user account.
Do not execute passwd jack or change the user's existing password.
Step 3: Identify the OpenSSH daemon configuration file.
The primary OpenSSH server configuration file on Ubuntu is:
/etc/ssh/sshd_config
Additionally, OpenSSH may load configuration fragments from:
/etc/ssh/sshd_config.d/
Inspect the primary configuration file:
sudo cat /etc/ssh/sshd_config
Check whether additional configuration files exist:
sudo ls -la /etc/ssh/sshd_config.d/
The effective OpenSSH configuration may depend on directives in both locations.
Step 4: Identify the existing authentication settings.
Execute:
sudo grep -RniE \
'KbdInteractiveAuthentication|ChallengeResponseAuthentication|UsePAM|AuthenticationMethods|Match' \
/etc/ssh/sshd_config /etc/ssh/sshd_config.d/ 2 > /dev/null
This searches for authentication-related directives.
The most important directive is:
KbdInteractiveAuthentication
It controls whether the SSH daemon permits keyboard-interactive authentication.
Possible values:
Configuration
Meaning
KbdInteractiveAuthentication yes
Permits keyboard-interactive authentication
KbdInteractiveAuthentication no
Disables keyboard-interactive authentication
On Ubuntu 22.04, the packaged OpenSSH configuration commonly disables keyboard-interactive authentication globally while enabling PAM.
OpenSSH daemon configuration file
However, the task requires the method to be enabled specifically for jack, without changing other users' login ability.
Therefore, simply changing the global directive from no to yes is not the appropriate solution.
Step 5: Examine the effective configuration before changing anything.
Execute:
sudo sshd -T \
-C user=jack,host=localhost,addr=127.0.0.1
This displays the effective SSH daemon configuration for a connection matching user jack.
To filter the relevant settings:
sudo sshd -T \
-C user=jack,host=localhost,addr=127.0.0.1 \
| grep -E 'kbdinteractiveauthentication|usepam|authenticationmethods'
For example, an initial configuration might show:
kbdinteractiveauthentication no
usepam yes
authenticationmethods any
This is an illustrative output. The actual values must be checked on the server.
Also record the same settings for another existing user, such as candidate:
sudo sshd -T \
-C user=candidate,host=localhost,addr=127.0.0.1 \
| grep -E 'kbdinteractiveauthentication|usepam|authenticationmethods'
These baseline values will be useful when verifying that other users remain unaffected.
Step 6: Back up the existing OpenSSH configuration.
Before modifying the daemon configuration, execute:
sudo cp -a /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
cp copies the configuration file.
-a preserves ownership, permissions and other file metadata.
/etc/ssh/sshd_config.bak is the backup copy.
If a configuration error occurs, the original file can be restored.
Keep the existing SSH session open while making these changes.
Step 7: Edit the OpenSSH daemon configuration.
Open the configuration file:
sudo nano /etc/ssh/sshd_config
Alternatively, use Vim:
sudo vim /etc/ssh/sshd_config
Review any existing Match directives before adding the required configuration.
Step 8: Configure keyboard-interactive authentication specifically for jack.
Provided no earlier matching block takes precedence, append the following configuration at the end of /etc/ssh/sshd_config:
Match User jack
KbdInteractiveAuthentication yes
This is the central configuration required for the task.
Match User jack
The Match directive begins a conditional configuration section.
The User jack condition means that the directives inside this section apply to connections authenticating as jack.
KbdInteractiveAuthentication yes
This enables keyboard-interactive authentication for connections satisfying the preceding Match condition.
Other users do not match User jack, so they retain their existing global or user-specific settings.
OpenSSH's official documentation permits KbdInteractiveAuthentication inside a Match section.
OpenSSH daemon configuration file
Important: If the existing configuration already contains a matching Match User jack or Match All block setting this option, edit the appropriate existing rule instead. OpenSSH generally uses the first occurrence of a directive among satisfied Match blocks. Simply appending a later block may not override an earlier matching rule.
Step 9: Save the configuration file.
If using Nano:
Press Ctrl + O to save.
Press Enter to confirm.
Press Ctrl + X to exit.
If using Vim, press Esc, type :wq, and press Enter.
The modified file should contain the user-specific rule:
Match User jack
KbdInteractiveAuthentication yes
Do not add a global AllowUsers jack rule. That could prevent other users from logging in and would violate the task.
Step 10: Verify the PAM authentication setting.
Execute:
sudo sshd -T \
-C user=jack,host=localhost,addr=127.0.0.1 \
| grep usepam
For the normal Ubuntu PAM-based authentication setup, the expected configuration is:
usepam yes
UsePAM yes allows OpenSSH to use PAM for keyboard-interactive authentication.
On Ubuntu, this directive normally appears in the global configuration.
Do not place UsePAM inside the Match User jack block. It is not a valid Match-specific directive in the relevant OpenSSH configuration.
If PAM is globally disabled, investigate the existing authentication design before changing it. Enabling PAM globally could affect other users, contrary to the task's constraints.
Step 11: Validate the SSH configuration syntax.
Before reloading the daemon, execute:
sudo sshd -t
sshd is the OpenSSH server daemon.
-t validates the configuration and checks relevant server key requirements.
A successful validation normally produces no output and returns exit code 0.
Check the result:
echo $?
Expected:
0
If errors are displayed, correct them before proceeding.
Do not restart or reload SSH with an invalid configuration.
Step 12: Verify that keyboard-interactive authentication is enabled for jack.
Execute:
sudo sshd -T \
-C user=jack,host=localhost,addr=127.0.0.1 \
| grep kbdinteractiveauthentication
Expected output:
kbdinteractiveauthentication yes
This confirms the effective server configuration for the specified user and connection context.
Unlike simply inspecting the configuration file, sshd -T -C evaluates applicable Match rules.
OpenSSH daemon
Step 13: Confirm that other users' authentication settings have not changed.
Execute:
sudo sshd -T \
-C user=candidate,host=localhost,addr=127.0.0.1 \
| grep -E 'kbdinteractiveauthentication|usepam|authenticationmethods'
Compare the output with the baseline recorded in Step 5.
If the original configuration had keyboard-interactive authentication disabled for candidate, it should remain disabled.
For example:
kbdinteractiveauthentication no
usepam yes
authenticationmethods any
The important requirement is that other users retain their original effective authentication settings, not that every server necessarily produces these example values.
Also verify any existing AuthenticationMethods policy. If it requires a method sequence that excludes standalone keyboard-interactive authentication, simply enabling KbdInteractiveAuthentication may not permit a keyboard-interactive-only login. Any necessary adjustment must remain specific to jack.
Step 14: Reload the OpenSSH daemon.
After verifying the configuration, execute:
sudo systemctl reload ssh
On Ubuntu, the systemd service is normally named ssh.
Reloading causes the daemon to apply its updated configuration without unnecessarily terminating established SSH sessions.
Step 15: Verify the SSH service is operational.
Execute:
sudo systemctl status ssh --no-pager
Expected active status:
Active: active (running)
You can also execute:
systemctl is-active ssh
Expected:
active
Step 16: Test keyboard-interactive authentication for jack.
From a separate SSH session, execute:
ssh -o PreferredAuthentications=keyboard-interactive \
-o PubkeyAuthentication=no \
-o PasswordAuthentication=no \
jack@localhost
PreferredAuthentications=keyboard-interactive selects keyboard-interactive authentication.
PubkeyAuthentication=no prevents the client from authenticating using a public key.
PasswordAuthentication=no disables the separate SSH password authentication method, without disabling keyboard-interactive prompts.
jack@localhost attempts to connect as user jack.
If PAM supports the account and the user supplies the correct existing credentials, the server should permit keyboard-interactive authentication.
If the server uses a multi-factor AuthenticationMethods policy, adapt the test to that policy and confirm keyboard-interactive authentication is offered at the appropriate stage.
Do not modify jack's password to perform the test.
Step 17: Perform final configuration checks.
Execute:
sudo sshd -t
Verify the setting for jack:
sudo sshd -T \
-C user=jack,host=localhost,addr=127.0.0.1 \
| grep kbdinteractiveauthentication
Expected:
kbdinteractiveauthentication yes
Verify another user's setting:
sudo sshd -T \
-C user=candidate,host=localhost,addr=127.0.0.1 \
| grep kbdinteractiveauthentication
The value must remain consistent with that user's original configuration.
Finally:
systemctl is-active ssh
Expected:
active
Final Solution
1. Connect to the correct host.
ssh candidate@lfcs00073
2. Back up the SSH configuration.
sudo cp -a /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
3. Edit the configuration file.
sudo nano /etc/ssh/sshd_config
4. Add the required configuration at the appropriate location, after checking existing Match rules.
Match User jack
KbdInteractiveAuthentication yes
5. Validate the SSH configuration.
sudo sshd -t
6. Verify the effective setting for jack.
sudo sshd -T \
-C user=jack,host=localhost,addr=127.0.0.1 \
| grep kbdinteractiveauthentication
Expected:
kbdinteractiveauthentication yes
7. Reload the SSH daemon.
sudo systemctl reload ssh
8. Confirm that SSH remains active.
systemctl is-active ssh
Expected:
active
Technical Verification and References
The solution has been checked against the official OpenSSH documentation for Ubuntu.
Match User applies specified configuration directives to connections matching a particular username.
KbdInteractiveAuthentication controls whether keyboard-interactive authentication is permitted.
UsePAM enables PAM integration used for keyboard-interactive authentication on typical Ubuntu systems.
sshd -t validates server configuration syntax.
sshd -T -C evaluates effective configuration settings for a particular connection, including applicable Match sections.
Official references:
Ubuntu OpenSSH sshd_config(5)
Ubuntu OpenSSH sshd(8)
OpenSSH Configuration Reference
Expected result: Keyboard-interactive authentication is persistently permitted for user jack, without changing the user's password or altering other users' existing login settings. Successful end-to-end authentication must also be confirmed with a valid login test.
Context
You are asked to organize existing SSL certificates in the filesystem.
Task
Identify the subject CN of the SSL certificate in the directory ~/relaxed-llama/ssl and move the certificate file into the corresponding subdirectory.
The sub-directory for the subject CN has already been created.
See the complete solution in Explanation.
Step 1: Connect to the correct server.
The video specifies that this task must be completed on host lfcs00094.
From the candidate terminal, execute:
ssh lfcs00094
This establishes an SSH connection to the designated Linux server.
All subsequent commands must be executed on this host.
Step 2: Navigate to the SSL certificate directory.
Execute:
cd ~/relaxed-llama/ssl
- cd changes the current working directory.
- ~ represents the current user's home directory.
- relaxed-llama/ssl is the directory specified in the task.
Verify the current directory:
pwd
Then list the contents:
ls -la
The directory should contain an SSL certificate file and existing subdirectories corresponding to certificate common names.
Step 3: Identify the SSL certificate file.
Execute:
find . -maxdepth 1 -type f -print
- find . searches from the current directory.
- -maxdepth 1 restricts the search to the current directory.
- -type f identifies regular files.
- -print displays their paths.
An SSL certificate commonly uses an extension such as .crt, .pem, or .cer, although other filenames are possible.
For example, a directory might contain:
/server.crt
/alpha.example.com/
/bravo.example.com/
/charlie.example.com/
These are illustrative filenames, not confirmed contents of the exam server.
Identify the actual certificate filename before continuing.
Step 4: Examine the SSL certificate using OpenSSL.
Once you have identified the certificate, run:
openssl x509 -in CERTIFICATE_FILENAME -noout -subject
Replace CERTIFICATE_FILENAME with the real filename.
For example, if the file is named server.crt:
openssl x509 -in server.crt -noout -subject
- openssl invokes the OpenSSL utility.
- x509 processes an X.509 certificate.
- -in server.crt specifies the certificate file.
- -noout suppresses the encoded certificate output.
- -subject displays the certificate's subject distinguished name.
An illustrative result is:
subject=C = US, ST = California, O = Example Corp, CN = bravo.example.com
The important field is:
CN = bravo.example.com
CN stands for Common Name, an attribute of the certificate's subject.
The actual value must come from the certificate on the designated host.
Step 5: Display the subject CN clearly.
For easier identification, execute:
openssl x509 -in CERTIFICATE_FILENAME \
-noout -subject -nameopt sep_multiline
This prints the subject attributes on separate lines.
Example:
subject=
countryName = US
stateOrProvinceName = California
organizationName = Example Corp
commonName = bravo.example.com
The commonName value is the information required to select the correct destination subdirectory.
Do not confuse the certificate's subject CN with its issuer CN or the Subject Alternative Name extension. The task specifically asks for the subject CN.
Step 6: Locate the matching subdirectory.
List the existing directories:
find . -maxdepth 1 -type d -print
If the certificate's subject CN is bravo.example.com, its matching destination should be:
~/relaxed-llama/ssl/bravo.example.com/
Verify that the matching directory exists:
ls -ld ~/relaxed-llama/ssl/bravo.example.com
Again, bravo.example.com is an example. Substitute the actual CN reported by OpenSSL.
The task states that the subdirectory has already been created.
Therefore, do not create a new directory unless you have established that the supplied environment differs from the task statement.
Step 7: Move the certificate into the correct subdirectory.
The Linux command for moving a file is mv.
Its basic syntax is:
mv SOURCE_FILE DESTINATION_DIRECTORY/
For example, if:
- Certificate filename: server.crt
- Subject CN: bravo.example.com
The command would be:
mv server.crt bravo.example.com/
This moves the certificate from:
~/relaxed-llama/ssl/server.crt
to:
~/relaxed-llama/ssl/bravo.example.com/server.crt
The original filename is preserved.
Before moving the actual file, ensure that the destination does not already contain a different file with the same name. You can use mv -i to request confirmation before overwriting an existing destination.
Do not copy the certificate using cp, because the task specifically requires moving it.
Step 8: Verify that the certificate was moved successfully.
Execute:
ls -l bravo.example.com/
The output should show the certificate inside the directory matching its CN.
Verify that the certificate no longer exists in the original location:
ls -l server.crt
For the illustrative filename, the expected response is:
ls: cannot access 'server.crt': No such file or directory
This indicates the original path no longer contains the file.
Step 9: Verify that the moved certificate is readable and unchanged.
Execute:
openssl x509 \
-in bravo.example.com/server.crt \
-noout -subject
The certificate's subject CN should be identical to the value obtained before the move.
For example:
subject=C = US, ST = California, O = Example Corp, CN = bravo.example.com
This confirms that the certificate is still readable and is located inside the corresponding CN directory.
Step 10: Perform the final directory verification.
Execute:
find ~/relaxed-llama/ssl -maxdepth 2 -type f -print
Confirm that the certificate appears at the expected destination.
The final directory structure should resemble:
~/relaxed-llama/ssl/
├── alpha.example.com/
├── bravo.example.com/
│ └── server.crt
└── charlie.example.com/
This directory structure is illustrative. The actual destination must match the CN obtained from the real certificate.
Final Solution
The essential command sequence is:
1. Navigate to the directory.
cd ~/relaxed-llama/ssl
2. List the files and directories.
ls -la
3. Identify the certificate's subject CN.
openssl x509 -in CERTIFICATE_FILENAME \
-noout -subject -nameopt sep_multiline
4. Move the certificate into its matching existing CN directory.
mv CERTIFICATE_FILENAME CN_DIRECTORY/
5. Verify the destination.
ls -l CN_DIRECTORY/
6. Confirm the certificate's subject again.
openssl x509 -in CN_DIRECTORY/CERTIFICATE_FILENAME \
-noout -subject
Replace CERTIFICATE_FILENAME and CN_DIRECTORY with the actual values discovered on the server.
Technical Verification and References
The solution is based on the officially documented behavior of OpenSSL and the GNU/Linux mv command.
- OpenSSL X.509: The -subject option displays the certificate subject; -noout suppresses certificate output; and -nameopt controls the format of the subject information.
OpenSSL Documentation
- GNU Coreutils: The mv command moves a file into an existing target directory while preserving its filename unless a new filename is explicitly supplied.
Official documentation: OpenSSL X.509 Certificate Command Reference.
Expected result: The existing SSL certificate is moved into the already-created subdirectory whose name matches the certificate's subject CN.
Important: The video reveals the task requirements but does not establish the actual certificate filename or subject CN from the target server. Therefore, assigning a particular destination without inspecting the certificate would be an unverified guess. The procedure above determines the correct destination directly from the certificate.
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.
You've reached the limit of preview questions.
Register now to access more real Linux Foundation LFCS exam questions for free!
TESTED 02 Dec 2026