[DRBD-cvs] r1784 - in trunk/testing: . nfs-cross-mount

www-data www-data at garcon.linbit.com
Thu Apr 21 17:46:53 CEST 2005


Author: phil
Date: 2005-04-21 17:46:52 +0200 (Thu, 21 Apr 2005)
New Revision: 1784

Added:
   trunk/testing/nfs-cross-mount/
   trunk/testing/nfs-cross-mount/nfs-mount
   trunk/testing/nfs-cross-mount/nfs-mount-client
   trunk/testing/nfs-cross-mount/nfs-umount
Log:
Scripts to "cross" mount a filesystem to the standby-node
by nfs. Consider them as a rudimentary proof-of-concept hack.


Added: trunk/testing/nfs-cross-mount/nfs-mount
===================================================================
--- trunk/testing/nfs-cross-mount/nfs-mount	2005-04-21 10:18:53 UTC (rev 1783)
+++ trunk/testing/nfs-cross-mount/nfs-mount	2005-04-21 15:46:52 UTC (rev 1784)
@@ -0,0 +1,31 @@
+#!/bin/sh
+read cmd
+
+if [ $(uname -n) = 'curry' ]
+then
+  peer=wurst-i
+elif [ $(uname -n) = 'wurst' ]
+then
+  peer=curry-i
+else
+  echo "Fehler: Weder Host noch Peer bekannt." && exit 1
+fi
+
+if [ "$cmd" = 'start' ]
+then
+  if ! mount | grep -e " on /data/partner " >/dev/null
+  then
+    mount -o rsize=8192,wsize=8192,soft $peer:/data/partner /data/partner
+  fi
+elif [ "$cmd" = 'stop' ]
+then
+  # See if the device is currently mounted
+  if mount -t nfs | grep -e " on /data/partner " >/dev/null
+  then
+          # Kill all processes open on filesystem
+          fuser -mk /data/partner
+
+          # Unmount the filesystem
+          umount -f /data/partner
+  fi
+fi

Added: trunk/testing/nfs-cross-mount/nfs-mount-client
===================================================================
--- trunk/testing/nfs-cross-mount/nfs-mount-client	2005-04-21 10:18:53 UTC (rev 1783)
+++ trunk/testing/nfs-cross-mount/nfs-mount-client	2005-04-21 15:46:52 UTC (rev 1784)
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+if [ $(uname -n) = 'curry' ]
+then
+  peer=wurst-i
+elif [ $(uname -n) = 'wurst' ]
+then
+  peer=curry-i
+else
+  echo "Fehler: Weder Host noch Peer bekannt." && exit 1
+fi
+
+echo "$1"|ssh -i ~/.ssh/id_dsa_nfs-mount $peer

Added: trunk/testing/nfs-cross-mount/nfs-umount
===================================================================
--- trunk/testing/nfs-cross-mount/nfs-umount	2005-04-21 10:18:53 UTC (rev 1783)
+++ trunk/testing/nfs-cross-mount/nfs-umount	2005-04-21 15:46:52 UTC (rev 1784)
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+case "$1" in
+	start)
+        # See if the device is currently mounted
+        if
+          mount -t nfs | grep -e " on /data/partner " >/dev/null
+        then
+                # Kill all processes open on filesystem
+                fuser -mk /data/partner
+
+                # Unmount the filesystem
+                umount -f /data/partner
+	fi
+	;;
+	stop)
+	;;
+esac
+
+exit 0



More information about the drbd-cvs mailing list