Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

When I try to format the /dev/drbd0 with mkfs.ext3 I get the error message:

mkfs.ext3: Wrong medium type while trying to determine filesystem size.

I found a solution here:

http://eng.eelcowesemann.nl/linux-unix/general/mkfs-ext3-wrong-medium-type-while-trying-to-determine-filesystem-size/

however if I execute the sueggested command drbdadm primary test, I got the following error:

0: State change failed: (-1) Multiple primaries not allowed by config Command 'drbdsetup 0 primary' terminated with exit code 11

Any Ideas ?

Output from Command cat /proc/drbd:

version: 8.3.7 (api:88/proto:86-91)
srcversion: EE47D8BF18AC166BE219757
 0: cs:Connected ro:Secondary/Primary 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 ep:1 wo:b oos:0

and

drbd.conf:

 # You can find an example in  /usr/share/doc/drbd.../drbd.conf.example

    #include "drbd.d/global_common.conf";
    #include "drbd.d/*.res";

    global {
       usage-count yes;
   }
common {
 syncer {
   rate 100M;
 }
}
resource test {
 protocol C;
 handlers {
 pri-on-incon-degr "echo o > /proc/sysrq-trigger ; halt -f";
 pri-lost-after-sb "echo o > /proc/sysrq-trigger ; halt -f";
 local-io-error "echo o > /proc/sysrq-trigger ; halt -f";
#  outdate-peer "/usr/sbin/drbd-peer-outdater";
 }
 startup {
   wfc-timeout         0;  ## Infinite!
   degr-wfc-timeout  120;  ## 2 minutes.
 }
 disk {
   on-io-error detach;
 }
 net {
   # timeout           60;
   # connect-int       10;
   # ping-int          10;
   # max-buffers     2048;
   # max-epoch-size  2048;
   # on-disconnect-reconnect;
  after-sb-0pri discard-younger-primary;
  after-sb-1pri consensus;
  after-sb-2pri disconnect;
  rr-conflict disconnect;
# allow-two-primaries;
 }
 syncer {
   rate 100M;
   al-extents 257;
 }
 on VOXDEMOSRV01 {
   device     /dev/drbd0;
   disk       /dev/sda6;
   address    192.168.1.134:7788;
   meta-disk /dev/sda7[0];
}
 on VOXDEMOSRVOWN01 {
   device     /dev/drbd0;
   disk       /dev/sda2;
   address    192.168.1.146:7788;
meta-disk /dev/sda5[0];
share|improve this question
    
cat /proc/drbd? Also post your configuration file /etc/drbd.conf and/or cat /etc/drbd.d/r0.res? –  quanta Sep 26 '11 at 8:22
    
I updated the webpage to mention the 'multiple primaries' message –  Sgaduuw Sep 26 '11 at 19:36
add comment

2 Answers

up vote 2 down vote accepted

mkfs.ext3: Wrong medium type while trying to determine filesystem size.

The reason is you are on secondary node and /dev/drbd0 is read-only. Switch to primary node and try again.

share|improve this answer
add comment

This problem may caused by the two drbd are secondary, you must make them one is primary the other is secondary. Below is my configuration:

#service drbd status
drbd driver loaded OK; device status:
version: 8.3.13 (api:88/proto:86-96)
GIT-hash: 83ca112086600faacab2f157bc5a9324f7bd7f77 build by dag@Build64R6, 2012-05-07 11:52:13

m:res cs ro ds p mounted fstype 1:r0 Connected *Secondary/Primar*y UpToDate/UpToDate C

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.