ZFS and the automounter

So, you have ZFS, and you create lots and lots of filesystems, all the time, any time you like.

Problem: new filesystems don't show up in /net (-hosts special automount map) once a host's /net entry has been automounted.

Solution #1: wait for OpenSolaris to gain support for client-side crossing of NFSv4 server-side mount-points.

Solution #2: replace the -hosts map with an executable automount map that generates hierarchical automount map entries based on showmount -e output.

The script is pretty simple, but there is one problem: the automounter barfs at entries longer than 4095 characters (sigh).

#!/bin/ksh

exec 2>/dev/null

if [[ $# -eq 0 ]]
then
	logger -p daemon.error -t ${0##\*/} "Incorrect usage by automountd!"
	exit 1
fi

entry="/ $1:/"
showmount -e $1|sort|grep '\^/'|while read p junk
do
	entry="$entry $p $1:$p"
done

print "$entry"

logger -p daemon.debug -t ${0##\*/} "$entry"
     
Comments:

Post a Comment:
Comments are closed for this entry.
About

I'm an engineer at Oracle (erstwhile Sun), where I've been since 2002, working on Sun_SSH, Solaris Kerberos, Active Directory interoperability, Lustre, and misc. other things.

Search

Archives
« July 2015
SunMonTueWedThuFriSat
   
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 
       
Today