Pcornel
Linux · Filesystem

/root

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

Back to the Topic

Answer

/root is the home directory of the root user, separate from /home so root can log in even when /home is not mounted.

Remember

Only root can read it (mode 700). Root's SSH keys are in /root/.ssh/authorized_keys. Keep large files out of it, because it is on the root filesystem.

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

Commands

sudo -i
sudo command
sudo

Verify in this order

/root 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=2667

Confirmation

Confirm action

Continue?