Monthly Archives: June 2024

making unmounted external drive mount point unwritable

This is needed when a USB hard drvei sometimes fails. The mountpoint on root drive get 100% full

The most error-proof solution is to make the mount point unwritable.

chmod a-rwx /mnt/backups

However there is one additional step you should perform.

chattr +i /mnt/backups This is because even with no permissions, root would still be able to write to the directory. With chattr +i (sets immutable flag) not even root can write to it. Once the mount is mounted, the permissions dont matter as the permissions will be of the remote directory, not the local one.