filesystem statistics error -- cannot parse device '/dev/gpt/rootfs'

Issue #666 resolved
Former user created an issue

Hi,

we use the FreeBSD 11.0-RELEASE-p12 port on OPNsense 17.7.2-amd64.

When activating the rootfs check, our logs get spammed wiht the following message

filesystem statistics error -- cannot parse device '/dev/gpt/rootfs'

The status itself seems to be ok. Here're some more details: https://github.com/opnsense/plugins/issues/265

I also reported this on https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=222312

Hopefully someone could help here!

Cheers,

Stephan

Comments (5)

  1. Stephanowicz

    The log error gets generated in src/device/sysdep_FREEBSD.c @ line 115

    the code expects at least one digit in the devicename, which is not the case for '/dev/gpt/rootfs'

    // Parse the device path like /dev/da0p2 into name:instance -> da:0
    static boolean_t _parseDevice(const char *path, Device_T device) {
            const char *base = File_basename(path);
            for (int i = 0; base[i]; i++) {
                    if (isdigit(*(base + i))) {
                            strncpy(device->key, base, i < sizeof(device->key) ? i : sizeof(device->key) - 1);
                            device->instance = Str_parseInt(base + i);
                            return true;
                    }
            }
            LogError("filesystem statistics error -- cannot parse device '%s'\n", path);
            return false;
    }
    
  2. Christos Chatzaras

    I have monit 5.24 and FreeBSD 11.1 and get this:

    Oct  4 10:37:12 server4 monit[90215]: filesystem statistics error -- cannot parse device '/dev/mirror/gm0p2'
    Oct  4 10:37:12 server4 monit[90215]: filesystem statistics error -- cannot parse device '/dev/mirror/gm0p4'
    Oct  4 10:37:12 server4 monit[90215]: filesystem statistics error -- cannot parse device '/dev/mirror/gm0p5'
    Oct  4 10:37:12 server4 monit[90215]: filesystem statistics error -- cannot parse device '/dev/mirror/gm0p6'
    Oct  4 10:37:12 server4 monit[90215]: filesystem statistics error -- cannot parse device '/dev/mirror/gm0p7'
    Oct  4 10:37:12 server4 monit[90215]: filesystem statistics error -- cannot parse device '/dev/mirror/gm0p8'
    

    I think the issue started with monit 5.24

  3. Tildeslash repo owner

    @CyberCr33p the problem with partition mirrors (#672) is fixed ... monit 5.24.0 worked fine with whole-disk mirrors, when the mirror consisted of partitions only, monit failed to find the parent disks.

  4. Log in to comment