Interview Prep/Linux/Disk space, inodes and filesystems

After restoring files from a tar backup, the app fails because every file is owned by `root`.

BeginnerTroubleshootingDisk space, inodes and filesystems
Answer

Likely causes → The archive was extracted as a non-root user (ownership dropped) or with --no-same-owner, or the UIDs differ on the new host.

Diagnose →

tar -tvzf backup.tgz | head
ls -ln /srv/app | head
getent passwd app

Fix → Re-extract as root with tar --same-owner -xpzf backup.tgz, or chown -R app:app /srv/app. Use --numeric-owner when UIDs matter more than names.

Prevent → Back up and restore as root with -p (preserve permissions), and keep UIDs consistent.

All Linux questions Roadmap: Linux

More on Disk space, inodes and filesystems