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

Rafał Kupka rkupka+Listy.Drbd at pronet.com.pl
Tue Dec 18 14:43:42 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.


On Tue, Dec 18, 2007 at 01:56:21PM +0100, Tomasz Chmielewski wrote:
> Rafał Kupka schrieb:
Hello,

> >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?

Primary/Secondary state is for DRBD device availability. On primary node
you have working /dev/drbdx. Syncing is about disc state ("ds:" in
/proc/drbd). You have ds:UpToDate/Inconsistent -- other node disc is
Inconsistent and sync is needed.

> Let's make it primary:
> 
> primary_machine# drbdadm -- --overwrite-data-of-peer primary all
> Child process does not terminate!
> Exiting.

Use --overwrite-data-of-peer only if DRBD refuses to switch to primary
state and you know that it is necessary.

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

Does error still happen if you don't use --overwrite-data-of-peer?

> 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?

Yes, typically heartbeat DRBD resource agent manage primary/secondary
state of device. I think in your situation (drbd as "backup") small
/etc/init.d/ script on first node is good enough. In case of disaster
you can set primary on other (backup) node manually, right?

Kupson
-- 
Great software without the knowledge to run it is pretty useless.
(Linux Gazette #1)



More information about the drbd-user mailing list