(I am running openSUSE 13.2)
My current setup
I have an external backup drive which I mount at boot with the following line in my
/dev/mapper/cr_backup /backup ext4 comment=systemd.automount,nofail 0 2
I have the
nofail option because sometimes the backup drive is not present and I do not want the boot to hang in this case.
When the backup drive is not present, running
ls on my root directory enters an infinite loop which I must cancel with ctrl+c. The error message is:
ls: cannot access /backup: Interrupted system call
It seems that
ls is failing because it's trying to access the backup drive and cannot.
One solution would be to nest the backup drive at
/backup/backup so that
ls / does not trip up.
However this feels like a dirty hack and I'm wondering if there is a more elegant solution (I'm keen to learn more about how the system works!).
In my (limited) experience with
mount, if a device isn't mounted then the mount point is an empty directory.
Can I achieve something similar here?
I would need to be careful though since I have automatic hourly backups scheduled which currently do not run if the device isn't mounted. I definitely don't want the backup to just dump everything in the empty directory if it hasn't mounted the backup drive!