Operating System - HP-UX
1748205 Members
4696 Online
108759 Solutions
New Discussion

pwd and cd .. not working in C shell. (pwd: I/O error)

 
SOLVED
Go to solution
VKV
Advisor

pwd and cd .. not working in C shell. (pwd: I/O error)

Hi HP-UX gurus,

 

User “is3adm” is using c shell. The directory /sapmnt/IS3/exe is on an NFS mount

 

server:is3adm 149> cd

server:is3adm 150> pwd

/home/is3adm

server:is3adm 151> cd /sapmnt/IS3/exe

server:is3adm 152> pwd

pwd: I/O error

server:is3adm 153> cd ..

..: I/O error

server:is3adm 154> ls -la /sapmnt/IS3/exe |head -4

/sapmnt/IS3/exe/.. not found

total 2955364

drwxrwxrwx   5 is3adm     sapsys        5120 Jun  5 15:18 .

-rwxr-xr-x   1 is3adm     sapsys      747834 Jan 14 18:34 ABAP.pad

-rwxr-xr-x   1 is3adm     sapsys     20523167 Jan 16 05:29 ITS.SAR

 

The same user when using ksh is not facing any problem other than the ..(parent directory) is not getting listed.

 

$ pwd

/home/is3adm

$ cd /sapmnt/IS3/exe

$ pwd

/sapmnt/IS3/exe

 

$ ls -la /sapmnt/IS3/exe |head -4

/sapmnt/IS3/exe/.. not found

total 2955364

drwxrwxrwx   5 is3adm     sapsys        5120 Jun  5 15:18 .

-rwxr-xr-x   1 is3adm     sapsys      747834 Jan 14 18:34 ABAP.pad

-rwxr-xr-x   1 is3adm     sapsys     20523167 Jan 16 05:29 ITS.SAR

 

 

{root@server:/}ls -ld /sapmnt/IS3

drwxr-xr-x   7 is3adm     sapsys        1024 Jun  5 14:46 /sapmnt/IS3

 

I could not make out whether this has to do something with c shell or with the NFS/NFS mount directory permissions. Could you please help?

7 REPLIES 7
Dennis Handly
Acclaimed Contributor

Re: pwd and cd .. not working in C shell. (pwd: I/O error)

>The same user when using ksh is not facing any problem

 

This user isn't inventive enough.  ;-)

Using "pwd -P" or /usr/bin/pwd will also fail.

 

>I could not make out whether this has to do something with C shell or with the NFS/NFS mount directory permissions.

 

It's not the scummy C shell this time.  ;-)  Other than it does things the wrong way.

Something is wrong with NFS.

VKV
Advisor

Re: pwd and cd .. not working in C shell. (pwd: I/O error)

> Using "pwd -P" or /usr/bin/pwd will also fail.

Yes Dennis, pwd with both the options fail and specifying the absolute path has not worked either.


> It's not the scummy C shell this time.
The reason why I suspected C shell first is that  $cwd was holding the right value of pwd even on NFS mounts.
But I could see that pwd is giving problem only with NFS mounted directories. For local file systems it is working OK.


I could not unmount/remount and check as it is a production env :(

Dennis Handly
Acclaimed Contributor
Solution

Re: pwd and cd .. not working in C shell. (pwd: I/O error)

>The reason why I suspected C shell first is that  $cwd was holding the right value of pwd even on NFS mounts.

 

Probably the same reason $PWD works in a real shell.  It remembers the last cd directory.

 

>But I could see that pwd is giving problem only with NFS mounted directories.

 

All?  Or just some of them?

>I could not unmount/remount and check as it is a production env :(

 

Sure you can, fix it.  Just use fire to fight fire.  Just export / with root as root and quickly, look/change the permission.

http://h30499.www3.hp.com/t5/System-Administration/pwd-command-not-working-in-a-particular-directory/td-p/5249094

http://h30499.www3.hp.com/t5/System-Administration/change-file-permission-on-nfs-mount-point/td-p/4484096

 

VKV
Advisor

Re: pwd and cd .. not working in C shell. (pwd: I/O error)

> All?  Or just some of them?

 

Well at least all on this particular server.

 

> Sure you can, fix it.  Just use fire to fight fire.  Just export / with root as root and quickly, look/change the permission.

 

Really love this idea. But am I asking for trouble here? Is there anything that go wrong?  I know it is not fair to ask but have you tried this anytime?


Dennis Handly
Acclaimed Contributor

Re: pwd and cd .. not working in C shell. (pwd: I/O error)

>but have you tried this anytime?

 

Of course.  You will have to unexport it after you have changed the permission.

VKV
Advisor

Re: pwd and cd .. not working in C shell. (pwd: I/O error)

Thank you Dennis.


I unmounted and changed the mount point permissions to dr-xr-xr-x and pwd is working now.
I got a 15 mins downtime so I have not tried the “fight fire with fire” approach :)

 
However when I checked the mount point after the FS  was unmounted I saw drwxr-xr-x.
Could you please explain how removing that write permission made pwd work ?

Dennis Handly
Acclaimed Contributor

Re: pwd and cd .. not working in C shell. (pwd: I/O error)

>I got a 15 mins downtime so I have not tried the “fight fire with fire” approach :)

 

You could play with it any time.  :-)


>However when I checked the mount point after the FS was unmounted I saw drwxr-xr-x.
>Could you please explain how removing that write permission made pwd work?

 

That's unexpected.  ??

Unless it was changed to fix the problem and the unmount and mount really fixed it?