Linux Advanced File System and Storage 5 — Questions and Answers
Question 1: What does the 'dumpe2fs' command do?
- Dumps ext2/3/4 filesystem superblock and block group information (Correct answer)
- Creates a binary dump of a filesystem
- Lists inode contents of an ext filesystem
- Exports filesystem metadata to a file
Correct answer: Dumps ext2/3/4 filesystem superblock and block group information
dumpe2fs prints the superblock and block group descriptor table information for an ext2/3/4 filesystem.
Question 2: Which NFS mount option ensures that all file operations on the client are completed before returning to the application?
- sync (Correct answer)
- hard
- intr
- noac
Correct answer: sync
The sync mount option forces synchronous I/O so all writes are committed to the server before the client returns control to the application.
Question 3: What is the role of the journal in an ext3/ext4 filesystem?
- Records metadata changes before they are committed, ensuring consistency after a crash (Correct answer)
- Stores a log of all file reads and writes for auditing
- Backs up the superblock periodically
- Tracks inode allocation in real time
Correct answer: Records metadata changes before they are committed, ensuring consistency after a crash
The journal (write-ahead log) records pending metadata or data changes so the filesystem can replay or discard them after an unclean shutdown.
Question 4: Which command permanently removes an LVM Logical Volume?
- lvremove (Correct answer)
- vgreduce
- lvchange -an
- dmsetup remove
Correct answer: lvremove
lvremove deactivates and permanently deletes a Logical Volume and all its data from the Volume Group.
Question 5: What is the effect of mounting a filesystem with the 'ro' option?
- Mounts the filesystem in read-only mode, preventing any writes (Correct answer)
- Rotates the filesystem log on mount
- Enables raw I/O mode
- Restricts access to the root user only
Correct answer: Mounts the filesystem in read-only mode, preventing any writes
The ro mount option causes the kernel to mount the filesystem read-only, so no modifications can be made to files or directories.
Question 6: Which tool is used to benchmark raw disk throughput on a Linux block device?
- hdparm -tT /dev/sda (Correct answer)
- dd if=/dev/zero of=/dev/null
- fio --verify=crc32
- bonnie++ --quick
Correct answer: hdparm -tT /dev/sda
hdparm -tT performs buffered and cached read benchmarks on a block device, providing a quick indication of raw disk and cache throughput.
Question 7: What happens when a Btrfs filesystem runs out of metadata space even though data space is available?
- The filesystem becomes read-only and returns ENOSPC errors (Correct answer)
- New files can still be created but not modified
- Metadata is automatically migrated to data chunks
- The kernel triggers an OOM event to free space
Correct answer: The filesystem becomes read-only and returns ENOSPC errors
When Btrfs exhausts its metadata allocation, the filesystem is remounted read-only to prevent corruption, even if raw storage remains for data.
What does the 'dumpe2fs' command do?