Question : df: cannot statvfs (mounting permission problems)
When I’m as root, I see all my partitions. When I’m as test user, I get these errors
# df -k
Filesystem kbytes used avail capacity Mounted on
/proc 0 0 0 0% /proc
/dev/dsk/c0t0d0s0 963979 48229 857912 6% /
/dev/dsk/c0t0d0s4 1984175 833739 1090911 44% /usr
fd 0 0 0 0% /dev/fd
/dev/dsk/c0t0d0s1 721751 117039 546972 18% /var
/dev/dsk/c0t0d0s5 3009655 397982 2551480 14% /export
/dev/dsk/c0t0d0s6 963979 17016 889125 2% /export/home
/dev/dsk/c0t0d0s7 8742181 7402003 1252757 86% /opt
df: cannot statvfs /opt/test/1: Permission denied
df: cannot statvfs /opt/test/2: Permission denied
df: cannot statvfs /opt/test/3: Permission denied
/dev/dsk/c0t1d0s3 963979 21 906120 1% /var/log
Also /opt looks mounted, but when I got there, I get a permission denied
# cd /opt
/opt: Permission denied
I have several such machines, and this is the only one giving me problems.
/opt/test/1 /opt/test/2 /opt/test/3 are on a separate hard disk but that hard disk looks healthy when I type format
io1# more /etc/vfstab
#device device mount FS fsck mount mount
#to mount to fsck point type pass at boot options
#
#/dev/dsk/c1d0s2 /dev/rdsk/c1d0s2 /usr ufs 1 yes –
fd – /dev/fd fd – no –
/proc – /proc proc – no –
/dev/dsk/c0t0d0s3 – – swap – no –
/dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0 / ufs 1 no –
/dev/dsk/c0t0d0s4 /dev/rdsk/c0t0d0s4 /usr ufs 1 no –
/dev/dsk/c0t0d0s1 /dev/rdsk/c0t0d0s1 /var ufs 1 no –
/dev/dsk/c0t0d0s5 /dev/rdsk/c0t0d0s5 /export ufs 2 yes –
/dev/dsk/c0t0d0s6 /dev/rdsk/c0t0d0s6 /export/home ufs 2 yes –
/dev/dsk/c0t0d0s7 /dev/rdsk/c0t0d0s7 /opt ufs 2 yes –
/dev/dsk/c0t1d0s1 /dev/rdsk/c0t1d0s1 /opt/test/1 ufs 2 yes –
/dev/dsk/c0t1d0s0 /dev/rdsk/c0t1d0s0 /opt/test/2 ufs 2 yes –
/dev/dsk/c0t1d0s4 /dev/rdsk/c0t1d0s4 /opt/test/3 ufs 2 yes –
/dev/dsk/c0t1d0s3 /dev/rdsk/c0t1d0s3 /var/log ufs 2 yes –
#format
Searching for disks…done
AVAILABLE DISK SELECTIONS:
0. c0t0d0
/pci@1f,0/pci@1,1/scsi@4,1/sd@0,0
1. c0t1d0
/pci@1f,0/pci@1,1/scsi@4,1/sd@1,0
Anyone knows what the problem may be here?? Or some suggestions where I could check??
Solution: df: cannot statvfs (mounting permission problems)
> df: cannot statvfs /opt/test/1: Permission denied
> df: cannot statvfs /opt/test/2: Permission denied
> df: cannot statvfs /opt/test/3: Permission denied
— man statvfs —
statvfs() fails if one or more of the following are true:
EACCES Search permission is denied on a component of the path prefix.
—–
So do
$ ls -al /opt/test/
to see the permission on those 3 mounted filesystems.
Maybe is not readable for “test user”.