The usual way to update the ownerships and/or permissions of an actual mountpoint directory is to unmount the filesystem, then update its attributes and then re-mount it back to its original location. However this is not always possible or desireable. Instead following workaround can be used on a live mountpoint.

Example mountpoint: /var

This can be done by temporarily sharing the / via NFS and re-mouting the mountpoint in a temporary location:

# share -F nfs -o rw,anon=0 /

# mkdir /mnt
# mount <server>:/ /mnt

Then update permissions and/or ownerships:

# chown root:sys /mnt/var
# chmod 700 /mnt/var

Finally unshare the /:

# unshare -F nfs /

Leave a comment