On Wed, 2021-04-21 at 19:30 +0000, old sixpack13 wrote:
...
> .... The drive is normally only used at 3am to run a backup
> script, ...
> When I mount the drive manually, the timeout always succeeds (though
> again after 300 seconds rather than 120).
>
> Any ideas?
>
not for btrfs-automount-case.
but you {s,c]ould check with your script if the drive is mounted
*before* backup starts.
And I would check if the mount point is still clean (in case the backup
blindy backuped to the mount point without mounted drive)
Any access to the filesystem triggers the automount, i.e. the same
sequence of events will happen even if I just touch the mount point
rather than running the actual backup. This works correctly. The
automount also triggers a watchdog script which I can see running (via
'systemctl status'). The watchdog is there to spin down the drive when
the filesystem is eventually unmounted. It does this by running
inotifywait on an 'unmount' event and works correctly if I manually
unmount the filesystem.
On the occasions when the the *automatic* unmount fails, I can see that
the watchdog is still running and the filesystem is still mounted even
though no process is accessing it (according to ´fuser´), i.e. systemd
should unmount the filesystem but sometimes doesn't.
As a workaround, I've modified the backup script to run 'umount'
explicitly after the backup has finished, as long as the filesystem was
in the unmounted state beforehand. This is admittedly a kludge.
If I can get a repeatable error I'll BZ this, but I'm not hopeful.
poc