Given:
Wanted:
The official documentation of DRBD describes online and offline growth (http://www.drbd.org/users-guide-emb/s-resizing.html). Both didn't work in my case. So I came up with these steps:
[root@drbd2 ~]# sfdisk -uS /dev/sdb Checking that no-one is using this disk right now ... OK Disk /dev/sdb: 208050 cylinders, 16 heads, 63 sectors/track Old situation: Units = sectors of 512 bytes, counting from 0 Device Boot Start End #sectors Id System /dev/sdb1 2048 125829119 125827072 83 Linux /dev/sdb2 0 - 0 0 Empty /dev/sdb3 0 - 0 0 Empty /dev/sdb4 0 - 0 0 Empty Input in the following format; absent fields get a default value. <start> <size> <type [E,S,L,X,hex]> <bootable [-,*]> <c,h,s> <c,h,s> Usually you only need to specify <start> and <size> (and perhaps <type>).sfdisk now asks for a new partition scheme. For sdb1 adapt the current start value (2048) only. For sdb2 to sdb4 enter 0 as start value and as size:
/dev/sdb1 :2048 /dev/sdb1 2048 209715199 209713152 83 Linux /dev/sdb2 :0 0 /dev/sdb2 0 - 0 0 Empty /dev/sdb3 :0 0 /dev/sdb3 0 - 0 0 Empty /dev/sdb4 :0 0 /dev/sdb4 0 - 0 0 Empty New situation: Units = sectors of 512 bytes, counting from 0 Device Boot Start End #sectors Id System /dev/sdb1 2048 209715199 209713152 83 Linux /dev/sdb2 0 - 0 0 Empty /dev/sdb3 0 - 0 0 Empty /dev/sdb4 0 - 0 0 Empty Warning: partition 1 does not start at a cylinder boundary I don't like this - probably you should answer No Do you want to write this to disk? [ynq]Then enter y, press Enter, and sfdisk will hopefully say something like:
Successfully wrote the new partition table Re-reading the partition table ...
[root@drbd2 ~]# service drbd start Starting DRBD resources: [ create res: drbd0 prepare disk: drbd0 adjust disk: drbd0Internal drbd meta data successfully moved. adjust net: drbd0 ] .
[root@drbd2 ~]# cat /proc/drbd version: 8.4.1 (api:1/proto:86-100) GIT-hash: 91b4c048c1a0e06777b5f65d312b38d47abaea80 build by root@drbd.intra.ogris.net, 2012-11-23 17:30:18 0: cs:WFConnection ro:Secondary/Unknown ds:UpToDate/DUnknown C r----- ns:0 nr:4 dw:4 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:62911580
[root@drbd2 ~]# cat /proc/drbd version: 8.4.1 (api:1/proto:86-100) GIT-hash: 91b4c048c1a0e06777b5f65d312b38d47abaea80 build by root@drbd.intra.ogris.net, 2012-11-23 17:30:18 0: cs:Connected ro:Primary/Secondary ds:UpToDate/UpToDate C r----- ns:0 nr:4 dw:8 dr:1029 al:1 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:104853340(Yes, this was a resize from 60 to 100 GB)
kernel: block drbd0: drbd_bm_resize called with capacity == ......