After mounting a new volume over `/var/www/uploads`, the app can no longer write there.
IntermediateTroubleshootingPermissions, ownership, SELinux and mounts
Answer
Likely causes → The new filesystem's root directory is owned by root:root with 755, hiding the old directory's ownership; on SELinux hosts the new mount root has the wrong label.
Diagnose →
ls -ldZ /var/www/uploads
findmnt /var/www/uploads
Fix → chown www-data:www-data /var/www/uploads (on the mounted FS), set the mode, and restorecon -Rv /var/www/uploads.
Prevent → Include ownership and labels in the step that adds a mount.
More on Permissions, ownership, SELinux and mounts
nginx returns 403 and logs `open() "/srv/www/index.html" failed (13: Permission denied)`, even after `chmod -R 777 /srv/www`.IntermediateA script fails with `bash: ./deploy.sh: Permission denied` even though `ls -l` shows `-rwxr-xr-x`.BeginnerA script fails with `/bin/bash^M: bad interpreter: No such file or directory`.BeginnerA user gets `-bash: cd: /srv/project: Permission denied` although they're in the group that owns `/srv/project` (mode `770`).BeginnerApache can't connect to a backend: `AH00957: HTTP: attempt to connect to 127.0.0.1:8080 (localhost) failed` and `ausearch` shows `denied { name_connect }`.IntermediateA service fails to bind to a custom port: `bind() to 0.0.0.0:8888 failed (13: Permission denied)` while running as root.Intermediate