2

I am trying to setup DRBD on Ubuntu with an existing filesystem and when I run sudo drbdadm create-md r0 I get the following error message

md_offset 7889832898560 al_offset 7889832865792 bm_offset 7889592086528 Found LVM2 physical volume signature 7704911872 kB data area apparently used 7704679772 kB left usable by current configuration Device size would be truncated, which would corrupt data and result in 'access beyond end of device' errors. You need to either * use external meta data (recommended) * shrink that filesystem first * zero out the device (destroy the filesystem) Operation refused. Command 'drbdmeta 0 v08 /dev/sda4 internal create-md' terminated with exit code 40 

Not sure what I am doing wrong. Could someone please explain this to me and provide how to fix it?

2 Answers 2

1

You're about to write DRBD meta-data (which is needed to add DRBD being able to manage your volume) to an already existing file system. There's a good chance to damage your data, so drbdadm create-md stopped here.

You'd need to shrink the filesystem by 128 MB (that's the usual meta-data size) on the primary server, or make the underlaying physical storage 128MB larger - this created a gap for drbd to write the metadata into. Or you (maybe the safer solution here) create a small LV and use external metadata for this volume.

1

I have same problem, i mount /var/lib/docker, it's so sad if you want sync existing filesystem, You must prepare an additional clean partition or disk to store the metadata, it's also mentioned here.

root@node51:~# df -hT Filesystem Type Size Used Avail Use% Mounted on tmpfs tmpfs 392M 1.4M 390M 1% /run /dev/mapper/ubuntu--vg-lv--0 xfs 97G 8.9G 89G 10% / tmpfs tmpfs 2.0G 0 2.0G 0% /dev/shm tmpfs tmpfs 5.0M 0 5.0M 0% /run/lock /dev/sda2 ext4 2.0G 256M 1.6G 14% /boot /dev/sda1 vfat 1.1G 6.1M 1.1G 1% /boot/efi tmpfs tmpfs 392M 4.0K 392M 1% /run/user/0 /dev/sdb xfs 20G 369M 20G 2% /var/lib/docker root@node51:~# cat /etc/drbd.d/ global_common.conf r0.res root@node51:~# cat /etc/drbd.d/r0.res resource "r0" { device minor 1; disk "/dev/sdb"; meta-disk internal; on "node51" { address 192.168.72.51:7789; } on "node52" { address 192.168.72.52:7789; } } 

fail logs

root@node51:~# sudo drbdadm --force create-md r0 open(/dev/sdb) failed: Device or resource busy Exclusive open failed. Do it anyways? *** confirmation forced via --force option *** open(/dev/sdb) failed: Device or resource busy Exclusive open failed. Do it anyways? *** confirmation forced via --force option *** md_offset 21474832384 al_offset 21474799616 bm_offset 21474144256 Found xfs filesystem 20971520 kB data area apparently used 20970844 kB left usable by current configuration Device size would be truncated, which would corrupt data and result in 'access beyond end of device' errors. You need to either * use external meta data (recommended) * shrink that filesystem first * zero out the device (destroy the filesystem) Operation refused. Command 'drbdmeta 1 v08 /dev/sdb internal create-md --force' terminated with exit code 40 root@node51:~# 
1
  • 2
    Avoid using DRBD in production. It’s a fragile solution prone to the brain split situations. We made a fortune migrating people off DRBD to the mature storage. Commented Sep 4, 2024 at 14:35

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.