Broken stats with filesystem check on Logical Volume

Issue #629 closed
jetchko created an issue

If you set filesystem check on logical volume you cant see any stats showing up.

In case of LVs simple call to realpath(3) (from brief look into the source) doesn't work.

Example:

check filesystem var path /var

with /var being a LV:

mount | grep var

/dev/mapper/main-var on /var type ext3 (rw,relatime,data=ordered)

leads to following error:

filesystem statistic error: cannot read /sys/class/block/main-var/stat -- No such file or directory

In case of logical volumes you have to translate LV's name to kernel device name (dm-?) first.

Comments (9)

  1. jetchko reporter

    Hm I see why you ask this. On Redhat/Fedora/Debian systems these lvm devices point to relevant kernel device mapper names. So to clarify, this Gentoo Linux and there is either some kernel CONFIG option involved(missing) or its something more subtle ...

    When I looked closely on this box I have device nodes under /dev/mapper not links to the relevant dm-? nodes ...

    Sorry to bother you with this ... I will try to investigate and see what exactly and why is "wrong" on this particular gentoo box. I am OK if you choose to close this bug.

  2. Tildeslash repo owner

    Yep ... there is something strange with the platform - we test on CentOS, Ubuntu and Debian and it works fine there.

    Example of LVM mount from Debian (other tested platforms work the same way):

    $ mount
    /dev/mapper/debian8--x64--vg-root on / type ext4 (rw,relatime,errors=remount-ro,data=ordered)
    
    $ ls -l /dev/mapper/debian8--x64--vg-root
    lrwxrwxrwx 1 root root 7 Jun 16 16:33 /dev/mapper/debian8--x64--vg-root -> ../dm-0
    

    Monit resolves the device to dm-0 and gets statistics without problem.

  3. jetchko reporter

    Yep, your question about platform got me curious and I checked several dozens different boxes .... Only Gentoo Linux boxes behave in that strange way (no surprize here as they all share similar conf). anyway:

    $ mount
    /dev/mapper/main-var on /var type ext3 (rw,relatime,data=ordered)
    
    $ ls -l /dev/mapper/main-var
    brw------- 1 root root 253, 1 Jun 16 17:45 /dev/mapper/main-var
    
    $ ls /sys/class/block/
    dm-0  dm-1  dm-2  dm-3  dm-4  loop0  loop1  loop2  loop3  vda  vda1  vda2  vda3
    
  4. Tildeslash repo owner

    Thanks for data ... gentoo obviously creates a standalone mapper device, instead of symlink to device mapper device like other platforms. Will install gentoo and try reproduce the problem (will take some time as we're currently busy with other tasks).

  5. jetchko reporter

    You will need a lot of time to install Gentoo Linux(at least compared to the binary distributions). Not a good exercise for people on tight schedule ;). Plus I have suspicion which I am going to test. These Gentoo boxes are really old install (I installed them 15+ years ago IIRC) and although they are kept up to date there are technologies in use which are totally outdated. So I suspect gentoo's fork of udev which is in use currently (forked because of these ideological wars against systemd) misbehaves.

    So I am going to convert one of these boxes to systemd because I want to satisfy my curiosity. If I am right I am going to convert the rest.

  6. jetchko reporter

    So my suspicions were right. After switching to systemd everything is OK.

    You can close this issue. Sorry for the noise. :)

  7. Log in to comment