R/W access permissions to torizon user/containers on auto-mounted USB drive

Dear Developer Community,

in TorizonCore 5.1.0 on Colibri iMX8X, USB drives are automatically mounted to a new folder with the same volume name under /media (/var/rootdirs/media/) with R/W permission restricted to root user, the torizon user intended to be used by the app containers is not allowed to write in the volume by default.

I have not found the options to configure this automount neither in /etc/fstab nor as /etc/udev/rules.d. An automount.rules file is mentioned in other questions in the forum, but it seems no more present and I suppose it is (or was) used in other Yocto image configurations.

This is the result of the automatic mount, output of mount command:
/dev/sda1 on /disks/USB DISK type vfat (rw,nosuid,nodev,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,showexec,utf8,flush,errors=remount-ro)

How can I change system configuration to have masks allowing R/W permissions?

Thank you in advance and best regards,


Greetings @ldvp,

You can make changes to /etc/fstab to modify the conditions of the automatic mounting.

For example this is what I use personally in my own setup for torizon user r/w permissions:
/dev/sda1 /media/usbhd auto relatime,nofail,utf8,uid=torizon,gid=torizon,umask=002 0 0

The important fields are the uid/gid setting but feel free to modify the above line for your needs.

Best Regards,