I use automount with systemd service units (not /etc/fstab) to mount an
external BTRFS filesystem (2 drives configured as RAID-1). There is a
timeout of 120 seconds of inactivity after which it should unmount.
This works *nearly* all the time, but sometimes it doesn't and I can't
figure out why. The drive is normally only used at 3am to run a backup
script, and logs show that this is working correctly, but when I check
in the morning I sometimes find the drive still mounted (shown by
'findmnt') even though nothing is accessing it, i.e. 'fuser' shows
nothing and 'umount' succeeds immediately.
If it matters, the actual timeout always seems to take 300 seconds. I
don't know if this is because BTRFS is keeping the drive alive,
flushing queues or whatever. It's not important in itself, just another
data point.
When I mount the drive manually, the timeout always succeeds (though
again after 300 seconds rather than 120).
Any ideas?
poc