Pcornel
Linux · Filesystem

/usr

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

Back to the Topic

Answer

/usr holds installed, read-only software: /usr/bin programs, /usr/lib libraries, /usr/share data and documentation, and /usr/local for software installed by the admin.

Remember

Files under /usr (except /usr/local) belong to packages; changes are overwritten by updates. Install your own software in /usr/local or /opt.

First checks

  • 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

Verify in this order

/usr mounted (or virtual) → correct owner and permissions → enough space → services read and write as intended

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=2672

Confirmation

Confirm action

Continue?