Pcornel
Linux · Filesystem

/dev

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

Back to the Topic

Answer

/dev contains device files that represent hardware and virtual devices (disks /dev/sda, /dev/nvme0n1, terminals, /dev/null). It is a devtmpfs managed by the kernel and udev.

Remember

Device names (sda, sdb) can change between boots — use /dev/disk/by-uuid or by-id in configuration. Permissions on device nodes are set by udev rules.

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

/dev 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=2662

Confirmation

Confirm action

Continue?