Advanced File System and Storage Flashcards
29 cards from real Linux practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.
Read the first 20 Advanced File System and Storage flashcards as text
What does the `df -h` command display on a Linux system?
Answer: Disk space usage of mounted filesystems in human-readable format
df (disk free) reports filesystem disk space usage; -h makes sizes human-readable (KB, MB, GB) instead of raw block counts.
Which command shows the disk usage of a directory and its subdirectories?
Answer: du -sh /path
du (disk usage) measures actual file/directory sizes on disk; -s summarizes total for the directory, -h makes it human-readable.
What is the purpose of the `fsck` command in Linux?
Answer: Checks and repairs filesystem inconsistencies
fsck (filesystem check) scans for and repairs filesystem errors — it should be run on unmounted filesystems to avoid further corruption.
What is an inode in Linux filesystems?
Answer: A data structure that stores metadata about a file (permissions, timestamps, size, data block pointers)
An inode stores all metadata about a file except its name and content: permissions, ownership, timestamps, size, and pointers to data blocks.
What is the difference between a hard link and a symbolic (soft) link in Linux?
Answer: A hard link is a direct reference to the same inode; a symbolic link is a file containing a path to another file
Hard links share the same inode (same file, multiple names); symbolic links are separate files containing a path, similar to Windows shortcuts.
Which command creates a new ext4 filesystem on the /dev/sdb1 partition?
Answer: mkfs.ext4 /dev/sdb1
mkfs.ext4 (or mkfs -t ext4) formats a partition with the ext4 filesystem — this destroys all existing data on the partition.
What does the `mount -o remount,ro /` command do?
Answer: Remounts the root filesystem as read-only without unmounting
remount allows changing mount options on an already-mounted filesystem; ro makes it read-only — used in maintenance mode and rescue situations.
What is LVM (Logical Volume Manager) in Linux, and what problem does it solve?
Answer: LVM provides a flexible abstraction layer over physical storage, allowing dynamic resizing and management of disk space across multiple devices
LVM abstracts physical storage into flexible logical volumes that can be resized, snapshotted, and spanned across multiple disks without reformatting.
Which /etc/fstab field specifies the pass number for filesystem check order at boot?
Answer: The 6th field (pass)
The 6th field in /etc/fstab determines fsck order at boot: 0 = skip, 1 = check first (root fs), 2 = check after root.
What is the purpose of the `tune2fs` command?
Answer: Adjusts tunable parameters of ext2/3/4 filesystems, such as reserved block count, check intervals, and mount options
tune2fs modifies ext2/3/4 filesystem parameters without reformatting, including reserved space percentage, mount count limits, and filesystem features.
What is RAID 5 and what are its requirements?
Answer: RAID 5 stripes data with distributed parity across at least 3 disks, allowing one disk failure without data loss
RAID 5 distributes parity data across all disks (not a dedicated parity disk), providing fault tolerance for one disk failure with good read performance.
What command creates a software RAID 5 array from three disks in Linux?
Answer: mdadm --create /dev/md0 --level=5 --raid-devices=3 /dev/sdb /dev/sdc /dev/sdd
mdadm is the Linux software RAID management tool; --create builds a new array, --level sets the RAID type, --raid-devices specifies the count.
What is the Btrfs filesystem's key advantage over ext4?
Answer: Built-in copy-on-write snapshots, checksumming, RAID, and online resizing without separate tools
Btrfs (B-tree filesystem) provides integrated features: COW snapshots, per-block checksums for data integrity, built-in RAID, compression, and subvolumes.
What does the `lsblk` command show?
Answer: Tree view of all block devices, their sizes, mount points, and types
lsblk lists all block devices (disks, partitions, LVM volumes) in a tree structure showing relationships, sizes, and mount points.
What is the purpose of swap space in Linux?
Answer: Provides overflow virtual memory on disk when RAM is full, and stores hibernation state
Swap extends the system's virtual memory by using disk space, and is used to store the contents of RAM during hibernation (suspend-to-disk).
Which command shows detailed information about a file's inode, including all timestamps?
Answer: stat filename
stat displays all inode information: size, blocks, inode number, permissions, UID/GID, all three timestamps (atime, mtime, ctime), and device info.
What is the function of the `/proc/mounts` file in Linux?
Answer: Shows all currently mounted filesystems with their options, similar to the output of 'mount'
/proc/mounts is a kernel-maintained file showing all active mounts in real time, including bind mounts and pseudo-filesystems.
What is the purpose of the `dd` command in Linux storage management?
Answer: Copies raw data at a block level, used for disk imaging, cloning, and writing bootable images
dd is a low-level copy utility that works at the block level, capable of creating disk images, cloning drives, writing ISO images, and testing disk performance.
What is XFS and what type of workloads is it best suited for?
Answer: A high-performance journaling filesystem best suited for large files and parallel I/O workloads
XFS excels at large file performance, parallel access patterns, and scales to very large filesystems — making it default in RHEL for enterprise storage workloads.
Which command permanently mounts a filesystem by adding it to the appropriate configuration file?
Answer: Edit /etc/fstab with the device, mount point, filesystem type, options, dump, and pass fields
/etc/fstab is the filesystem table where persistent mount configurations are defined; entries are processed at boot and by 'mount -a'.