Menu
Linux · 04 Topic · 6 steps

Devices, Linux Filesystems, Filesystem Hierarchy Standard

“Partitions and filesystems, checking and mounting them, permissions, links and where files live.”

Topic 104 is the storage half of LPIC-1 exam 101-500. It follows a disk from empty to useful: you split it into partitions, put filesystems on them, keep them healthy and attach them to the directory tree. Then it zooms in on the files themselves: who may read and change them, how one file can have several names, and where everything belongs on a Linux system.

Each byte matches one exam objective (104.4 was dropped from LPIC-1 version 5.0, so the numbering skips it).

You’ll learn:

  • to create MBR and GPT partition tables with fdisk, gdisk and parted, and filesystems with mkfs and mkswap, including Btrfs basics
  • to watch free space and inodes with df and du, and check and repair ext and XFS filesystems
  • to mount and unmount by hand, at boot through /etc/fstab or systemd mount units, and by label or UUID
  • to read and set permissions and owners, use SUID, SGID and the sticky bit, and choose a umask
  • to create hard and symbolic links and tell them apart
  • where files live according to the Filesystem Hierarchy Standard, and how to find them with find, locate, whereis, which and type

You’ll need: a Linux machine or VM where you can use sudo. Partitioning, mkfs, fsck and mount need root, and you’ll want a spare disk to play with: a VM disk, or a file turned into a loop device (shown in the first byte). For permissions, links and finding files, a container is enough: docker run -it --rm debian or docker run -it --rm ubuntu. A container can’t create loop devices or mount filesystems unless you start it with --privileged.

Start reading →
Byte card for Devices, Linux Filesystems, Filesystem Hierarchy Standard: MBR: 4 primary partitions and 2 TiB. GPT: 128 partitions, huge disks, needed for UEFI. mkfs.TYPE makes a filesystem, mkswap makes swap. Check them unmounted with fsck or xfs_repair. Mount by UUID or LABEL in /etc/fstab: device, mount point, type, options, dump, pass. r=4 w=2 x=1. SUID 4, SGID 2, sticky 1. The umask takes bits away from 666 and 777. Hard links share an inode, symlinks store a path. /etc config, /var data, /usr/local yours.

Byte card

The whole topic on one card

  1. MBR: 4 primary partitions and 2 TiB. GPT: 128 partitions, huge disks, needed for UEFI.
  2. mkfs.TYPE makes a filesystem, mkswap makes swap. Check them unmounted with fsck or xfs_repair.
  3. Mount by UUID or LABEL in /etc/fstab: device, mount point, type, options, dump, pass.
  4. r=4 w=2 x=1. SUID 4, SGID 2, sticky 1. The umask takes bits away from 666 and 777.
  5. Hard links share an inode, symlinks store a path. /etc config, /var data, /usr/local yours.

Save it as a cheat sheet, or share it with someone who's learning this too.

Search posts and bytes

Optional account

Keep your progress everywhere

Everything on AminBytes is free to read, with or without an account. Sign in only if you want your commits, streak and merged topics saved, on every device.

or

We keep only your name, avatar and which bytes you finished, and you can delete it all anytime. Privacy