HOWTO: Correct Permissions of a Covered Mount Point Without Remounting

/howto-correct-permissions-of-a-covered-mount-point-without-remounting 2009-07-07T12:26:00+01:00

There is a very old bug in Solaris (now fixed in Nevada) in which the underlying permissions of a mount point affect the overlying mounted filesystem. The normal way to resolve this is to umount the filesystem, correct the permission and remount it.

This is sometime easier said than done, for example, what if one of those filesystems is actually still in use, or even a critical OS filesystem like /var or /etc/mnttab. You don't really want to be umounting these whilst they're in use and the fix may involve booting from network or CD into single user mode.

Well, there is an easier and relatively unknown method of correcting this...

  1. Create a temporary directory in which we'll be performing our permissions correcting:
    # mkdir -m 755 /fixmnt
  2. Loopback mount the root filesystem onto your new directory using the lesser known "nosub" option:
    # mount -F lofs -o nosub / /fixmnt
  3. Correct the permissions of your problem underlying directory, eg /etc/mnttab:
    # chmod 444 /fixmnt/etc/mnttab
  4. Umount the temporary loopback mount and remove the temporary directory:
    # umount /fixmnt
    # rmdir /fixmnt

The permissions on your mount point should now be correct and your desired behaviour should return, all without losing access to the filesystem and without a reboot.

Copyright © 2005 - 2021 Colin Seymour All rights reserved. Privacy Policy.
Check out the feed if you do the RSS/Atom thing.