[DRBD-user] Hello,A problem when I used drbd8.2.5

f06352 flybird525 at h3c.com
Tue Mar 18 08:28:19 CET 2008

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


    I will have my actions step by step for you. Please give me your
suggestion please. Any help is much appreciated.
    My OS is centOS5. I downloaded source code from drbd.org and
installed it by the documentation with it. When I created a new
partition and formatted it by ext3 file system. I found it could work
correctly. But when I used for a partition with existing file system, I
found is doesn't work well. I followed the conduction and shrunk the
partition which existing file system.
    The follow is what I have done and some information which I
thought important.
    [root at masterhost /]# mkfs.ext3 /dev/sda7
    [root at masterhost /]# mount /dev/sda7 /mnt
    [root at masterhost /]# df -lh
    Filesystem            Size  Used Avail Use% Mounted on
    /dev/sda5              48G  3.3G   42G   8% /
    tmpfs                 2.0G     0  2.0G   0% /dev/shm
    /dev/sda7             388M   11M  358M   3% /mnt
    
    [root at masterhost /]# drbdadm create-md r2
    md_offset 419450880
    al_offset 419418112
    bm_offset 419401728
    
    Found ext3 filesystem which uses 409601 kB
    current configuration leaves usable 409572 kB
    
    Device size would be truncated, which
    would corrupt data and result in
    'access beyond end of device' errors.
    You need to either
       * use external meta data (recommended)
       * shrink that filesystem first
       * zero out the device (destroy the filesystem)
    Operation refused.
    
    Command 'drbdmeta /dev/drbd2 v08 /dev/sda7 internal create-md'
terminated with exit code 40
    drbdadm aborting
    
    [root at masterhost /]# e2fsck -f /dev/sda7
    [root at masterhost /]# resize2fs /dev/sda7 380M
                         resize2fs 1.39 (29-May-2006)
                         Resizing the filesystem on /dev/sda7 to
389120 (1k) blocks.
    
    [root at masterhost /]# /etc/init.d/drbd start
                         Starting DRBD resources:    [ d(r2) s(r2)
].tem on /dev/sda7 is now 389120 blocks long.
    [root at masterhost /]# drbdsetup /dev/drbd2 primary -o
    [root at masterhost /]# cat /proc/drbd
    version: 8.2.5 (api:88/proto:86-88)
    GIT-hash: 9faf052fdae5ef0c61b4d03890e2d2eab550610c build by
root at localhost.localdomain, 2008-03-14 09:47:25
    
     2: 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
            act_log: used:0/127 hits:0 misses:0 starving:0 dirty:0
changed:0
    
    drbd.conf
    global {
        usage-count yes;
    }
    
    common {
      syncer { rate 10M; }
    }
    
    resource r2 {
      protocol C;
    
      startup { wfc-timeout 0; degr-wfc-timeout 120; }
      disk    { on-io-error detach; }
      net     { timeout 60; connect-int 10; ping-int 10;
                max-buffers 2048; max-epoch-size 2048; }
      syncer  { rate 4M; } # sync when r0 and r1 are finished
syncing.
      on masterhost {
        address 192.168.0.162:7790;
        disk /dev/sda7;
        device /dev/drbd2;
        meta-disk "internal";
      }
      on slavehost {
        device "/dev/drbd2";
        disk "/dev/sda5";
        meta-disk "internal";
        address 192.168.0.163:7790;
      }
    }
    




More information about the drbd-user mailing list