Pcornel
Linux

Filesystem

Cheat sheet · https://pcornel.dk/topic.php?topic=2658

Back to the Topic

Answer

The Linux filesystem is a single tree starting at /. Disks, partitions and virtual filesystems are mounted onto directories in that tree; everything — files, devices, sockets — is reached through paths.

Remember

A path's content depends on what is mounted there: findmnt shows the mount for any path. A full or read-only filesystem affects everything under its mount point.

First checks

  • findmnt — all mounts as a tree
  • ls -ld <path> — owner, permissions and type
  • stat <path> — inode, links, size and timestamps
  • df -h <path> — filesystem and free space
  • findmnt <path> — which mount the path is on

Commands

journalctl
df -h <path>
findmnt -T <path>
df -i

Verify in this order

path → mount point → filesystem → inode → data

Where it usually breaks

First mismatch in hardware/block device → kernel driver/mapper/RAID/LVM → filesystem → mount namespace/options → path permissions/MAC → consumer I/O; preserve identity/native diagnostic/pre-state before mutation.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=2658

Confirmation

Confirm action

Continue?