[DRBD-user] 4Kib backing stores -> virtual device sector size ?

Roberts, Keith Keith.Roberts at Teledyne.com
Wed Nov 18 02:45:00 CET 2020


Hi Community

I am currently using two production servers with
kmod-drbd90-9.0.20-1.el7_7.elrepo.x86_64 on the 512 byte server + latest Centos7
kmod-drbd90-9.0.22-2.el7_8.elrepo.x86_64 on the 4Kib server. (couple of month old Centos7)

Something seems to have changed.  In the past independent of the 4Kib sector size the drbd virtual device presented a hw_sector_size of 512 bytes.  I am now seeing it spontaneously change to 4KiB when connected to a host with 4KiB backing store enterprise drive.

Step 1 create drbd resource on both systems.
Step 2 on 512 byte sector server make it primary and check /sys/block/drbd4/queue/hw_sector_size it is 512 bytes
Step 3 use drive all is fine with 512 byte physical sector size.
Step 4 Make it secondary and make it primary on other server.  Check /sys/block/drbd4/queue/hw_sector_size on other server = 4096 bytes.
Step 4 Switch back to primary on original server now sector size has switched to 4096 bytes and drive is unusable as the sector disk label is not handled correctly.

Where I saw this issue was I gpt labeled a drive in 512 byte mode and then it became unreadable once the driver flipped it to being a 4096 byte sector.

I am very wary of changing anything (e.g. upgrading consistent versions) without understanding the mechanism as I don't want to corrupt other volumes that are currently operating as 512 byte sectors without a problem.

I do not see any calls to blk_queue_hardsect_size in the drbd driver so I don't know what is changing the sector size to 4096 to reflect the local backing store but I would really like to understand what drives this as it does not appear to be backward compatible.

The config for drbd
resource aaa {
        device minor 4 ;
               net {
                              protocol C;
                              cram-hmac-alg sha1;
                              shared-secret "SECRET";
               }
               disk {
                              resync-rate 500M;
               }
               on abc.yyy {
                              volume 0 {
                                             disk      /dev/vg_abc/aaa_backing;
                                             meta-disk internal;
                              }
                              address   def:123;
                              node-id 0;
               }
               on def.yyy  {
                              volume 0 {
                                             disk      /dev/vg_def/aaa_backing;
                                             meta-disk internal;
                              }
                              address   abc:123;
                              node-id 2;
               }
        syncer {
                verify-alg "crc32c";
        }
}
Regards

Keith Roberts





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linbit.com/pipermail/drbd-user/attachments/20201118/a9841fff/attachment.htm>


More information about the drbd-user mailing list