New USB drive automounts to wrong directory

There is a “nice” solution for this problem which doesn’t require disabling mountd, any black magic, and even allows you to mount the drive by UUID, which you really should want.

It is an improved “nas” service file from the howto: https://gist.github.com/peci1/443062022352a3adc0df574584c9af44 . It’s just a basic idea, it could be improved to support multiple drives mounting, an entry in /etc/config etc.

The main change compared to the howto file is changing the START order from 99 to 79 (mountd has 80). After you do that, your script will be run before mountd, and when mountd is called, your NTFS drive will already be mounted, so it won’t touch it.

BONUS: my reasoning for why is the howto broken. The howto was written some time ago, when mountd was not a part of Turris OS (I think it’s there from 3.3). Then mountd came into play but nobody has revised the howto since.

1 Like