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.

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)

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.

Practise Devices, Linux filesystems, filesystem hierarchy standard

The other objectives in LPIC-1 Exam 101-500