DRBD 8.3 replace a failed disk

drbd

I need to replace a DRBD backend disk due to worn out but unsure how to proceed. Setup is as follows:

server0 <----> server1

Server0 is the one affected, DRBD process has been stopped on it. Server1 is the master server at the moment, it's DRBD status look like that:

cat /proc/drbd
version: 8.3.11 (api:88/proto:86-96)
srcversion: F937DCB2E5D83C6CCE4A6C9
 0: cs:WFConnection ro:Primary/Unknown ds:UpToDate/Outdated C r-----
    ns:4 nr:12 dw:16 dr:937 al:0 bm:2 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0
 1: cs:WFConnection ro:Primary/Unknown ds:UpToDate/Inconsistent C r-----
    ns:10167368 nr:1357185492 dw:2024894776 dr:67769600 al:326677858 bm:1111517 lo:2 pe:0 ua:0 ap:1 ep:1 wo:f oos:305611780

Worn out disk has already been replaced on server0 and DRBD is configured to use internal meta data server.

DRDB config on server0:

resource r0 {

on server0 {
    device     /dev/drbd0;
    disk       /dev/fioa2;
    address    10.10.10.3:7788;
    meta-disk  /dev/fioa1[0];
}

on server1 {
    device     /dev/drbd0;
    disk       /dev/fioa2;
    address    10.10.10.4:7788;
    meta-disk  /dev/fioa1[0];
}
}

resource r1 {

device     /dev/drbd1;
disk       /dev/fiob2;
meta-disk  /dev/fiob1[0];

on server0 {
    address    10.10.10.3:7789;
}

on server1 {
    address    10.10.10.4:7789;
}
}

What would be the procedure to initialise the disk? My main concern is not to lose/corrupt any data on server1 at the moment.

UPDATE: new disk that's been inserted to server0 is bigger capacity then the old one, not sure if that affects the whole process

Best Answer

Simply recreate the metadata for the new devices on server0, and bring them up:

# drbdadm create-md all
# drbdadm up all

You should then see your devices connect and start syncing from server1 -> server0

They will both agree upon a size when they first connect, which will be the size of the smallest disk.

Hope that helps.

Related Topic