LCA Linux System Installation & Configuration 5 — Questions and Answers
Question 1: Which command creates a new ext4 filesystem on /dev/sdb1?
- fdisk -t ext4 /dev/sdb1
- mkfs.ext4 /dev/sdb1 (Correct answer)
- format -t ext4 /dev/sdb1
- mke2fs -j /dev/sdb1
Correct answer: mkfs.ext4 /dev/sdb1
mkfs.ext4 is the standard command to create an ext4 filesystem; it is equivalent to mke2fs -t ext4.
Question 2: A sysadmin needs to add a second disk to an existing LVM volume group. Which sequence is correct?
- vgextend → pvcreate → lvextend
- pvcreate → vgextend → lvextend (Correct answer)
- fdisk → lvextend → vgextend
- vgcreate → pvcreate → lvextend
Correct answer: pvcreate → vgextend → lvextend
You must first initialize the disk as a physical volume (pvcreate), then add it to the volume group (vgextend), then optionally extend logical volumes (lvextend).
Question 3: Which kernel parameter passed at boot disables SELinux for a single session?
- selinux=permissive
- security=none
- selinux=0 (Correct answer)
- enforcing=0
Correct answer: selinux=0
Passing selinux=0 on the kernel command line completely disables SELinux for that boot session without permanently changing the policy configuration.
Question 4: Which configuration file sets the DNS resolver search domain and nameserver addresses on a traditional (non-NetworkManager) Linux system?
- /etc/hosts
- /etc/nsswitch.conf
- /etc/resolv.conf (Correct answer)
- /etc/network/interfaces
Correct answer: /etc/resolv.conf
/etc/resolv.conf contains 'nameserver' and 'search' directives that configure the system's DNS resolver library.
Question 5: What is the purpose of 'dracut' on Red Hat-based systems?
- Configures GRUB bootloader entries
- Generates the initramfs image (Correct answer)
- Installs kernel modules
- Manages systemd unit files
Correct answer: Generates the initramfs image
dracut is the tool used on Red Hat/Fedora systems to build the initramfs (initial RAM filesystem) image that the bootloader passes to the kernel.
Question 6: Which command checks and reports the disk usage of a directory tree in human-readable format?
- df -h /home
- du -sh /home (Correct answer)
- ls -lh /home
- stat /home
Correct answer: du -sh /home
'du -sh /home' summarizes the total disk usage of the /home directory tree in a human-readable format (KB, MB, GB).
Question 7: Which /proc file contains the kernel's command line parameters as passed by the bootloader?
- /proc/version
- /proc/cmdline (Correct answer)
- /proc/bootparams
- /proc/kernel/args
Correct answer: /proc/cmdline
/proc/cmdline contains the exact command line string that the bootloader passed to the kernel at boot time.
Which command creates a new ext4 filesystem on /dev/sdb1?