How not to mount a particular server with autofs
There are a couple servers that I use the fancy new (to me at least) autofs scripts to mount on my Ubuntu 9.10 client machine. You know, the ones that let you just cd /net/servername/exportname
and it automagically turns that into the command to mount that export from that server at that mountpoint (so cool). To test something out though, I wanted to make sure one of the servers was not auto-mounted by autofs. The simple way to tell autofs to ignore that server (let's call it, foobarbaz) is to edit /etc/auto.net
and put this snippet right after the key="$1"
line:
# don't mount foobarbaz, for now:
if [ $key = "foobarbaz" ]; then
exit
fi
Then restart autofs:
sudo /etc/init.d/autofs restart
And autofs automagically mounts any nfs server except foobarbaz.
Comments