Dit deel is nog niet vertaald. Je ziet de Engelse tekst.
Wat het doet
autofs runs as autofs.service. The master map (/etc/auto.master and /etc/auto.master.d/*.autofs) lists base folders and map files; map files list keys, options and sources. * and & make one line work for many folders (home folders). After changing maps, restart or reload autofs. automount -m prints all maps as autofs sees them.
Zo schrijf je het
automount [OPTION]... [MASTER_MAP]Belangrijkste delen
/base/etc/auto.NAME- Master map line: indirect mounts under /base.
/-/etc/auto.direct- Master map line: direct mounts (full paths in the map).
key-optionsserver:/path- Map line (indirect).
/full/path-optionsserver:/path- Map line (direct).
*-rwserver:/home/&- Wildcard: & is the key that was asked for.
--timeout=N- In the master map: unmount after N idle seconds.
Opties 18
Meest gebruikt
Niets past bij dit filter.
Voorbeelden 10
$ als gewone gebruiker# als root (of met sudo)
1Install and start
Reads the master map.
2Indirect map
cat /etc/auto.master.d/shares.autofs /etc/auto.shares /shares /etc/auto.shares data -rw server2:/exports/data/shares/data mounts on first use.
3Home folders with a wildcard
cat /etc/auto.rhome * -rw server2:/exports/home/&/rhome/lisa → server2:/exports/home/lisa.
4Apply map changes
systemctl restart autofsOr
systemctl reload autofsfor map file changes.5Show what autofs knows
automount -mAll maps after parsing.
6Trigger and check a mount
The folder appears only when used.
7Debug a failing map
systemctl stop autofs; automount -f -dForeground with debug output; then
ls /shares/datain another terminal.8Unmount after 60 seconds
echo "/shares /etc/auto.shares --timeout=60" > /etc/auto.master.d/shares.autofsShorter idle time.
9Direct map
cat /etc/auto.direct /srv/projects -rw,soft server2:/exports/dataMaster map line:
/- /etc/auto.direct.10Logs
journalctl -u autofs --since -10minErrors like "mount(nfs): nfs: mount failure".
Niets past bij dit filter.
Bestanden
/etc/auto.master, /etc/auto.master.d/*.autofs- Master map.
/etc/auto.*- Map files.
/etc/autofs.conf- Daemon settings.
Exitcodes
0 | Done. |
1 | Error. |