LCA Linux System Installation & Configuration 4 — Questions and Answers
Question 1: Which command displays all currently mounted filesystems along with their mount options?
- df -h
- mount (Correct answer)
- lsblk -f
- blkid
Correct answer: mount
Running 'mount' with no arguments prints all currently mounted filesystems, their mount points, types, and options.
Question 2: What is the role of the initramfs (initial RAM filesystem) during Linux boot?
- Holds the kernel binary
- Provides a temporary root filesystem to load drivers and mount the real root (Correct answer)
- Stores GRUB configuration
- Manages swap during boot
Correct answer: Provides a temporary root filesystem to load drivers and mount the real root
The initramfs is a compressed cpio archive that provides a minimal temporary root filesystem, allowing the kernel to load necessary drivers before mounting the real root.
Question 3: Which LVM command extends a logical volume AND resizes its ext4 filesystem in one step?
- lvextend -r -L +10G /dev/vg0/lv0 (Correct answer)
- lvresize /dev/vg0/lv0
- lvextend -L +10G /dev/vg0/lv0
- vgextend vg0 /dev/sdb
Correct answer: lvextend -r -L +10G /dev/vg0/lv0
The -r flag with lvextend calls resize2fs automatically after extending the logical volume, handling both the LV and filesystem resize in one command.
Question 4: Which file defines system-wide environment variables applied at login on most Linux distributions?
- /etc/environment (Correct answer)
- /etc/profile.d/env.sh
- /etc/bashrc
- /root/.bash_profile
Correct answer: /etc/environment
/etc/environment is a PAM-read file that sets system-wide environment variables for all sessions regardless of shell.
Question 5: What does the 'UUID=' syntax in /etc/fstab provide compared to using device names like /dev/sda1?
- Faster mount times
- Stable identification that survives disk reordering (Correct answer)
- Enables TRIM on SSDs
- Required for LVM volumes
Correct answer: Stable identification that survives disk reordering
UUIDs uniquely identify filesystems regardless of which /dev/sdX name the kernel assigns, preventing boot failures when disk enumeration order changes.
Question 6: Which command should be run after manually editing /etc/default/grub to apply the changes to the bootloader?
- update-grub or grub2-mkconfig -o /boot/grub2/grub.cfg (Correct answer)
- grub-install /dev/sda
- dracut --regenerate-all
- systemctl daemon-reload
Correct answer: update-grub or grub2-mkconfig -o /boot/grub2/grub.cfg
/etc/default/grub is a template; you must run grub2-mkconfig (or update-grub on Debian-based systems) to regenerate the actual grub.cfg from it.
Question 7: What is the minimum number of disks required to create a RAID 5 array?
- 2
- 3 (Correct answer)
- 4
- 5
Correct answer: 3
RAID 5 requires at least 3 disks: it stripes data with distributed parity across all disks, tolerating a single disk failure.
Which command displays all currently mounted filesystems along with their mount options?