[DRBD-user] OpenSSI-DRBD integration: [PATCH] solution for mount UUID

Lars Ellenberg Lars.Ellenberg at linbit.com
Thu Feb 12 17:00:25 CET 2004

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.


continuing my monologue:

/ 2004-02-12 15:39:09 +0100
\ Lars Ellenberg:
> so, since it turns out that you have to hack up mmount anyways,
> just do it, and check for nbX first, maybe before even reading
> /proc/partitions.

The patch below works for me.
You just need to echo "nb0" > /etc/partitions

Since I tend to do silly spelling errors, I allow for /dev/nb0
as well. For devfs it needs to be [/dev/]nbd/0 instead, of course.

Cheers,

	Lars Ellenberg

--- mount_by_label.c.orig	2004-02-12 15:30:44.000000000 +0100
+++ mount_by_label.c	2004-02-12 16:55:06.000000000 +0100
@@ -34,6 +34,7 @@
 #include "nls.h"
 
 #define PROC_PARTITIONS "/proc/partitions"
+#define ETC_PARTITIONS  "/etc/partitions"
 #define DEVLABELDIR	"/dev"
 #define VG_DIR          "/proc/lvm/VGs"
 #define EVMS_VOLUME_NAME_SIZE  127
@@ -134,7 +135,7 @@
 	FILE *procpt;
 	char uuid[16], *label;
 	char device[110];
-	int firstPass;
+	int firstPass, etcPass;
 	int handleOnFirst;
 #if 0
 	char iobuf[32*1024];	/* For setvbuf */
@@ -146,71 +147,84 @@
 	if (uuidcache_init_evms())
 		return;
 
-	procpt = fopen(PROC_PARTITIONS, "r");
-	if (!procpt) {
-		static int warn = 0;
-		if (!warn++)
-		    error (_("mount: could not open %s, so UUID and LABEL "
-			     "conversion cannot be done.\n"),
-		       PROC_PARTITIONS);
-		return;
-	}



More information about the drbd-user mailing list