[DRBD-user] Creating a "degraded" DRBD (was: Staggered implementation questions.)

Peter Funk pf at artcom-gmbh.de
Thu Dec 4 09:04:51 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.


Hello,

Corey Brown asked on Friday, 28.11.2008 13:50:
> Can you load a Linux  server with drbd as the primary server then add on  
> the secondary server later ?
>
> I want to use my present secondary server to do a reload of OS and  
> upgrade of drbd.
> Then Move production data from my present now degraded primary to my new  
> primary.
> Then reload my previous primary as the new secondary.
>
> Is this possible ?

I had similar questions.  
So I've waited a while for an answer from someone with more 
experience in DRBD showing up, but that didn't happen until now.

So I'll try to explain it 
in another way:  When explaining DRBD to new people:
DRBD is often referred to as RAID-1 mirroring over ethernet.

So people already familar with todays Linux software RAID might
wonder, what is the equivalent of the software RAID command 
   mdadm --create --level=1 --raid-devices=2 /dev/md0 /dev/sda1 missing
within the context of DRBD.
The command above creates a degraded but running RAID-1 meta device
/dev/md0 which can afterwards immideately started to be used. 
For example by formatting it with mkfs or by using it as part of DRBD.
Later you can add the mirror partition using 
   mdadm --add /dev/md0 /dev/sdb1

Yesterday I have for the first time tried to achieve creating a 
degraded DRBD and hopefully I think, I succeded:
This is on a freshly installed Ubuntu 8.04.1 LTS which came with 
a 8.0.11 DRBD package.

Of course I had to prepare the /etc/drbd.conf first.  
To create the DRBD device (resource) on this single side server
(assuming the DRBD network is disconnected) I used the
following commands:
    drbdadm create-md r0
    drbdadm down r0
    cat /proc/drbd
    drbdadm -- ::::1:1:::: set-gi r0
    drbdadm up r0
    drbdadm primary r0
    cat /proc/drbd
Afterwards I was able to mkfs.xfs /dev/drbd0 and mount it and
the output of /proc/drbd looks as such :

version: 8.0.11 (api:86/proto:86)
GIT-hash: b3fe2bdfd3b9f7c2f923186883eb9e2a0d3a5b1b build by phil at mescal, 2008-02-12 11:56:43
 0: cs:WFConnection st:Primary/Unknown ds:UpToDate/DUnknown C r---

I have no idea, whether the procedure outlined above is advisable.
I was just tinkering around and hopefully found a way that works for
the first step.  Today I shall see what will happen when I add the
second server.

Regards, Peter
-- 
Peter Funk, ✉Oldenburger Str.86, D-27777 Ganderkesee, Germany 
office: ArtCom GmbH, ✉Lise-Meitner-Str. 5, D-28359 Bremen, Germany 
tel:+49-421-20419-0 cell:+49-179-640-8878
<http://www.artcom-gmbh.de/>



More information about the drbd-user mailing list