Get additional detail out of /proc/drbd (8.4 only)

A more verbose version of /proc/drbd does exist. Here is how you enable it.

Level 0 (default)

[root@cent7a ~]# echo 0 > /sys/module/drbd/parameters/proc_details 

[root@cent7a ~]# cat /proc/drbd
version: 8.4.12-1 (api:1/proto:86-101)
GIT-hash: 92ebfa800c157f488744bf5b13e40e1787b818cd build by @buildsystem, 2020-10-01 13:29:21
0: cs:Connected ro:Primary/Secondary ds:UpToDate/UpToDate C r-----
ns:102400 nr:0 dw:102400 dr:3156 al:25 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0

Level 1

[root@cent7a ~]# echo 1 > /sys/module/drbd/parameters/proc_details 

[root@cent7a ~]# cat /proc/drbd
version: 8.4.12-1 (api:1/proto:86-101)
GIT-hash: 92ebfa800c157f488744bf5b13e40e1787b818cd build by @buildsystem, 2020-10-01 13:29:21
0: cs:Connected ro:Primary/Secondary ds:UpToDate/UpToDate C r-----
ns:102400 nr:0 dw:102400 dr:3156 al:25 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0
resync: used:0/61 hits:0 misses:0 starving:0 locked:0 changed:0
act_log: used:0/1237 hits:175 misses:125 starving:0 locked:0 changed:25

Level 2

[root@cent7a ~]# echo 2 > /sys/module/drbd/parameters/proc_details 

[root@cent7a ~]# cat /proc/drbd
version: 8.4.12-1 (api:1/proto:86-101)
GIT-hash: 92ebfa800c157f488744bf5b13e40e1787b818cd build by @buildsystem, 2020-10-01 13:29:21
0: cs:Connected ro:Primary/Secondary ds:UpToDate/UpToDate C r-----
ns:102400 nr:0 dw:102400 dr:3156 al:25 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0
resync: used:0/61 hits:0 misses:0 starving:0 locked:0 changed:0
act_log: used:0/1237 hits:175 misses:125 starving:0 locked:0 changed:25
blocked on activity log: 0

Notes:

A brief explanation of some of the additional fields this provides.

The resync hits and misses counters are related to the "resync extents" which 
is how DRBD locks regions for resync to avoid confusion with concurrent application writes.
I can't think of a situation where they would ever be useful to anyone except for LINBIT
developers. The act_log hits/misses are referring to how many written blocks have been a
part of the blocks that make up the activity log versus anywhere outside of it.
Again, not information that is useful to end users, and we have removed "/proc/drbd" from
DRBD 9 for these reasons.

Edited on 2021/12/14 - DJV