[yocto] [systemd-devel] How to automount

Johannes Pointner h4nn35.work at gmail.com
Thu Sep 24 04:25:39 PDT 2015


I have to admit, I don't use systemd at the embedded system, but I use
the following files to do it for the usb flash drives:
/etc/auto.master:
+auto.master
/var/autofs /etc/auto.usb       --timeout=2

/etc/auto.usb:
usb1    -fstype=vfat,rw,sync,noatime,nodiratime,nodev,nosuid,noexec,uid=1000
   :/dev/usba
usb2    -fstype=vfat,rw,sync,noatime,nodiratime,nodev,nosuid,noexec,uid=1000
   :/dev/usbb

Furthermore I have a additional udev rule for the usb interfaces:
/etc/udev/rules.d/99-mount-usb-key.rules:
SUBSYSTEMS=="usb", SUBSYSTEM=="block", KERNELS=="1-1", ENV{USB_HUB}="usb2"
SUBSYSTEMS=="usb", SUBSYSTEM=="block", KERNELS=="2-1", ENV{USB_HUB}="usb1"

ENV{USB_HUB}=="usb1", SUBSYSTEM=="block", KERNEL=="sd[a-z]*", SYMLINK+="usba"
ENV{USB_HUB}=="usb2", SUBSYSTEM=="block", KERNEL=="sd[a-z]*", SYMLINK+="usbb"

But I also use automount on my desktop PC and there with systemd, but
no for a flash drives instead for cifs shares and this looks like
this:

/etc/autofs/aut.cifs-shares:
exchange -fstype=cifs,nosuid,rw,credentials=/home/h4nn35/.smbcredentials,dir_mode=0777,file_mode=0666
://server/exchange

/etc/autofs/auto.master:
+auto.master
/home/h4nn35/NetShares /etc/autofs/auto.cifs-shares --timeout=60 --ghost

I hope this helps.

2015-09-24 12:58 GMT+02:00 Mike Looijmans <mike.looijmans at topic.nl>:
> On 24-09-15 08:04, Johannes Pointner wrote:
>>
>> I'm using autofs to do the trick. It's working fine for me.
>>
>> To get the umount working I use a timeout of 2 seconds, which seems to
>> be ok so far.
>
>
>
> I am very very interested in how you got that to actually work. Please show
> us your configuration files and/or recipes and enlighten us!
>
> So far, all I ever got autofs to accomplish was giving me a major headache.
>
>
> Kind regards,
>
> Mike Looijmans
> System Expert
>
> TOPIC Embedded Products
> Eindhovenseweg 32-C, NL-5683 KH Best
> Postbus 440, NL-5680 AK Best
> Telefoon: +31 (0) 499 33 69 79
> Telefax: +31 (0) 499 33 69 70
> E-mail: mike.looijmans at topicproducts.com
> Website: www.topicproducts.com
>
> Please consider the environment before printing this e-mail
>
>
>
>
>
> --
> _______________________________________________
> yocto mailing list
> yocto at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto



More information about the yocto mailing list