Verifying DRBD consistency

As long as the DRBD resource is consistent, you can take the snapshot on secondary, as well as the primary.  Since DRBD resources are normally not available on the secondary, this provides some interesting capabilities!  However, this technique is equally valid on the primary or the secondary.

To confirm that the resource is consistent, first verify that the resource is up-to-date:

cat /proc/drbd

This will produce output similar to the following:

version: 8.3.13 (api:88/proto:86-96)
built-in
0: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r-----
ns:304891 nr:304477 dw:609657 dr:4045961 al:17 bm:11 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0
1: cs:Connected ro:Secondary/Primary ds:UpToDate/UpToDate C r-----
ns:2929256 nr:3673432 dw:6603812 dr:194718 al:266 bm:100 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0
2: cs:Connected ro:Secondary/Primary ds:UpToDate/UpToDate C r-----
ns:693064 nr:858716 dw:1552124 dr:1756 al:55 bm:60 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0
3: cs:Connected ro:Secondary/Primary ds:UpToDate/UpToDate C r-----
ns:1033328 nr:1284088 dw:2317780 dr:192771 al:106 bm:65 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0
4: cs:Connected ro:Secondary/Primary ds:UpToDate/UpToDate C r-----
ns:1316384 nr:1640468 dw:2957156 dr:10180 al:85 bm:37 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0
5: cs:Connected ro:Secondary/Primary ds:UpToDate/UpToDate C r-----
ns:827124 nr:1078992 dw:1906452 dr:6980 al:72 bm:66 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0
6: cs:Connected ro:Primary/Secondary ds:UpToDate/UpToDate C r-----
ns:1350524 nr:840 dw:1351640 dr:142680 al:96 bm:59 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0

Verify that the resource is up-to-date by looking for the UpToDate flag for the resource.  If the resource is not up-to-date ('Inconsistent') you still may be able to create a snapshot as shown below, but your data will not be current.  If you want a current snapshot, you'll need to first make sure your DRBD resource is consistent, before continuing.