Devices, Linux filesystems, filesystem hierarchy standard
Devices, filesystems and the filesystem hierarchy covers partitioning, creating and checking filesystems, mounting them persistently, quotas, permissions and ownership, links, and where files belong. Objective 104 of LPIC-1 Exam 101-500, worth 25% of the exam.
- Share of the exam
- 25%
- Questions in a real sitting
- roughly 15 of 60
- Questions in this bank
- 76
- Signed for by a person
- 0
- Machine-checked only
- 75
Partly checked. None of the 76 questions here has been read against the cited source by a person. 75 questions have been checked against their cited clause by an automated pass — which is not the same thing, and is not a signature.
1 question has had neither check. It is written from the published exam objectives and cite the clause it comes from, but it is kept out of search results and out of mock exams until someone has looked. It is here to be read and challenged, not to be trusted.
Only questions a person has signed for are used in mock exams here. That is the whole difference between the two kinds of checking above.
How these questions are written — where each question comes from, what the verification ledger records, and what happens when one is found wrong.
What this objective covers
The 76 questions written for this objective cite 6 LPI exam objectives (104.1, 104.2, 104.3, 104.5, 104.6, 104.7) and 28 manual pages (bash(1), chmod(1), chown(1), df(1), e2fsck(8), fdisk(8), find(1), fsck(8), gdisk(8), hier(7), ln(1), ls(1), lsblk(8), mke2fs(8), mkfs.btrfs(8), mount(8), parted(8), path_resolution(7), readlink(1), swapon(8), symlink(7), systemd.mount(5), umount(8), unlink(2), updatedb.conf(5), whereis(1), xfs_fsr(8), xfs_repair(8)).
They break down as 51 single-answer questions, 12 choose-several questions and 13 type-the-answer questions.
What this objective is really about
A quarter of the 101 paper, and the most "administrator" of the four objectives. It runs from the block device up: partition it, put a filesystem on it, mount it, control who may write to it, and know where things are supposed to live.
Creating, checking and mounting
mkfs is a front end that dispatches to a per-filesystem helper, so mkfs -t ext4 and mkfs.ext4 do the same thing. For FAT, -F selects the width, and -F 32 is what forces FAT32 rather than letting the tool choose by device size. Swap takes two steps: mkswap writes the signature, swapon tells the running kernel to use it, and an fstab entry makes it survive a reboot.
Check filesystems offline. e2fsck on a mounted read-write filesystem can corrupt it, and the important detail is that e2fsck warns and lets you continue rather than refusing outright — the safety is a prompt, not a block. XFS keeps its own tools: xfs_repair checks and repairs and refuses a mounted filesystem, while xfs_fsr is a defragmenter, not a repair tool.
The six fstab fields are device, mount point, filesystem type, options, dump flag, and fsck pass order. Use UUID= or LABEL= rather than /dev/sdX, because kernel device names are assigned in detection order and change when hardware does. Useful options: noauto keeps an entry out of mount -a while leaving it mountable by name, nofail stops a missing device failing the boot, and remount changes the options of a mount that is already up — mount -o remount,ro / is how you make root read-only without unmounting it.
When umount reports the target is busy, lsof and fuser -m identify the processes holding it. A common cause is simply a shell whose working directory is inside the tree.
Permissions and links
Octal permissions are the sum of read 4, write 2 and execute 1 for owner, group and other. The umask masks bits out of a base of 666 for files and 777 for directories — it clears them rather than subtracting, which is why umask 027 gives 640 and 750 and not the 639 arithmetic would produce. umask 022 gives 644 and 755. Files never get the execute bit at creation, which is why a fresh script needs chmod +x.
The special bits: s in the owner-execute position is setuid, s in the group-execute position is setgid, t in the other-execute position is the sticky bit. On Linux the sticky bit is meaningful only on directories, where it stops users deleting files they do not own — that is what makes /tmp at mode 1777 safe to share. Linux ignores setuid on interpreted scripts entirely, because of unavoidable race conditions.
A hard link is another directory entry for the same inode, so all names are equally the file and deleting one merely decrements the link count. Hard links cannot cross filesystems, because inode numbers are unique only within one. A symbolic link stores a path that is resolved at access time, so it can cross filesystems, point at directories, and dangle when its target is removed.
Where things live
The Filesystem Hierarchy Standard splits on two axes: static versus variable, and shareable versus host-specific. /usr is static and shareable, so nothing that changes during normal operation belongs there. /var is variable — logs, spools, caches. /etc is host-specific configuration and, per the standard, holds no binaries. /opt is for self-contained add-on packages, /usr/local for locally built software. /tmp is not guaranteed to survive a reboot; /var/tmp is the one that is.
Lessons in this objective
The objective cut into the pieces the blueprint declares. Each one has the material written out and the questions that test it.
- Partitions and filesystems
- Keeping filesystems intact
- Mounting and unmounting filesystems
- File permissions, ownership and disk quotas
- Hard links and symbolic links
- Finding files and where they belong
Drill this objective
The trainer can run a short practice set drawn from this objective alone, which is what the weight column above is for: revise the heavy objectives first.
Practise Devices, Linux filesystems, filesystem hierarchy standard
Questions on this objective (page 1 of 4)
- A new disk /dev/sdb has no partition table at all. Which command writes an empty GPT partition table onto it without dropping you into an interactive editor? machine-checked
- You need the partition /dev/sdc1 on a USB stick to carry a FAT32 filesystem so that Windows machines can read and write it. Which command creates it? machine-checked
- You have just run `mkswap /dev/sdb2`. Which command makes the kernel start using that swap area immediately, without a reboot? machine-checked
- Why is it dangerous to run e2fsck against an ext4 filesystem that is currently mounted read-write? machine-checked
- On an ext4 filesystem at /dev/sda1 you want an automatic check to be forced after every 30 mounts. Which command sets that? machine-checked
- `df -h /var` reports the filesystem 100% full, but `du -sh /var` accounts for only about half that space. Nothing is hidden under a mount point. What is the most likely explanation? machine-checked
- An XFS filesystem on /dev/sdb1 was damaged by a power loss and must be checked and repaired. Which command is the right tool, and what state must the filesystem be in? machine-checked
- In an /etc/fstab line, what does the sixth and last field control? machine-checked
- A server's /etc/fstab refers to data partitions as /dev/sdb1 and /dev/sdc1. After an extra disk controller is installed, the machine fails to boot correctly. Why does using UUID= instead avoid this class of failure? machine-checked
- Which /etc/fstab mount option keeps a filesystem from being mounted by `mount -a` during boot, while still allowing an administrator to mount it later by naming its mount point? machine-checked
- The root filesystem is mounted read-write and you need it read-only for a moment. You obviously cannot unmount it. Which command changes it in place? machine-checked
- A script must be readable and executable by everyone but writable only by its owner. Which octal mode does that? machine-checked
- A user's shell has umask 022. With no other mechanism involved, what permissions does a regular file created by that shell's redirection get? machine-checked
- `ls -l /usr/bin/passwd` shows `-rwsr-xr-x 1 root root`. What does the s in the owner's execute position mean? machine-checked
- /tmp is shown by ls -ld as `drwxrwxrwt`. What does the trailing t achieve on this world-writable directory? machine-checked
- Which command sets both the owner and the group of report.txt to alice and staff in a single invocation? machine-checked
- You run `ln /data/report.txt /data/backup.txt` and then `rm /data/report.txt`. What is the state of the data afterwards? machine-checked
- You type `mytool` and want to know exactly which executable file the shell will run, based on your current PATH. Which command answers that? machine-checked
- Select the THREE statements that are true about links on a Linux filesystem. machine-checked
- You need the UUID of the filesystem on /dev/sda1 to write a persistent /etc/fstab entry. Select the TWO commands that will show it. machine-checked
Drafts awaiting checking
1 question has been written for this objective and checked by nobody and nothing. It is listed by reference rather than by wording, and its page is kept out of search results until someone or something has read it against the clause it cites.
- Question lpic101-104-012 draft
Practise Devices, Linux filesystems, filesystem hierarchy standard
The other objectives in LPIC-1 Exam 101-500
- 101. System architecture — 13.33% of the exam
- 102. Linux installation and package management — 18.33% of the exam
- 103. GNU and Unix commands — 43.33% of the exam