[DRBD-user] How to resize a drbd block device with "drbdadm resize"

Jérôme Augé jerome.auge at gmail.com
Tue May 15 11:28:41 CEST 2007

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.


I searched the mailing list, but I still don't understand/managed to resize
a drbd block device with the `drbdadm resize' command.

Here is my test setup :
- DRBD version 8.0.0
- /dev/sdc1 is the backing storage device for /dev/drbd2 and has a size of
512MB (with internal meta-data)
- /dev/drbd2 holds a ext3 filesystem

Here is what I tried with `drbdadm resize' :
- node1 is cs:Connected st:Primary/Secondary
- node2 is cs:Connected st:Secondary/Primary
- I delete sdc1 and recreate it with 1GB size on both nodes
- sdc1 is now 1GB in size as seen fdisk output
- I run `drbdadm resize drbd2' on node1 and on node2 => nothing is
logged/nothing seems to happen
- I run `resize2fs /dev/drbd2' on node1 but it finds that the fs is already
using the max avail size => so, nothing was resized

The only way I found to resize my drbd is by bringing down my drbd devices,
deleting and recreating the sdc1 partition with 1GB size, creating new
meta-data (drbdadm create-md) on the drbd, bring it up and do a full sync,
and finally resize2fs my file system.

Is it safe to resize a drbd that way
? as the underlying device is extended, and the new
meta-data is created in the new upper allocated space, i guess I'm safe.
The drawbacks is that it requires to stop the services and perform
a full sync.

What is the correct way to perform a resize with `drbdadm resize' ? does it
only works on top of LVM backing storage devices ? I end up thinking that
drbd is not getting the new sdc1 size correctly/in real time after
deleting/re-creating the partition.

Jérôme Augé
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linbit.com/pipermail/drbd-user/attachments/20070515/ea79cd36/attachment.htm>

More information about the drbd-user mailing list