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
Context
You are asked to install a GNU software package from source code.
Task
First, configure the software package at ~/bool with all default settings.
The software package has been unpacked and all tools required for a configuration have been pre-installed for your convenience.
Next, build the software package at ~/bool.
All tools and dependent libraries required for compilation have been pre-installed for your convenience.
Finally, install the built software package.
See the complete solution in Explanation.
Objective: Configure, compile, and install the GNU software package already extracted into ~/bool, using its default build and installation settings.
The standard GNU build procedure consists of three main commands, executed in this exact order:
/configure
make
sudo make install
The official GNU Autoconf and Automake documentation confirms this sequence for packages using the GNU build system.
Step 1: Connect to the correct Linux server.
The task is associated with host lfcs00102.
From the candidate terminal, execute:
ssh lfcs00102
This establishes an SSH session with the server where the source-code package must be configured, compiled, and installed.
All subsequent commands must be executed on this host.
Step 2: Navigate to the software source directory.
Execute:
cd ~/bool
cd changes the working directory.
~ represents the current user's home directory.
bool is the directory containing the extracted software source code.
Verify the current directory:
pwd
Expected structure:
/home/candidate/bool
The actual home directory depends on the account used on the host.
Step 3: Inspect the extracted source files.
Execute:
ls -la
A GNU Autotools-based source package commonly contains files such as:
configure
Makefile.am
Makefile.in
configure.ac
README
INSTALL
src/
These are examples of commonly encountered files; the actual directory contents may differ.
The critical file for the first stage is:
configure
The task explicitly states that the package has already been unpacked and the required development tools are installed.
Therefore, there is no need to download another source archive, extract additional files, or install development packages.
Step 4: Verify that the configuration script exists.
Execute:
ls -l ./configure
Then check whether it is executable:
test -x ./configure
echo $?
Expected exit code:
0
If the file is readable but lacks execution permission, you can inspect its permissions:
stat -c '%A %a %n' ./configure
Before changing permissions, confirm that the file is the actual generated configuration script.
If necessary, a readable configure shell script can also be executed with:
sh ./configure
However, the normal and preferred invocation for this task is ./configure.
Step 5: Configure the software package using all default settings.
Execute:
/configure
This is the first essential command.
The configure script examines the system and prepares the source tree for compilation.
Typical checks include:
Operating system and processor architecture.
Available C compiler.
Compiler capabilities and flags.
Required libraries and header files.
Build utilities and dependencies.
Installation directory configuration.
Generation of Makefiles.
An illustrative output might include:
checking for gcc... gcc
checking whether the C compiler works... yes
checking for stdio.h... yes
checking for stdlib.h... yes
checking for make... make
configure: creating ./config.status
config.status: creating Makefile
The output will differ according to the source package.
Important: The task requires all default settings. Therefore, do not specify configuration arguments such as:
/configure --prefix=/opt/bool
or:
/configure --disable-shared
unless explicitly requested.
Using plain ./configure ensures that the package's own default configuration options are selected.
GNU Autoconf documents that the default installation prefix is commonly /usr/local, although packages can choose another default.
Step 6: Verify that configuration completed successfully.
Immediately after ./configure finishes, execute:
echo $?
Expected:
0
Exit status 0 indicates that the configuration script completed successfully.
Next, verify the generated Makefile:
ls -l Makefile
You can also check for the configuration status file:
ls -l config.status
For a standard Autoconf package, these files indicate that configuration generated the instructions required for compilation.
If configuration reports a missing dependency or another error, investigate that specific error before proceeding to the build stage.
Do not assume that configuration succeeded merely because some files were generated.
Step 7: Inspect the generated Makefile.
Execute:
ls -lh Makefile
The Makefile contains the instructions that GNU Make uses to build and install the software.
You can inspect the default installation prefix:
grep -E '^prefix[[:space:]]*=' Makefile
A typical result is:
prefix = /usr/local
This means that the package is configured to install files under /usr/local, unless it defines different destinations.
Common GNU installation directories include:
Directory
Typical purpose
/usr/local/bin
User executables
/usr/local/sbin
Administration executables
/usr/local/lib
Program libraries
/usr/local/include
Header files
/usr/local/share
Architecture-independent data
Do not modify the installation prefix because the task requires the default settings.
Step 8: Build the software package.
Execute the second essential command:
make
This instructs GNU Make to build the software using the generated Makefile.
During compilation, Make may perform operations such as:
Reading the Makefile.
Identifying source files and dependencies.
Invoking the compiler.
Compiling source files into object files.
Linking object files with required libraries.
Producing executable programs or library files.
For a package written in C, an illustrative compilation sequence may look like:
gcc -DHAVE_CONFIG_H -I. -c main.c -o main.o
gcc -DHAVE_CONFIG_H -I. -c util.c -o util.o
gcc -o program main.o util.o
These commands are examples. The actual compilation operations depend on the package.
GNU Make normally builds the default target when invoked without arguments. For standard GNU packages, this is equivalent to the all target.
Step 9: Understand why make should normally run without sudo.
The recommended command is:
make
Not:
sudo make
Building as the normal user is preferable because it avoids creating root-owned intermediate files inside the source directory.
Administrative privileges are generally necessary only when installing files into protected system directories.
Since the task states that all build dependencies are already installed, the compilation should not require additional package installation.
Step 10: Verify that compilation completed successfully.
Immediately after make finishes, execute:
echo $?
Expected output:
0
This confirms that the Make process returned a successful exit status.
If compilation fails, the terminal normally reports an error, such as:
make: *** [Makefile:150: all] Error 2
Such output indicates a failed build.
Investigate the preceding compiler or linker error before continuing.
Do not attempt to install a package that has not built successfully.
Step 11: Confirm the build target is up to date.
You can run:
make
again after a successful build.
If no source files have changed, Make may display:
make: Nothing to be done for 'all'.
Alternatively, it may run a small number of checks or other build commands.
This is expected behavior: Make determines which targets need rebuilding based on its rules and dependencies.
A second build is optional and does not replace checking the first command's exit status.
Step 12: Run the package tests if supported.
Many GNU software packages provide an optional test target:
make check
This runs tests defined by the package's build system.
The official GNU Automake documentation defines make check as the conventional test-suite target.
However, the task does not explicitly require running tests.
Therefore, this step is optional. Use it only if the package provides the target and running the tests is appropriate.
If tests are run, verify their outcome:
echo $?
Expected successful status:
0
Do not confuse make check with make install. Tests validate a build but do not necessarily install it.
Step 13: Install the compiled software package.
After a successful build, execute:
sudo make install
This is the third essential command.
sudo provides administrative privileges.
make executes the build system's specified target.
install invokes the Makefile's installation rules.
The command installs the compiled software into its configured destinations.
Depending on the package, installation may include:
Copying executable binaries.
Installing shared or static libraries.
Installing header files.
Installing documentation and manual pages.
Installing additional package data.
The installation location follows the settings selected during ./configure.
GNU Automake confirms that make install copies the required built files into their installation directories.
Step 14: Do not change the installation destination.
The task specifically requests the default configuration.
Therefore, avoid commands such as:
sudo make install prefix=/opt/custom
Also avoid reconfiguring the package using:
/configure --prefix=/opt/custom
These would change the normal installation destinations.
The appropriate installation command remains:
sudo make install
Step 15: Verify that installation completed successfully.
Immediately after sudo make install finishes, execute:
echo $?
Expected:
0
A zero exit code indicates that the installation target completed successfully.
If installation fails with a permissions error, verify whether administrative privileges were applied correctly and inspect the affected directory.
If a build or dependency error occurs during installation, resolve that error before treating the task as complete.
Step 16: Verify the installation destination.
Inspect the installation prefix recorded in the Makefile:
grep -E '^prefix[[:space:]]*=' Makefile
If the prefix is /usr/local, the installed files will typically be placed in appropriate directories beneath that prefix.
You can inspect standard executable locations:
ls -lt /usr/local/bin/
And, where appropriate:
ls -lt /usr/local/lib/
These commands can help identify newly installed files, but they are not conclusive on their own because other software may already exist in those directories.
For more precise verification, inspect the package's Makefile installation rules or any installation manifest it produces.
Step 17: Verify the installed executable if applicable.
If the package installs an executable, first determine its actual command name from the package's documentation or installation output.
Then execute:
command -v ACTUAL_EXECUTABLE_NAME
For example, if a package installs an executable called example-program:
command -v example-program
You can then check its version if that option is supported:
example-program --version
These commands are illustrative. The directory name bool does not prove that the installed executable is also named bool.
Do not invent an executable name when validating the installation.
Step 18: Run installation checks if the package supports them.
Some GNU packages provide the following target:
make installcheck
This runs checks against installed software rather than files within the build tree.
GNU Automake documents installcheck as an optional target for validating installed programs and libraries.
It is not mandatory for this question.
The task requires configuration, compilation and installation. A successful sudo make install operation satisfies the installation stage.
Step 19: Understand why the three commands must be executed in order.
Order
Command
Purpose
1
/configure
Detects the build environment and prepares Makefiles using default settings
2
make
Compiles and links the source code
3
sudo make install
Installs the built software into the configured system directories
Each stage depends on the preceding stage.
Running make before a successful configuration might fail because the necessary Makefile has not been generated.
Running make install without a successful build may also fail or cause the installation target to attempt compilation. That does not replace the explicitly required build step.
For the LFCS simulation, execute each required stage separately and verify success before continuing.
Step 20: Perform the final verification.
From the source directory:
cd ~/bool
Check the generated Makefile:
test -f Makefile & & echo "Makefile exists"
Check the configuration status file if the package uses Autoconf:
test -f config.status & & echo "Configuration completed"
Confirm the configured prefix:
grep -E '^prefix[[:space:]]*=' Makefile
Check that the build is up to date:
make
Finally, verify the installed files or executable using the actual package name and installation output.
A successful result must satisfy all requirements:
Requirement
Expected result
Correct host
lfcs00102
Source directory
~/bool
Configure with defaults
Successful
Build package
Successful
Install package
Successful
Custom configure options
None
Source extraction
Already completed
Dependency installation
Already completed
Final Solution
The complete essential command sequence is:
Copy commands
# Connect to the designated host
ssh lfcs00102
# Navigate to the extracted source package
cd ~/bool
# Inspect the source files
ls -la
ls -l ./configure
# Step 1: Configure with default settings
/configure
# Step 2: Build the software package
make
# Step 3: Install the built package
sudo make install
To verify the exit status of each stage reliably, use the following alternative, which stops if a required stage fails:
cd ~/bool || exit 1
/configure & &
make & &
sudo make install
This short sequence is appropriate when the provided tools and dependencies are already available, as specified in the task.
Technical Verification and References
The solution has been validated against the official GNU build-system documentation.
GNU Autoconf Manual — Explains the generated configure script and default configuration settings.
GNU Make Manual — Explains compilation using Makefiles and Make targets.
GNU Automake — Standard Targets — Documents make, make check, make install and make installcheck.
Expected result: The GNU software package located at ~/bool is successfully configured using its default settings, compiled using GNU Make, and installed through its Makefile's installation target.
Verification limitation: The prescribed sequence is supported by official GNU documentation. Whether the commands successfully complete on lfcs00102 must be confirmed from their actual terminal output and exit statuses; the supplied recording does not establish an independently tested successful installation.
TESTED 01 Nov 2026
