How to test if DRBD MD is already on backing disk

Hi all,

Is there / what is the command to test to see if a DRBD signature / metadata exists on a backing disk?


Would this be a valid test?

[root@vm-a01n02 ~]# drbdadm get-gi srv01-test 
[root@vm-a01n02 ~]# drbdadm wipe-md srv01-test 

Do you really want to wipe out the DRBD meta data?
[need to type 'yes' to confirm] yes

Wiping meta data...
DRBD meta data block successfully wiped out.
[root@vm-a01n02 ~]# drbdadm get-gi srv01-test 
[root@vm-a01n02 ~]# 

That is, no output from get-gi being empty be a valid test to see if creating the MD is needed?

I think using drbdmeta and basing the the test case off of the output of one of the sub commands might be safer. That way there is no way to accidentally wipe something.

What would be the drbdmeta command be, if I may ask? As for the wipe-md call, that was just to show why the output changed in my example. :slight_smile:

My line of thinking was to do something like use drbdmeta with the get-gi or show-gi parameters and use that to see if there is metadata - since that has no chance of wiping any existing metadata.