Re: pwd and cd .. not working in C shell. (pwd: I/O error) (2963 Views)
Reply
Advisor
VKV
Posts: 17
Registered: ‎07-14-2011
Message 1 of 8 (3,051 Views)
Accepted Solution

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?

Acclaimed Contributor
Dennis Handly
Posts: 25,198
Registered: ‎03-06-2006
Message 2 of 8 (3,047 Views)

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.

Advisor
VKV
Posts: 17
Registered: ‎07-14-2011
Message 3 of 8 (3,024 Views)

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 :(

Acclaimed Contributor
Dennis Handly
Posts: 25,198
Registered: ‎03-06-2006
Message 4 of 8 (3,014 Views)

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...

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

 

Advisor
VKV
Posts: 17
Registered: ‎07-14-2011
Message 5 of 8 (3,002 Views)

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?


Acclaimed Contributor
Dennis Handly
Posts: 25,198
Registered: ‎03-06-2006
Message 6 of 8 (2,997 Views)

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.

Advisor
VKV
Posts: 17
Registered: ‎07-14-2011
Message 7 of 8 (2,980 Views)

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 ?

Acclaimed Contributor
Dennis Handly
Posts: 25,198
Registered: ‎03-06-2006
Message 8 of 8 (2,963 Views)

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?

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.