Back to cert prep

Practice area

LPIC-1 101: Devices, Filesystems, and FHS

Read storage, mount, inode, permission, ownership, link, archive, and filesystem layout evidence before making data-affecting changes.

Linux One Liners is an independent study and practice resource. It is not affiliated with, endorsed by, or approved by LPI, The Linux Foundation, CompTIA, or any certification provider. This site does not provide exam dumps or real exam questions.

Source status

Source status: LPI LPIC-1 overview verified July 3, 2026. Current version 5.0; exams 101-500 and 102-500.

This page paraphrases study areas into command practice. It does not copy official objective text wholesale and is not an exam dump.

Plain-English goal

Practice area: partitions, filesystems, swap, mounts, quotas, permissions, links, archives, and filesystem layout. Exam/domain: 101-500.

read the situation

Command, output, and next step

Command anatomy

df -h && df -i
df
summarize filesystem pressure
-h
human-readable byte usage
-i
inode usage instead of bytes
target
scope the question to a mount point

Annotated output

Filesystem      Size  Used Avail Use% Mounted on
/dev/nvme0n1p2   40G   39G  220M 100% /
/dev/nvme0n1p3  200G   82G  118G  42% /home

Filesystem      Inodes  IUsed   IFree IUse% Mounted on
/dev/nvme0n1p2 2621440 2621400     40  100% /

4.0K	/var/tmp
180M	/var/log
2.8G	/var/lib

What to notice

filesystem
the device or volume under pressure
mounted on
the scope of the problem
Use%
byte pressure
IUse%
inode pressure
Avail/IFree
how much room remains
/var child
which top-level directory is growing inside the likely hot path

Safe vs unsafe move

Common wrong move

Cleaning /home when / is the full filesystem.

Next safe command

sudo find /var -xdev -type f -size +100M -printf '%s %p\n' 2>/dev/null | sort -nr | head

Troubleshooting ladder

  1. Name the symptom.
  2. Inspect read-only state.
  3. Find the owner, service, file, device, mount, or route.
  4. Read the decisive output field.
  5. Choose the next narrow command.
  6. Avoid broad or destructive changes.
  7. Make the smallest justified change if required.
  8. Verify and record what changed.

How to get help

  1. Know the commandUse command --help, then man command for the full reference.
  2. Know the conceptUse apropos keyword or man -k keyword to discover command names.
  3. Maybe a shell builtinUse type command, command -V command, then help command.
  4. Service behaviorUse systemctl status service and journalctl -u service before restarting.
  5. Package ownershipUse dpkg -S, rpm -qf, or the distro package tool for the installed file.

Study plan

  1. Separate disk, partition, filesystem, mount point, and directory path; explain each before changing any of them.
  2. Practice byte and inode checks, same-filesystem scans, open deleted file checks, and safe cleanup decision paths.
  3. Inspect permissions from the root of the path to the final file; then reason about owner, group, mode, umask, and special bits.
  4. Use archives and compression as read-first skills: list contents, inspect paths, verify before extracting, and avoid writing outside a sandbox.

Command labs

Run these in a lab shell or disposable machine first. The point is to explain the output, not just memorize the command.

Prove full bytes vs full inodes

df -h && df -i

Byte use and inode use should be read separately; either can block writes.

Annotated output
Filesystem      Size  Used Avail Use% Mounted on
/dev/nvme0n1p2   40G   39G  220M 100% /
/dev/nvme0n1p3  200G   82G  118G  42% /home

Filesystem      Inodes  IUsed   IFree IUse% Mounted on
/dev/nvme0n1p2 2621440 2621400     40  100% /

4.0K	/var/tmp
180M	/var/log
2.8G	/var/lib

What to notice: filesystem, mounted on, Use%, IUse%, Avail/IFree, /var child.

Next safe command: sudo find /var -xdev -type f -size +100M -printf '%s %p\n' 2>/dev/null | sort -nr | head

Inspect path permissions

namei -l /srv/app/current/.env 2>/dev/null || true; stat -c '%A %U:%G %n' /srv/app/current 2>/dev/null || true

Directory traversal and target permissions should reveal the exact access barrier.

Annotated output
f: /srv/app/current/.env
drwxr-xr-x root root /
drwxr-xr-x root root srv
drwxr-x--- deploy www-data app
drwxr-x--- deploy www-data current
-rw------- deploy deploy .env

uid=33(www-data) gid=33(www-data) groups=33(www-data)

What to notice: each path segment, mode, owner/group, effective user.

Next safe command: systemctl show nginx -p User -p Group

List archive before extraction

tar -tzf backup.tar.gz | sed -n '1,40p'

Archive paths should be reviewed before writing files to disk.

Annotated output
Usage: command [OPTION]... TARGET
Try 'command --help' for common flags.
Try 'man command' for full reference.

What to notice: Usage, --help, man.

Next safe command: command --help

command families

Commands to practice

  • lsblk
  • blkid
  • mkfs
  • mkswap
  • fsck
  • df
  • du
  • findmnt
  • mount
  • chmod
  • chown
  • umask
  • ln
  • stat
  • namei
  • tar
  • gzip
  • xz
  • zip

Related drills

Flashcards

Why can df -h look fine while writes fail?

The filesystem may be out of inodes even when free bytes remain.

What does -xdev protect during find or du?

It keeps the scan on one filesystem and avoids mounted backups or network paths.

What is the safest first archive command?

List contents before extraction, especially when paths or ownership may surprise you.

Why use namei -l for permission denied?

Directory traversal permissions can block access even when the final file mode looks correct.

safe first command

A host says `No space left on device`. What two checks should come before cleanup?

Run `df -h` for byte pressure and `df -i` for inode pressure. They answer different failure modes.

A filesystem can have free bytes and still fail writes when inodes are exhausted.

expected output field

Which `df` column tells you the affected mount point?

`Mounted on` tells you where the full filesystem is attached. Clean the pressured mount, not a random large-looking directory elsewhere.

This prevents deleting from `/home` when `/` is the problem.

flag meaning

What does `-xdev` protect during `find` or `du`?

It keeps the scan on one filesystem so you do not cross into backups, network mounts, containers, or other mounted trees.

Scope protects performance and prevents misleading results.

dangerous wrong move

Why not extract an archive before listing it?

Archive paths, ownership, and file names may surprise you. Use `tar -tf` or `tar -tzf` first.

Listing is the read-only proof step.

next diagnostic step

`namei -l` shows a parent directory missing execute permission. What does that prove?

The user cannot traverse the path even if the final file looks readable.

Fixing only the final file mode would miss the real blocker.

help command

You need to know whether `find -xdev` is supported. What local help fits?

Run `find --help` for a quick check and `man find` for details and portability notes.

Help commands are part of the practice loop, not a last resort.

command purpose

What does `findmnt -T /var` answer better than `df` alone?

It maps a path to the filesystem/mount that owns it, which helps connect a symptom path to the right mount point.

Use it when the target path may sit on a separate mount.

Quick quiz

Check the reasoning locally in your browser. Answers are not sent anywhere.

Which pair checks byte and inode pressure?
Show answer

Answer: df -h && df -i

Why: df -h and df -i separate byte usage from inode usage.

  • chmod && chown: That changes access broadly before proving which path component or owner is wrong.
  • ssh && scp: That does not answer the question the output is asking you to prove first.
  • tar && gzip: That does not answer the question the output is asking you to prove first.
Which command explains every path component's permissions?
Show answer

Answer: namei -l /path

Why: namei -l walks the path and shows ownership/mode for each component.

  • grep -R foo /: That does not answer the question the output is asking you to prove first.
  • apt update: That does not answer the question the output is asking you to prove first.
  • kill -9: That changes runtime state before reading the output that explains the failure.
Why list a tar archive before extracting?
Show answer

Answer: To inspect paths and avoid surprises

Why: Archive paths can overwrite unexpected locations if extracted carelessly.

  • To start services: That does not answer the question the output is asking you to prove first.
  • To erase metadata: That does not answer the question the output is asking you to prove first.
  • To change groups: That does not answer the question the output is asking you to prove first.

interactive permissions

Permission mode simulator

Toggle read, write, and execute bits. The symbolic and octal modes update locally in your browser.

owner
group
other

Octal: 600

Symbolic: -rw-------

Practice targets
  • Owner can read/write/execute, group can read/execute, others can read/execute. 755
  • Owner and group can read/write, others have no access. 660
  • Private SSH key mode: owner can read/write only. 600

Self-test before moving on