Gopi Desaboyina Solaris Blogs

Just another WordPress.com weblog

df: failed to open /etc/mnttab: Permission denied

User’s can’t run df -k and gets below error.

non-root-user@system$ df -k
df: failed to open /etc/mnttab: Permission denied

non-root-user@system$ ls -l /etc/mnttab
-r–r—–   6 root     root        3584 Jul 17 06:07 /etc/mnttab

Try to change the permissions using root id. will get below error.
root# id
uid=0(root) gid=0(root)

root# chmod 444 /etc/mnttab
chmod: WARNING: can’t change /etc/mnttab

Cause for the Problem :
   This problem happens when at one point of time when users booted of CD-ROM or failsafe changed the permissions on /etc/mnttab inadvertently.

Fix :
1. Boot of CDROM. mount the root slice on /a & do chmod 444 /a/etc/mnttab
  (Or)
2.  On Running system.
    # mkdir -m 755 /alt-root
    # mount -F lofs -o nosub / /alt-root #lofs as / as /alt-root
    # chmod 444 /alt-root/etc/mnttab
    # umount /alt-root
    # ls -l /etc/mnttab
    -r–r–r– 4 root root 2485 Jul 7 08:53 /etc/mnttab
    # rmdir /alt-root

There you go.

Advertisements

August 29, 2011 - Posted by | Solaris

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: