When I as doing my DietPi (Debian Buster) PI4 + aliexpress usb floppydrive (TEACV0.0) DOSBOX project I came across several
threads and posts on the Internet.
My initial situation was that I used the regular mount commandline to mount the usb floppydrive.
Like mentioned in this thread it had the side effect of the drive constantly polling every second
when the floppy was removed.
The cumbersome solution to this problem
I've ended up installing autofs:
Code:
sudo apt-get install autofs
Code:
sudo systemctl enable autofs
(automatically starts after (re)boot)
I edited "/etc/auto.misc" and added this line at the end:
Code:
usbfloppy -fstype=vfat,sync,gid=floppy,umask=002 :/dev/sda
Restarted autofs:
Code:
sudo service autofs restart
Autofs will automatically mount the drive only when the user explicitly do a file or folder change/check..
Also any changes to a file are directly written to the floppy, so it will not be cached and waiting for the user to unmount like a memorystick.
Now the cumbersome part is to hack the usb drive in a way that when there is no disk inserted, you just cut off the power. When insertnig a disk, the power should be connected. I had to cut the red wire and hook it up in the floppy eject lever (right side of the case) in a way it makes only contact when the floppy is inserted.
This works fine with autofs, since you have to LS or open location with a filemanager to the mountfolder to trigger the autofs automount.
The only downside for my project is that autofs will not be triggered when doing ie. A:\dir within DOSBOX mount, so
if I really wanted to use my USB floppydrive within DOSBOX, then I have to switch back to the regular mount command and disable autofs.