2 # vim:expandtab:shiftwidth=4:softtabstop=4:tabstop=4:
4 EXPORT_OPTS=${EXPORT_OPTS:-"rw,async,no_root_squash"}
9 local LUSTRE_CLIENT=${3}
10 local NFS_CLIENTS=${4}
11 local export_opts_v=$EXPORT_OPTS
13 echo "Exporting Lustre filesystem..."
15 if [ "$NFS_VER" = "4" ]; then
16 export_opts_v="$EXPORT_OPTS,fsid=0"
17 do_nodes $LUSTRE_CLIENT "mkdir -p /var/lib/nfs/v4recovery"
20 do_nodes $LUSTRE_CLIENT,$NFS_CLIENTS "grep -q rpc_pipefs' ' /proc/mounts ||\
21 { mkdir -p /var/lib/nfs/rpc_pipefs && \
22 mount -t rpc_pipefs sunrpc /var/lib/nfs/rpc_pipefs; }" || return 1
25 do_nodes $LUSTRE_CLIENT "service nfs restart" || return 1
27 do_nodes $NFS_CLIENTS "service rpcidmapd restart" || return 1
29 do_nodes $LUSTRE_CLIENT "exportfs -o $export_opts_v *:$MNTPNT \
30 && exportfs -v" || return 1
32 echo -e "\nMounting NFS clients (version $NFS_VER)..."
34 do_nodes $NFS_CLIENTS "mkdir -p $MNTPNT" || return 1
35 if [ "$NFS_VER" = "4" ]; then
36 do_nodes $NFS_CLIENTS \
37 "mount -t nfs$NFS_VER -o async $LUSTRE_CLIENT:/ $MNTPNT" || return 1
39 do_nodes $NFS_CLIENTS \
40 "mount -t nfs -o nfsvers=$NFS_VER,async \
41 $LUSTRE_CLIENT:$MNTPNT $MNTPNT" || return 1
48 local LUSTRE_CLIENT=${2}
49 local NFS_CLIENTS=${3}
51 echo -e "\nUnmounting NFS clients..."
52 do_nodes $NFS_CLIENTS "umount -f $MNTPNT" || return 1
54 echo -e "\nUnexporting Lustre filesystem..."
55 do_nodes $NFS_CLIENTS "service rpcidmapd stop" || return 1
57 do_nodes $LUSTRE_CLIENT "service nfs stop" || return 1
59 do_nodes $LUSTRE_CLIENT "exportfs -u *:$MNTPNT" || return 1
61 do_nodes $LUSTRE_CLIENT "exportfs -v"