[DRBD-user] Resize offline - Questions

GM gianni.milo22 at gmail.com
Mon Nov 29 16:28:00 CET 2021


Not an expert, so don't get my words for granted. You can calculate
estimated metadata size by using the formula described in chapter "16.1.3.
Estimating meta data size" in the drbd user guide.

To check the current space (in sectors) allocated for metadata, subtract
the total disk size in sectors (assuming you are using /dev/vdb as the drbd
backing device, and not LVM on top of it) with current la-size-sect
(2306867200 - 2306796728=70472).You can then multiply the result with 512
to get the size in bytes (70472 x 512=36081664 Bytes or ~34.4Mbytes).

Since you are about to increase the vdisk size to 2TB (double its current
size), a safe guess would be to use the double size of the current metadata
allocation as well  (70472 x 2).

You could take a snapshot of the VM before doing any changes just in case
something goes wrong. Even better, try reproducing your current setup on
two new VMs (disk sizes can be smaller) and test the above steps over
there, before applying them to the production VMs.

Good luck

On Mon, 29 Nov 2021 at 05:59, Christian Völker <knebb at knebb.de> wrote:

> Hi list,
>
> I realized I am using drbd now for more than ten years and is has been a
> joy all the time.
>
> Now I have a request where I am really unsure how to deal with.
>
> I have to resize a volume offline. Mainly because the carppy hypervisor
> does not allow to enalrge virtual disks while the vm ist running.....
>
> I checked the docs
> <https://linbit.com/drbd-user-guide/drbd-guide-9_0-en/#s-growing-offline>
> about offline resize. There are some questions remaining. It states I have
> to edit the metadata file I created to match the sectors of the new size.
> My question now is: where do I get this number from?
>
> I tried to firgure out and match the current size with the current volume
> but there is a mismatch:
> ===========================================
> root at drbd1:~# grep la-size metatada.drbd1
> la-size-sect 2306796728;
> root at backuppc41:~# fdisk -l /dev/vdb
> Disk /dev/vdb: 1,07 TiB, 1181116006400 bytes, 2306867200 sectors
> Units: sectors of 1 * 512 = 512 bytes
> Sector size (logical/physical): 512 bytes / 512 bytes
> I/O size (minimum/optimal): 512 bytes / 512 bytes
> ===========================================
>
> So from where do I get the number of sectors (after having enlarged the
> disk)?
> Are there any other pitfalls?
>
> Just to really make sure: There is no easier way to do? I mean how does
> drbd recon the new size of the disk when online?
> So this won't work?
> -drbdadm down
> -shut down VM
> -enlarge disk
> -power on VM
> -start drbd realizing there is a new size ...
>
> However, any clue for the main question about how to get the sectors?
>
>
> Thanks a lot!
>
> /Christian
> _______________________________________________
> Star us on GITHUB: https://github.com/LINBIT
> drbd-user mailing list
> drbd-user at lists.linbit.com
> https://lists.linbit.com/mailman/listinfo/drbd-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linbit.com/pipermail/drbd-user/attachments/20211129/e86bf2b6/attachment.htm>


More information about the drbd-user mailing list