I have an Ubuntu server where I'm automounting an external hard drive each boot.
To do this, I've created an empty folder on the root partition, and the drive gets mounted "inside" this folder.
However, what if I perform a backup to this path when the drive isn't properly mounted? The backup would instead fill up my root partition!
I can ensure that the drive is mounted each time by performing:
sudo mount -a
... before each backup.
However, what are the best practices to ensure that data is never written to the empty mount-folder (except when the external hard drive is truly mounted)?
Can this be solved without scripting? Say with permissions for example? What are the best practices?