I want to give the torizon user (uid 1000) write access to the SD card on our colibri imx7 (using
/etc/fstab works Automatic mounting of sdcard on boot
However, on my system the SD card is available under
/dev/mmcblk0 which means, that, when the sd card is not inserted, the built in flash (which is under
/dev/mmcblk1 when a sd card is present) will have that path.
I found the nice symlink
/dev/colibri-sd-part1 which points to
/dev/mmcblk0 (and I would assume that this symlink will not be present / point to nowhere, when there is no SD card inserted. Haven’t confirmed yet, since currently working remote).
But the following line in
/etc/fstab with symlink works only halfways. It will mount the SD card under
/media/sdcard but it is still owned by root and others have no write permission.
/dev/colibri-sd-part1 /media/sdcard auto defaults,uid=1000,gid=1000,dmask=0000,fmask=0111,nofail 0 0 mounts, but without specified permissions
When using the direct device path, it works just fine. However, this may mess things up, when the SD card is not present (not inserted or died in field…).
/dev/mmcblk0p1 /media/sdcard auto defaults,uid=1000,gid=1000,dmask=0000,fmask=0111,nofail 0 0 mounts with specified permissions
When using the
/dev/disk/by-label/LOGGING symlink, it also works just fine. However, this complicates the process of preparing the SD card.
/dev/disk/by-label/LOGGING /media/sdcard auto defaults,uid=1000,gid=1000,dmask=0000,fmask=0111,nofail 0 0 mounts with specified permissions
How can I use the symlink and get writeable permissions for the torizon user? Or is there another way to address the SD card without the risk of confusing it with the builtin flash?
Thanks in advance