I admit I am in the experimental stage at this point, but as I read the documentation, this shouldn't be a problem. I am configuring DRBD over LVM.
As I understand the drbd00.res file, I should be accessing the device as /dev/drbd00. But, that device does not exist. Instead, /dev/drbd0 exists. However, when I mkfs -t xfs on /dev/drbd0, the status goes to Diskless on the next boot. My steps are as follows:
pvcreate /dev/sdc1
vgcreate shared1 /dev/sdc1
lvcreate --name shared1 -l 100%FREE shared1
drbdadm create-md drbd00
systemctl start drbd
drbdadm primary drbd00 --force
(wait for sync)
[root@linclust1 ~]# mkfs -t xfs /dev/shared1/shared1
mkfs.xfs: cannot open /dev/shared1/shared1: Device or resource busy
[root@linclust1 ~]# mkfs -t xfs /dev/drbd0
meta-data=/dev/drbd0 isize=256 agcount=4, agsize=1310422 blks
= sectsz=512 attr=2, projid32bit=1
= crc=0 finobt=0, sparse=0
data = bsize=4096 blocks=5241687, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal log bsize=4096 blocks=2560, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
(wait for sync)
[root@linclust1 ~]# cat /proc/drbd
version: 8.4.5 (api:1/proto:86-101)
srcversion: 1AEFF755B8BD61B81A0AF27
0: cs:Connected ro:Primary/Secondary ds:UpToDate/UpToDate C r-----
ns:20977322 nr:0 dw:10574 dr:20970957 al:7 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0
The I reboot and it goes to Diskless.
[root@linclust1 ~]# cat /proc/drbd
version: 8.4.5 (api:1/proto:86-101)
srcversion: 1AEFF755B8BD61B81A0AF27
0: cs:Connected ro:Secondary/Secondary ds:Diskless/UpToDate C r-----
ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0
Here is the drbd00.res file:
resource drbd00 {
device /dev/drbd00;
disk /dev/shared1/shared1; <=== This is an lvm device
meta-disk internal;
syncer {
verify-alg sha1;
}
on linclust1.localdomain {
address 192.168.31.101:7789;
}
on linclust2.localdomain {
address 192.168.31.102:7789;
}
}