3 EXPORT_OPTS=${EXPORT_OPTS:-"rw,async,no_root_squash"}
8 local LUSTRE_CLIENT=${3}
10 local nfs_climntpt=${5:-$MNTPNT}
12 local export_opts_v=$EXPORT_OPTS
14 echo "Exporting Lustre filesystem..."
16 if [ "$NFS_VER" = "4" ]; then
17 export_opts_v="$EXPORT_OPTS,fsid=0"
18 do_nodes $LUSTRE_CLIENT "mkdir -p /var/lib/nfs/v4recovery"
21 do_nodes $LUSTRE_CLIENT,$NFS_CLIENTS "grep -q rpc_pipefs' ' /proc/mounts ||\
22 { mkdir -p /var/lib/nfs/rpc_pipefs && \
23 mount -t rpc_pipefs sunrpc /var/lib/nfs/rpc_pipefs; }" || return 1
26 do_nodes $LUSTRE_CLIENT "echo $MNTPNT *\($export_opts_v\) \
27 >> /etc/exports" || return 1
29 # restart nfs server according to distro
30 do_nodes $LUSTRE_CLIENT "{ [[ -e /etc/SuSE-release ]] &&
31 service nfsserver restart; } ||
32 service nfs restart" || return 1
34 do_nodes $NFS_CLIENTS "chkconfig --list rpcidmapd 2>/dev/null |
35 grep -q rpcidmapd && service rpcidmapd restart ||
38 echo -e "\nMounting NFS clients (version $NFS_VER)..."
40 do_nodes $NFS_CLIENTS "mkdir -p $nfs_climntpt" || return 1
41 if [ "$NFS_VER" = "4" ]; then
42 do_nodes $NFS_CLIENTS \
43 "mount -t nfs$NFS_VER -o async \
44 $LUSTRE_CLIENT:/ $nfs_climntpt" || return 1
46 do_nodes $NFS_CLIENTS \
47 "mount -t nfs -o nfsvers=$NFS_VER,async \
48 $LUSTRE_CLIENT:$MNTPNT $nfs_climntpt" || return 1
55 local LUSTRE_CLIENT=${2}
56 local NFS_CLIENTS=${3}
58 echo -e "\nUnmounting NFS clients..."
59 do_nodes $NFS_CLIENTS "umount -f $MNTPNT" || true
61 echo -e "\nUnexporting Lustre filesystem..."
62 do_nodes $NFS_CLIENTS "chkconfig --list rpcidmapd 2>/dev/null |
63 grep -q rpcidmapd && service rpcidmapd stop ||
66 do_nodes $LUSTRE_CLIENT "{ [[ -e /etc/SuSE-release ]] &&
67 service nfsserver stop; } ||
68 service nfs stop" || return 1
70 do_nodes $LUSTRE_CLIENT "sed -i '/${MNTPNT##*/}/d' /etc/exports" || return 1
72 do_nodes $LUSTRE_CLIENT "exportfs -v"