I created a folder using
sudo mkdir /mnt/external/ and then mount an external hdd to it:
$ mount -t ext2 /dev/sdd1 /mnt/external
I have an application writing backups to that mounted drive. Then, for fail test I simply unplug the external drive but the the application still keeps writing backups to that folder.
This is a problem because
/mnt/external/ folder now becomes a regular folder on the regular hard drive and the application fills up the actual hard drive which is running the OS.
How can I make sure that the application only writes to the mount point if the drive is currently mounted there?