[DRBD-user] DRBD 8.2.5 to 8.3.0 upgrade with make PREFIX=/usr/local/drbd error: symlink(/usr/local/drbd/etc/drbd.conf, /var/lib/drbd//drbd-minor-1.conf): No such file or directory

GAUTIER Hervé herve.gautier at thalesgroup.com
Fri Jan 30 17:22:14 CET 2009


Hi again,

Well, I don't know what is this /var/lib/drbd directory, but here is a 
patch in order to take in account the "make PREFIX=" command

Tell me if it is OK for you.

And so, last question, what is the aim of this directory ? I have seen 
drbdadm create symbolic link to the configuration file, but why ?


--8<-------------------------------------------------
diff -Naur drbd-8.3.0/user/drbdadm_minor_table.c 
drbd-8.3.0-debug/user/drbdadm_minor_table.c
--- drbd-8.3.0/user/drbdadm_minor_table.c       2009-01-30 
16:19:08.000000000 +0100
+++ drbd-8.3.0-debug/user/drbdadm_minor_table.c 2009-01-30 
16:43:32.000000000 +0100
@@ -40,7 +40,9 @@
 #include <sys/stat.h>
 #include <string.h>
 
-#define MINOR_TABLE_DIR "/var/lib/drbd/"
+#include "drbd_prefix.h"
+
+#define MINOR_TABLE_DIR "/var/lib/drbd"
 #define MAX_MINOR 256
 
 #define MAX_REGISTER_PATH_LEN  1024
@@ -49,7 +51,7 @@
  * it is assumed that sprintf cannot fail :-] */
 void linkname_from_minor(char *buf, int minor)
 {
-       sprintf(buf, "%s/drbd-minor-%d.conf", MINOR_TABLE_DIR, minor);
+       sprintf(buf, "%s%s/drbd-minor-%d.conf", DRBD_PREFIX, 
MINOR_TABLE_DIR, minor);
 }
 
 int unregister_minor(int minor)
diff -Naur drbd-8.3.0/user/Makefile drbd-8.3.0-debug/user/Makefile
--- drbd-8.3.0/user/Makefile    2008-12-01 14:35:42.000000000 +0100
+++ drbd-8.3.0-debug/user/Makefile      2009-01-30 17:12:25.000000000 +0100
@@ -43,7 +43,11 @@
 drbd_strings.c: ../drbd/drbd_strings.c
        cp $^ $@
 
-drbdadm: $(drbdadm-obj)
+.PHONY: drbd_prefix.h
+drbd_prefix.h:
+       echo "#define DRBD_PREFIX       \"$(PREFIX)\"" > drbd_prefix.h
+
+drbdadm: drbd_prefix.h $(drbdadm-obj)
        $(CC) -o $@ $^
 
 # for debugging:
@@ -66,6 +70,7 @@
        $(CC) -o $@ $^
 
 clean:
+       rm -f drbd_prefix.h
        rm -f drbdadm_scanner.c drbdmeta_scanner.c
        rm -f drbdsetup drbdadm drbdmeta drbdmeta_unfinished_rewrite *.o
        rm -f drbd_buildtag.c drbd_strings.c
--8<-------------------------------------------------



GAUTIER Hervé a écrit :
>
> Hi !
>
> On a test machine, DRBD 8.2.5 was running, built from source with 
> "make all && make install"
> Configuration file is /usr/local/drbd-8.2.5/etc/drbd.conf
> DRBD module is /lib/modules/`uname -r`/kernel/drivers/block/drbd.ko
> User DRBD tools drbd{adm|meta|setup}are in /sbin
> I have got a symbolic link /usr/local/drbd -> /usr/local/drbd-8.2.5
>
> Then I stop DRBD, put the 8.3.0 source in /usr/local/drbd-8.3.0 and 
> replace the symbolic link /usr/local/drbd -> /usr/local/drbd-8.2.5 
> with /usr/local/drbd -> /usr/local/drbd-8.3.0
> I have built DRBD 8.3.0 from source with "make PREFIX=/usr/local/drbd 
> all && make PREFIX=/usr/local/drbd install".
> Configuration file is in /usr/local/drbd-8.3.0/etc/drbd.conf (same as 
> before)
> DRBD module is /usr/local/drbd-8.3.0/lib/modules/`uname 
> -r`/kernel/drivers/block/drbd.ko
> User DRBD tools drbd{adm|meta|setup}are in /usr/local/drbd-8.3.0/sbin
> At the installation I can see a new empty directory: 
> /usr/local/drbd-8.3.0/var/lib/drbd
>
> What is this new directory ?
>
> Old module is always installed in /lib/modules/`uname 
> -r`/kernel/drivers/block/drbd.ko but not used. Now I use insmod 
> /usr/local/drbd-8.3.0/lib/modules/`uname 
> -r`/kernel/drivers/block/drbd.ko and /proc/drbd show me 8.3.0
> PATH=/usr/local/drbd/sbin:$PATH in order to get first the new user tools
>
> Starting DRBD 8.3.0, using the resource defined under the 8.2.5 
> version, all is OK, but when I issue the following commands, I have got:
>
> --8<-------------------------------------------------
> # lsmod | grep drbd
> # drbdadm -c /usr/local/drbd/etc/drbd.conf dstate drbd_resource1
> Consistent/DUnknown
> # insmod /usr/local/drbd/lib/modules/`uname 
> -r`/kernel/drivers/block/drbd.ko
> # lsmod | grep drbd
> drbd                  238516  0
> # drbdadm -c /usr/local/drbd/etc/drbd.conf dstate drbd_resource1
> Consistent/DUnknown
> # drbdadm -c /usr/local/drbd/etc/drbd.conf up drbd_resource1
> symlink(/usr/local/drbd-8.3.0/etc/drbd.conf, 
> /var/lib/drbd//drbd-minor-0.conf): No such file or directory
> symlink(/usr/local/drbd-8.3.0/etc/drbd.conf, 
> /var/lib/drbd//drbd-minor-0.conf): No such file or directory
> symlink(/usr/local/drbd-8.3.0/etc/drbd.conf, 
> /var/lib/drbd//drbd-minor-0.conf): No such file or directory
> # drbdadm -c /usr/local/drbd/etc/drbd.conf dstate drbd_resource1
> UpToDate/DUnknown
> symlink(/usr/local/drbd-8.3.0/etc/drbd.conf, 
> /var/lib/drbd//drbd-minor-0.conf): No such file or directory
> # drbdadm -c /usr/local/drbd/etc/drbd.conf cstate drbd_resource1
> WFConnection
> symlink(/usr/local/drbd-8.3.0/etc/drbd.conf, 
> /var/lib/drbd//drbd-minor-0.conf): No such file or directory
> # drbdadm -c /usr/local/drbd/etc/drbd.conf role drbd_resource1
> Secondary/Unknown
> symlink(/usr/local/drbd-8.3.0/etc/drbd.conf, 
> /var/lib/drbd//drbd-minor-0.conf): No such file or directory
> --8<-------------------------------------------------
>
> So, I think my symbolic link /usr/local/drbd -> /usr/local/drbd-8.3.0 
> is the problem, but I don't understand why ?
>
> I can't find any information about this new var/lib/drbd directory.
> Thank in advance for any clue.
>
> If it can help, here is my /usr/local/drbd/drbd.conf
>
> --8<-------------------------------------------------
> global {
>   usage-count no;
> }
>
> common {
>   net {
>      after-sb-0pri discard-older-primary;
>      after-sb-1pri discard-secondary;
>      after-sb-2pri disconnect;
>   }
>   syncer {
>      rate 31M;
>   }
> }
>
> resource drbd_resource1 {
>   protocol C;
>
>   syncer {
>      verify-alg crc32c;
>   }
>
>   disk {
>      on-io-error detach;
>   }
>
>   on rh4-1 {
>      device    /dev/drbd0;
>      disk      /dev/cciss/c0d1;
>      address   192.168.11.104:7789;
>      meta-disk internal;
>   }
>   on rh4-2 {
>      device    /dev/drbd0;
>      disk      /dev/cciss/c0d1;
>      address   192.168.11.105:7789;
>      meta-disk internal;
>   }
> }
> --8<-------------------------------------------------
>
>
>

-- 
Hervé




More information about the drbd-user mailing list