RHCSA RHCSA Filesystem and Mount Configuration 2 — Questions and Answers
Question 1: Which command displays the UUID of all block devices on a RHEL system?
- blkid (Correct answer)
- lsblk -u
- fdisk -l
- df -i
Correct answer: blkid
blkid queries and displays block device attributes including UUID, filesystem type, and label.
Question 2: What entry in /etc/fstab would mount a filesystem with UUID 1234-ABCD at /data with read-only access?
- UUID=1234-ABCD /data ext4 ro 0 2 (Correct answer)
- UUID=1234-ABCD /data ext4 defaults 0 2
- /dev/sdb1 /data ext4 ro 0 2
- UUID=1234-ABCD /data ext4 rw,noexec 0 2
Correct answer: UUID=1234-ABCD /data ext4 ro 0 2
The fstab entry uses UUID=<value> as the device field, followed by mountpoint, filesystem type, and options including 'ro' for read-only.
Question 3: Which command checks and repairs an ext4 filesystem on /dev/sdb1 without interactive prompts?
- e2fsck -y /dev/sdb1 (Correct answer)
- fsck -a /dev/sdb1
- tune2fs -c /dev/sdb1
- mkfs.ext4 -r /dev/sdb1
Correct answer: e2fsck -y /dev/sdb1
e2fsck -y automatically answers 'yes' to all repair questions, enabling non-interactive filesystem repair.
Question 4: A system fails to boot because of an incorrect /etc/fstab entry. Which kernel parameter allows you to boot into a rescue shell to fix it?
- rd.break (Correct answer)
- single
- init=/bin/sh
- systemd.unit=rescue.target
Correct answer: rd.break
rd.break interrupts the boot process before the root filesystem is mounted, providing a rescue shell to fix fstab issues.
Question 5: What does the last field (pass) in an /etc/fstab entry control?
- The order in which fsck checks filesystems at boot (Correct answer)
- The number of times the filesystem can be mounted
- The priority of the mount operation
- Whether the filesystem is automatically unmounted on shutdown
Correct answer: The order in which fsck checks filesystems at boot
The pass field controls the order in which fsck checks filesystems at boot; 0 means skip, 1 is for root, 2 for others.
Question 6: Which command shows disk usage summary for each directory under /var, sorted by size?
- du -sh /var/* | sort -h (Correct answer)
- df -h /var
- ls -lS /var
- stat /var/*
Correct answer: du -sh /var/* | sort -h
du -sh provides a summary of disk usage for each item, and sort -h sorts human-readable sizes correctly.
Question 7: What is the purpose of the 'noatime' mount option in /etc/fstab?
- Prevents updating the access time on files when they are read (Correct answer)
- Disables write operations to the filesystem
- Prevents the filesystem from being automounted
- Disables creation timestamps on new files
Correct answer: Prevents updating the access time on files when they are read
noatime improves performance by not updating the access time (atime) metadata every time a file is read.
Which command displays the UUID of all block devices on a RHEL system?