I’ve tried creating a udev rule to automount a usb stick to a specific mount point that is owned by a user /media/jason/usb. But it fails to do anything and I don’t see any errors. It just mounts it to the device id all the time: /media/F34355… etc.
Any ideas how best to do this on the Jetson platform?
The mount point needs to be owned by a user and not root otherwise every single time you try and write to the filesystem you need sudo.
At one point I got tired of automount since it mounted things I didn’t want mounted, so I temporarily disabled the default auto mount via:
sudo bzip2 -9 /etc/udev/rules.d/99-nv-ufs-mount.rules
(if I want it activated again I just
bunzip2 the file)
Then I added rules into “
/etc/fstab” to mount the partition via UUID to where I actually wanted it. Note that when doing this in
fstab I do not use default mount options, and instead use everything normally in default plus “
nofail” so that if I boot with the device missing it won’t cause boot failure. The “
defaults” substitute is:
In theory you should be able to do this with just
udev, but I chose the method I described because it wanted to mount everything and I didn’t want everything always mounted.
Thanks @linuxdev - After a week of mucking around with this I think I’ve come to the same conclusion as you. Just remove the auto mount rule and manually mount from my app.
My situation is I want a way for a user of my app to record camera footage fulltime to an external disk - same as an nvr does.
So when they plug a USB drive in they click “start” and it will then do a mount. When they click “stop” it does a umount. I can control it all myself - perfect!