1.6 KiB
1.6 KiB
RHCSA 6.3: autofs
Mounting NFS exports on demand with an indirect map, a wildcard map for home directories, and a direct map.
Before you start
The lab adds a second machine, server (10.99.0.2), running an NFS
server that exports to the lab network 10.99.0.0/24:
server:/exports/share, with a filereadme.txtin it;server:/exports/homes, with a home directory for each ofaliceandbob(/exports/homes/aliceand/exports/homes/bob, each with awelcome.txt).
server shares this VM's files, so you can see /exports here too, but
mount it from server. The lab creates users alice and bob (password
Lab-Pass-1) and sets alice's home directory to /rhome/alice. autofs
isn't installed.
Tasks
- Make
server:/exports/sharemount on demand at/shares/data, unmounting after 60 seconds unused. - Make each user's home mount on demand from
server:/exports/homes/USERat/rhome/USER, with one map line, so thatsu - alicelands in/rhome/alice. - Make the same share,
server:/exports/share, mount on demand at/mnt/directwith a direct map, still after a reboot.
Hints
dnf install autofs,systemctl enable --now autofs; a file in/etc/auto.master.d/ending in.autofs, and a map file;systemctl reload autofs./shares /etc/auto.shares --timeout=60, and adataline in the map.*and&in the map line. The homes are private and root is squashed on the share, so look inside them as their owner:su - alice./-in the master map; full paths in a direct map.ls,findmnt,automount -m.