[DRBD-user] fdisk /dev/drbd1 -> Unable to open /dev/drbd1

Tomasz Chmielewski mangoo at wpkg.org
Tue Dec 18 13:56:21 CET 2007

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


Rafał Kupka schrieb:

>> Unfortunately, it fails:
>>
>> # fdisk /dev/drbd1
>>
>> Unable to open /dev/drbd1
>  
>> What am I doing wrong?
> 
> Make sure that resource r0 is in primary state on that node.

Indeed it was the case:

primary_machine# cat /proc/drbd
version: 8.2.1 (api:86/proto:86-87)
GIT-hash: 318925802fc2638479ad090b73d7af45503dd184 build by root at san2, 
2007-12-17 13:43:47

  1: cs:SyncSource st:Secondary/Secondary ds:UpToDate/Inconsistent C r---
     ns:11704 nr:0 dw:0 dr:19264 al:0 bm:0 lo:0 pe:5 ua:237 ap:0
         [>...................] sync'ed:  0.8% (1536652/1548204)K
         finish: 0:28:27 speed: 856 (824) K/sec
         resync: used:2/31 hits:961 misses:2 starving:0 dirty:0 changed:2
         act_log: used:0/127 hits:0 misses:0 starving:0 dirty:0 changed:0


An obvious question would be: why does it sync if both machines are 
secondary?


Let's make it primary:

primary_machine# drbdadm -- --overwrite-data-of-peer primary all
Child process does not terminate!
Exiting.


So, something was not very happy, but looks like it succeeded:

primary_machine# cat /proc/drbd
version: 8.2.1 (api:86/proto:86-87)
GIT-hash: 318925802fc2638479ad090b73d7af45503dd184 build by root at san2, 
2007-12-17 13:43:47

  1: cs:SyncSource st:Primary/Secondary ds:UpToDate/Inconsistent C r---
     ns:42288 nr:0 dw:0 dr:49824 al:0 bm:2 lo:0 pe:6 ua:236 ap:0
         [>...................] sync'ed:  3.0% (1506092/1548204)K
         finish: 0:15:41 speed: 1,344 (824) K/sec
         resync: used:2/31 hits:2869 misses:4 starving:0 dirty:0 changed:4
         act_log: used:0/127 hits:0 misses:0 starving:0 dirty:0 changed:0



Let's now try to see what happens if we reboot drbd on the primary machine:

# /etc/init.d/drbd stop
Stopping all DRBD resources.

# /etc/init.d/drbd start
Starting DRBD resources:    [ d0 s0 n0 ].



Ouch - primary is gone! Why? Do I have to set up the primary each time 
after drbd starts?


# cat /proc/drbd
version: 8.2.1 (api:86/proto:86-87)
GIT-hash: 318925802fc2638479ad090b73d7af45503dd184 build by root at san2, 
2007-12-17 13:43:47

  1: cs:SyncSource st:Secondary/Secondary ds:UpToDate/Inconsistent C r---
     ns:27588 nr:0 dw:0 dr:35104 al:0 bm:1 lo:0 pe:6 ua:235 ap:0
         [>...................] sync'ed:  2.0% (1438860/1466284)K
         finish: 0:22:28 speed: 980 (828) K/sec
         resync: used:2/31 hits:1951 misses:3 starving:0 dirty:0 changed:3
         act_log: used:0/127 hits:0 misses:0 starving:0 dirty:0 changed:0


-- 
Tomasz Chmielewski
http://wpkg.org




More information about the drbd-user mailing list