Linux+ Linux+ Filesystem and Storage Management 2 — Questions and Answers
Question 1: Which command displays the UUID of all block devices on a Linux system?
- lsblk -f
- blkid (Correct answer)
- fdisk -l
- df -h
Correct answer: blkid
blkid queries and displays block device attributes including UUID, filesystem type, and label.
Question 2: A system administrator needs to non-destructively check an unmounted ext4 filesystem for errors. Which command is correct?
- fsck.ext4 -n /dev/sdb1 (Correct answer)
- e2fsck -y /dev/sdb1
- tune2fs -c /dev/sdb1
- mkfs.ext4 -c /dev/sdb1
Correct answer: fsck.ext4 -n /dev/sdb1
fsck.ext4 -n runs in no-write (read-only) mode, reporting errors without making any repairs.
Question 3: What is the purpose of the /etc/fstab 'dump' field (fifth column)?
- Sets mount priority order
- Controls whether dump utility backs up the filesystem (Correct answer)
- Specifies the number of fsck passes
- Defines mount timeout in seconds
Correct answer: Controls whether dump utility backs up the filesystem
The fifth field in /etc/fstab controls whether the legacy dump utility should back up the filesystem (1=yes, 0=no).
Question 4: Which LVM command resizes a logical volume AND its underlying ext4 filesystem simultaneously?
- lvextend -L +5G /dev/vg0/lv0
- resize2fs /dev/vg0/lv0
- lvresize -r -L +5G /dev/vg0/lv0 (Correct answer)
- lvchange -L +5G /dev/vg0/lv0
Correct answer: lvresize -r -L +5G /dev/vg0/lv0
lvresize -r (or lvextend -r) uses the -r flag to resize the filesystem automatically after resizing the logical volume.
Question 5: A tmpfs filesystem is mounted with 'size=512m'. What happens when processes try to write more than 512MB?
- Data is silently dropped
- The write fails with ENOSPC (Correct answer)
- Data spills to swap space
- The size limit auto-expands
Correct answer: The write fails with ENOSPC
When tmpfs reaches its size limit, writes fail with ENOSPC (no space left on device), just like any other full filesystem.
Question 6: Which command would show the inode usage statistics for all mounted filesystems?
- df -h
- df -i (Correct answer)
- du -i
- stat -f /
Correct answer: df -i
df -i displays inode usage (total, used, free, and percentage) for each mounted filesystem.
Question 7: An NFS mount in /etc/fstab uses the 'soft' option. What behavior does this enable?
- Mounts the share read-only
- Returns an error after timeout instead of hanging indefinitely (Correct answer)
- Caches writes locally before sending to server
- Compresses data over the network
Correct answer: Returns an error after timeout instead of hanging indefinitely
The soft NFS mount option causes I/O operations to return an error after a timeout, preventing processes from hanging if the server is unreachable.
Which command displays the UUID of all block devices on a Linux system?