Hallo allerseits,
Zielsetzung:
ich möchte einen USB-Stick mittels autofs auf /dev/sdb1 mounten.
Lösungsansatz:
/etc/autofs/auto.master
--------------------------------------
/misc /etc/autofs/auto.misc
/net -hosts
+dir:/etc/autofs/auto.master.d
+auto.master
/etc/autofs/auto.misc
--------------------------------------
usbstick -fstype=auto,async,nodev,nosuid,umask=000 :/dev/sdb1
/etc/nsswitch.conf
-----------------------------------------------
# Begin /etc/nsswitch.conf
passwd: files
group: files
shadow: files
publickey: files
hosts: files dns myhostname
networks: files
protocols: files
services: files
ethers: files
rpc: files
netgroup: files
automount: files
# End /etc/nsswitch.conf
# ls -l /etc/autofs
insgesamt 36
drwxr-xr-x 1 root root 0 28.08.2016 19:52 auto.master.d/
-rw-r--r-- 1 root root 13357 28.08.2016 19:52 autofs.conf
-rw------- 1 root root 232 28.08.2016 19:52 autofs_ldap_auth.conf
-rw-r--r-- 1 root root 818 13.10.2016 08:30 auto.master
-rw-r--r-- 1 root root 588 13.10.2016 07:59 auto.misc
-rwxr-xr-x 1 root root 902 28.08.2016 19:52 auto.net*
-rwxr-xr-x 1 root root 2191 28.08.2016 19:52 auto.smb*
#
# systemctl restart autofs.service
# systemctl status autofs.service
● autofs.service - Automounts filesystems on demand
Loaded: loaded (/usr/lib/systemd/system/autofs.service; disabled; vendor preset: disabled)
Active: active (running) since Do 2016-10-13 09:29:29 CEST; 5s ago
Process: 2427 ExecStart=/usr/bin/automount $OPTIONS --pid-file /run/autofs.pid (code=exited, status=0/SUCCESS)
Main PID: 2430 (automount)
Tasks: 5 (limit: 4915)
CGroup: /system.slice/autofs.service
└─2430 /usr/bin/automount --pid-file /run/autofs.pid
Okt 13 09:29:29 nb systemd[1]: Starting Automounts filesystems on demand...
Okt 13 09:29:29 nb systemd[1]: Started Automounts filesystems on demand.
An dieser Stelle stecke ich den Stick in USB-Slot und es ergibt sich folgendes Problem:
# blkid | grep sdb
/dev/sdb1: UUID="DBF6-1B98" TYPE="vfat" PARTUUID="300f9595-01"
#
# ls /
boot/ dev/ etc/ home/ media/ misc/ mnt/ net/ opt/ proc/ root/ run/ srv/ sys/ tmp/ usr/ var/ bin@ lib@ lib64@ sbin@
#
# mount | grep sdb
# ls /misc/
# mount | grep misc
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=23,pgrp=1,timeout=0,minproto=5,maxproto=5,direct)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)
/etc/autofs/auto.misc on /misc type autofs (rw,relatime,fd=6,pgrp=2430,timeout=300,minproto=5,maxproto=5,indirect)
#
# cd /misc/
#
# mount | grep sdb
# ls /misc/
# mount | grep misc
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=23,pgrp=1,timeout=0,minproto=5,maxproto=5,direct)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)
/etc/autofs/auto.misc on /misc type autofs (rw,relatime,fd=6,pgrp=2430,timeout=300,minproto=5,maxproto=5,indirect)
#
# touch /misc/test
touch: '/misc/test' kann nicht berührt werden: Keine Berechtigung
#
Die gesamte Prozedur habe ich einmal mit umask 0077 (meiner default umask) für root und noch einmal mit umask 0022 für root durchgeführt - mit exakt gleichem Ergebnis:
Das /misc Verzeichnis bleibt leer und der Stick wird nicht gemounted.
Habe ich was vergessen / nicht beachtet?
Braucht ihr noch weitere Infos?