/etc/mtab a symlink to /proc/mounts

  • ejones71

    If /etc/mtab is a symlink to /proc/mounts then the quota-tools fail  because /proc/mounts doesn't display the usrquota and grpquota filesystem mount options. This is a kernel bug in the filesystem code that was recently fixed.

    I have a patch for quota-tools that falls back to using /etc/fstab if /etc/mtab is a sym-link when scanning for quota enabled filesystems. Is there a better solution? Upgrading to a new kernel is not possible at this time.

    I should mention that we are running a cluster environment with a read-only root filesystem. That is why /etc/mtab is a symlink.

    • Jan Kara
      Jan Kara

      I don't like patching the tools very much as the kernel is already fixed in this aspect (so in a proper fix we'd have to also check the kernel version in order to not bite anyone with a new kernel and that starts to be hacky). A possible solution for you (apart from patching tools yourself / kernel update) might be to have /etc/mtab linked to some file in a writable directory (e.g. in /tmp). Second possible fix should be to not have /etc/mtab at all. Quota tools will currently fallback to /etc/fstab and mount should handle that fine too.