I confirmed this is how lsblk
output looks on AlmaLinux 8.5 when using external meta-data with DRBD. The DRBD device is only a single virtual block device layered over both partitions in your setup.
It works as expected. If you inspect the block devices using other methods/utilities you'll see that you only have a single /dev/drbd0
, and the metadata partition you created is the size you'd expect.
For example, my configuration using two LVM volumes:
resource r0 {
protocol C;
startup {
wfc-timeout 15;
degr-wfc-timeout 60;
}
net {
cram-hmac-alg sha1;
shared-secret "SECRET_KEY";
}
on Server1{
device /dev/drbd0;
disk /dev/drbdpool/data; # 1GiB lvm on /dev/sdb
meta-disk /dev/drbdpool/meta; # 4MiB lvm on /dev/sdb
192.168.1.11:7788;
}
on Server2{
device /dev/drbd0;
disk /dev/drbdpool/data; # 1GiB lvm on /dev/sdb
meta-disk /dev/drbdpool/meta; # 4MiB lvm on /dev/sdb
192.168.1.12:7788;
}
Shows exactly what I'd expect in /proc/partitions
:
# cat /proc/partitions
major minor #blocks name
8 0 20480000 sda
8 1 2048000 sda1
8 2 18430976 sda2
8 16 8388608 sdb
253 0 4096 dm-0
253 1 1048576 dm-1
147 0 1048576 drbd0
blockdev --report
looks good too:
# blockdev --report /dev/drbd0
RO RA SSZ BSZ StartSec Size Device
rw 256 512 4096 0 1073741824 /dev/drbd0
# blockdev --report /dev/drbdpool/meta
RO RA SSZ BSZ StartSec Size Device
rw 8192 512 4096 0 4194304 /dev/drbdpool/meta
# blockdev --report /dev/drbdpool/data
RO RA SSZ BSZ StartSec Size Device
rw 8192 512 4096 0 1073741824 /dev/drbdpool/data
This is likely where lsblk
is getting confused:
# cat /sys/block/drbd0/size
2097152
# cat /sys/block/dm-0/size
8192
# cat /sys/block/dm-1/size
2097152
# cat /sys/block/dm-0/holders/drbd0/size
2097152
# cat /sys/block/dm-1/holders/drbd0/size
2097152