3 EXPORT_OPTS=${EXPORT_OPTS:-"rw,async,no_root_squash"}
8 local LUSTRE_CLIENT=${3}
10 local export_opts_v=$EXPORT_OPTS
12 echo "Exporting Lustre filesystem..."
14 if [ "$NFS_VER" = "4" ]; then
15 export_opts_v="$EXPORT_OPTS,fsid=0"
16 do_nodes $LUSTRE_CLIENT "mkdir -p /var/lib/nfs/v4recovery"
19 do_nodes $LUSTRE_CLIENT,$NFS_CLIENTS "grep -q rpc_pipefs' ' /proc/mounts ||\
20 { mkdir -p /var/lib/nfs/rpc_pipefs && \
21 mount -t rpc_pipefs sunrpc /var/lib/nfs/rpc_pipefs; }" || return 1
24 do_nodes $LUSTRE_CLIENT "service nfs restart" || return 1
26 do_nodes $NFS_CLIENTS "chkconfig --list rpcidmapd 2>/dev/null |
27 grep -q rpcidmapd && service rpcidmapd restart ||
30 do_nodes $LUSTRE_CLIENT "exportfs -o $export_opts_v *:$MNTPNT \
31 && exportfs -v" || return 1
33 echo -e "\nMounting NFS clients (version $NFS_VER)..."
35 do_nodes $NFS_CLIENTS "mkdir -p $MNTPNT" || return 1
36 if [ "$NFS_VER" = "4" ]; then
37 do_nodes $NFS_CLIENTS \
38 "mount -t nfs$NFS_VER -o async $LUSTRE_CLIENT:/ $MNTPNT" || return 1
40 do_nodes $NFS_CLIENTS \
41 "mount -t nfs -o nfsvers=$NFS_VER,async \
42 $LUSTRE_CLIENT:$MNTPNT $MNTPNT" || return 1
49 local LUSTRE_CLIENT=${2}
50 local NFS_CLIENTS=${3}
52 echo -e "\nUnmounting NFS clients..."
53 do_nodes $NFS_CLIENTS "umount -f $MNTPNT" || return 1
55 echo -e "\nUnexporting Lustre filesystem..."
56 do_nodes $NFS_CLIENTS "chkconfig --list rpcidmapd 2>/dev/null |
57 grep -q rpcidmapd && service rpcidmapd stop ||
60 do_nodes $LUSTRE_CLIENT "service nfs stop" || return 1
62 do_nodes $LUSTRE_CLIENT "exportfs -u *:$MNTPNT" || return 1
64 do_nodes $LUSTRE_CLIENT "exportfs -v"