cannot determine current directory

Hi,
when I execute some simple commands on my solaris system, I am getting the following warning message:

  Could anybody tell me what could be the reason

Ex:- If I give the command,
which ls
Warning: cannot determine current directory
/usr/bin/ls

Thanks in advance

please post the output from "df -h" or "df -k" maybe the /var filesystem is full....? and what is the output of "pwd"?

The output of df -k is:-

Filesystem kbytes used avail capacity Mounted on
/dev/md/dsk/d0 10332460 1607447 8621689 16% /
/proc 0 0 0 0% /proc
fd 0 0 0 0% /dev/fd
mnttab 0 0 0 0% /etc/mnttab
swap 11718104 8 11718096 1% /var/run
/dev/md/dsk/d40 5170926 1516632 3602585 30% /crash
/dev/md/dsk/d20 5170926 2650269 2468948 52% /tmp
/dev/md/dsk/d30 3080879 114518 2904744 4% /seos
/dev/md/dsk/d50 25817063 650972 24907921 3% /home
/dev/md/kplusintfsds/dsk/d0
10317788 811904 9402707 8% /home/applications
/dev/md/kplusintfsds/dsk/d10
25800247 10126982 15415263 40% /files_local
/dev/md/kplusintfsds/dsk/d20
15115195 1471029 13493015 10% /kreditnet
/dev/md/kplusintfsds/dsk/d30
10317788 134825 10079786 2% /kpatches
/dev/md/kplusintfsds/dsk/d40
25195256 7123432 17819872 29% /dump
/dev/md/kplusintfsds/dsk/d50
25195256 3878854 21064450 16% /proddump

If i give, man ls command,it is displaying error message as
getcwd: Permission denied

If i run the commands from the (/) file system, they are working fine
whereas If i run commands from my directory it is giving the above error messages.

Thanks for ur response

your filesystem is fine.. seems like some rights problem occure....

There is one scenario where this can happen.
You are in a directory. And somebody else might have deleted the directory without your knowledge.

Change to a different directory and try.

yeah, you are right... or a filesystem ist unmountet without your knowledge...

My directory still exists. If I go to a different directory it is working.
How to check whether the file system is unmounted or
mounted with wrong permissions.

Thanks

Let's say that when in /home/fred you cannot run pwd. Do:
ls -ld /
ls -ld /home
ls -ld /home/fred

and

cd / ; /usr/bin/pwd
cd /home ; /usr/bin/pwd
cd /home/fred ; /usr/bin/pwd

and you should be able to see where the problem is. You need read and search permission on all directories down to / to run a pwd.

unmount the filesystem
chmod 755 the mount point
remount the filesystem

ie:
If the problem was with /home/applications I would.

cd /
umount /home/applications
chmod 755 /home/applications
mount /home/applications

Hi Perderabo

Following is the o/p after executing the commands. BUT I couldn't find where the problem is. How should I know what the problem is.

I logged is as tibco user id.

tibco@kplus_int [/home/applications] > man ls
getcwd: Permission denied
tibco@kplus_int [/home/applications] > ls -ld /
drwxr-xr-x 29 root root 1024 Nov 8 16:02 /
tibco@kplus_int [/home/applications] > ls -ld /home
drwxr-xr-x 25 root root 512 Oct 9 10:57 /home
tibco@kplus_int [/home/applications] > ls -ld /home/applications
drwxrwxr-x 4 tibco tibco 512 May 7 2003 /home/applications
tibco@kplus_int [/home/applications] > cd /;/usr/bin/which ls
/usr/bin/ls
tibco@kplus_int [/] > cd -
/home/applications
tibco@kplus_int [/home/applications] > cd /
tibco@kplus_int [/] > cd /home;/usr/bin/which ls
/usr/bin/ls
tibco@kplus_int [/home] > cd /home/applications;/usr/bin/which ls
Warning: cannot determine current directory
/usr/bin/ls
tibco@kplus_int [/home/applications] >

Thanks

I hate to seem picky, but I asked for "cd /; /usr/bin/pwd". You somehow changed that to "cd /; /usr/bin/which ls". In this case that was good enough to determine where the problem is. But you need to follow directions more closely. A wild fumble can be disasterous. Note that
cd /home;/usr/bin/which ls
succeeded. But then
cd /home/applications;/usr/bin/which ls
failed. This is the clue that the problem is indeed which /home/applications. You need to follow the procedure that Tornado gave. But follow it exactly.

This is really a bug in Solaris. In every other Unix version the permissions on the hidden mountpoint do not matter. But it has been this way for years and Sun does not seem inclined to fix it.

Hi Perderabo

It seems U have mistaken me. 'pwd' command is working fine in all the directories that's why I chose 'which' command so that I can better explain the errorneous situation.

If U observe all my postings, From the beginning(2nd posting), I knew that the culprit is /home/applications and its subdirs. BUT when I checked the perms, everything seems O.K.

So, I couldn't pin point where exactly the prob. is. I don't know that it is a BUG in solaris.

Anyway thanks 4 all ur suggestions.

pwd != /usr/bin/pwd

The shell's internal pwd is not useful in this case.

U r correct, I checked with /usr/bin/pwd.

If U don't mind, Can U throw some more light on the foll.

In which situations,we get this error (cannot determine current directory!), Bec'se perms seems O.K. on all dirs down to /.

The problem is not with the permisions on the mounted filesystem, but with the permisions on the mount point.

Once you have unmounted /home/applications have a look at the permisions on the /home/applications directory before you run chmod 755 /home/applications

Thanks Tornado & Perderabo

I knew some new things with this problem

Thanks a lot once again