[DRBD-user] mount questions

Karl R. Balsmeier karl at clickability.com
Fri Jun 29 02:22:47 CEST 2007

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


Hi,

I am new to drbd and have followed your website's HOWTO fairly closely, 
but it appears when it comes to the last few steps as far as mounting 
goes, there's a bit of vagueness -perhaps due to my own poor reading 
comprehension, -but also, there are no command examples beyond "the 
device should be usable" after you do the

drbdadm -- --overwrite-data-of-peer primary all

The "Migrating Resources" worked great, -and there's a reference to a mount command there, but that's a little further in.

My questions revolve around trying to understand the mounting process as it relates to replicating data on the secondary.  
I list the exact steps I did, in an effort to get some answers to my questions below 

-I truly thank you for any consideration/answers you may have.

----------------------
Install Centos 5

during install make a filesystem called /drbd-netblock and give it 1GB and it shows up as /dev/sda7

yum install drbd kmod-drbd

edit /etc/grub.conf to allow boot of the drbd kernel 2.6.18-8.1.6.el5 #1 SMP

reboot, the proper kernel should now be up.

modprobe drbd

umount /drbd-netblock filesystem so drbd can use it:

umount /drbd-netblock

edit /etc/drbd.conf  /dev/sda7 is a 1GB filesystem I made during install called /drbd-netblock
#############
global { usage-count yes; }
      common { syncer { rate 10M; } }
      resource r0 {
           protocol C;
           net {
                cram-hmac-alg sha1;
                shared-secret "secretphrase";
           }
           on box1.mydomain.com {
                device    /dev/drbd1;
                disk      /dev/sda7;
                address   192.168.1.2:7789;
                meta-disk  internal;
           }
           on box2.mydomain.com {
                device    /dev/drbd1;
                disk      /dev/sda7;
                address   192.168.1.3:7789;
                meta-disk  internal;
           }
      }
##############

drbdadm create-md r0    # Is this done on just the primary or both?  I did it on both.

drbdadm up all

you'll see:

[root@ ~]# ps ax | grep drbd
18063 ?        S      0:00 [drbd1_worker]
18069 ?        S      0:00 [drbd1_receiver]
18070 ?        S      0:00 [drbd1_asender]

cat /proc/drbd will show both in secondary, as the drbd website howto shows, and you can promote a node to primary:

drbdadm -- --overwrite-data-of-peer primary all

[root@ ~]# cat /proc/drbd
version: 8.0.3 (api:86/proto:86)
SVN Revision: 2881 build by buildsvn at c5-x8664-build, 2007-05-23 14:07:33

 1: cs:Connected st:Primary/Secondary ds:UpToDate/UpToDate C r---
    ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0
        resync: used:0/31 hits:0 misses:0 starving:0 dirty:0 changed:0

My question is, when the howto says "The device is usable right away, go ahead and create a filesystem if you haven't already", what do they mean?  

What are the following steps to get replication working?

I also made myself a 40GB partition called /replicated  just in case I wanted to use that.

How does the "device" statement in the .conf file (device /dev/drbd1;) relate to any actual filesystem element?  None right, it's just a name you give your netblock correct?

Is the "disk" statement (disk /dev/sda7;) referring to my 1GB filesystem space I created, that's what I should put right?  

When you do the mount, are you doing "mount /dev/drbd1 /drbd-netblock1" or "mount /dev/drbd1 /replicated" ?

       
-krb




More information about the drbd-user mailing list