Skip to content

FST: Load DevMap lookup possible symlink from /etc/mtab

Erich Birngruber requested to merge fst_load_readlink into master

When using linux device-mapper (i.e. multipath or LVM), the entries in /etc/mtab can be paths of symlinks (for the device file). We need to lookup the original file to get the matching device name in /proc/diskstats Otherwise this will prevent the Load metrics in the FS status to be populated. Missing load values:

# eos fs status 26 | grep stat.disk
stat.disk.bw                     := 209
stat.disk.iops                   := 69
stat.disk.load                   := 0.000000
stat.disk.readratemb             := 0.000000
stat.disk.writeratemb            := 0.000000

Example for lookup:

# eos fs ls 26
┌────────────────────────┬────┬──────┬────────────────────────────────┬────────────────┬────────────────┬────────────┬──────────────┬────────────┬────────┬────────────────┐
│host                    │port│    id│                            path│      schedgroup│          geotag│        boot│  configstatus│       drain│  active│          health│
└────────────────────────┴────┴──────┴────────────────────────────────┴────────────────┴────────────────┴────────────┴──────────────┴────────────┴────────┴────────────────┘
 fst-1.eos.grid.vbc.ac.at 1095     26                /srv/data/data.25       default.25 vbc::rack1::pod1       booted             rw      nodrain   online        no mdstat 

[fst-1 ~]$ grep data.25 /etc/mtab
/dev/mapper/mpathz /srv/data/data.25 xfs rw,seclabel,noatime,attr2,inode64,noquota 0 0
[fst-1 ~]$ readlink -f /dev/mapper/mpathz
/dev/dm-26
[fst-1 ~]$ grep mpathz /proc/diskstats  # no result
[fst-1 ~]$ grep dm-26  /proc/diskstats  # yay!
 253      26 dm-26 632294481 72075 555096328649 2559147745 34045806 9492085 24661149400 2008628536 15 1917717979 269117835

Merge request reports