Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.
/ 2006-06-20 15:30:37 +0200 \ Regis Gras: > Lars Ellenberg wrote: > > you have several options. > > > the most easy one would be to go to the secondary, > > and wipe the drbd meta data area. > > if you use external meta-data, that is > > /etc/init.d/drbd stop > > dd if=/dev/zero bs=4096 count=1 of=/dev/whatever-your-drbd-meta-data-device > > /etc/init.d/drbd start > > and, on the primary, do "drbdadm connect all" again. > > you'll see a Full Sync of the device then. > > > if you use internal meta-data, this is slightly more involved, > > to get the offset right... if that is the case, please post again > > with the output of "drbdadm dump", as well as "cat /proc/partitions". > > > Thank you for your help > > I'am using internal meta-data. > > Here drbdadm dump: > [dionysos]-root# drbdadm dump > resource r0 { > protocol C; > incon-degr-cmd "echo '!DRBD! pri on incon-degr' | wall ; sleep 60 ; halt -f"; > on dionysos.ujf-grenoble.fr { > device /dev/drbd0; > disk /dev/sda6; > address 193.54.242.22:7788; > meta-disk internal; > } > on bacchus.ujf-grenoble.fr { > device /dev/drbd0; > disk /dev/sda6; > address 193.54.242.17:7788; > meta-disk internal; > } > net { > on-disconnect reconnect; > } > disk { > on-io-error pass_on; > } > syncer { > rate 10M; > group 1; > al-extents 257; > } > startup { > degr-wfc-timeout 20; > wfc-timeout 20; > } > } > > > Here /proc/partitions > [dionysos]-root#cat /proc/partitions > major minor #blocks name > 8 6 58669348 sda6 so this is your backing device (lower level device) > 147 0 58538276 drbd0 and this is how much usable storage is exported by drbd, after it reserved the last 128MB of that device for the internal meta data. unit is KiloByte. since the sda6 is a multiple of 4kB, too, we don't need to round down the offset. so I'd say, to wipe out the meta data, you do perl -e '$offset = sysseek STDOUT, -(128*1024*1024), 2; die unless $offset == 58538276*1024; $zero = "\x00" x 1024; syswrite(STDOUT,$zero) == 1024 or warn "oops? $!"; ' > /dev/sda6 an additional "blockdev --flushbufs /dev/sda6" won't hurt, probably. (no warranty, please double check...) (in the drbd tar.gz there is a testing/write_gc.pl script, that can do much more interessting things. but it may also destroy valuable data if used improperly, or when we have a bug in there...) (drbd 8 has a command called drbdmeta, which is much more flexible, and more precise, too...) > Coud you tell me if external meta-data is a better option than internal meta-data ? I recommend using external meta-data, because it is easier to handle (e.g. when resizing). -- : Lars Ellenberg Tel +43-1-8178292-0 : : LINBIT Information Technologies GmbH Fax +43-1-8178292-82 : : Schoenbrunner Str. 244, A-1120 Vienna/Europe http://www.linbit.com : __ please use the "List-Reply" function of your email client.