LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Can't get rid of "Stale NFS file handle" (https://www.linuxquestions.org/questions/linux-software-2/cant-get-rid-of-stale-nfs-file-handle-684475/)

disciplepup 11-18-2008 11:04 PM

Can't get rid of "Stale NFS file handle"
 
I've got something showing up in my /mnt directory that I can't figure out how to get rid of. If I try to delete it, I get, "ERROR: Stale NFS file handle"
I've tried googling it, but the only solution I can find is "remount and then unmount your NFS server". The trouble is that I don't have any NFS servers - it was a mountpoint for a squashfs file. Trying to remount the squashfile just gives the same error message. My best guess for how it was created is that maybe the file was deleted while mounted.
Surely there is a way I can get rid of it? It stuffs up my system by e.g. preventing find from working.

Thanks.


BTW I'm running Puppy Linux 4.1.1, although I suspect that is irrelevant :)

MensaWater 11-20-2008 08:21 AM

I haven't used Squashfs but nothing I saw on their page made me think it would use NFS for any reason.

The fact you're seeing this in /mnt but haven't directly mounted anything there as NFS suggests its part of your automounter configuration. Have a look at the files in /etc/auto* and see if you have any special mounts configured there.

Have you tried rebooting by the way? The stale nfs occurs usually because the host that exported the filesystem is no longer accessible (often because that host got rebooted). Rebooting your local system would remove the mount and if the other host isn't accessible even if its in automounter setup you should no longer have stale condition since it simply would fail to mount it.

disciplepup 11-20-2008 11:46 PM

It's mounted with a script that does `mount -o loop -t squashfs /path/to/file /mnt/mntpoint` - I don't have any automounter.
Yes, I have rebooted, but as I said, there are no NFS hosts, so something weirder must have happened.

BTW normally even if I delete or replace a file that is mounted I don't get this problem - I just need to run scandisk to see the new free space :)

penguin123 12-07-2008 01:31 PM

Stale NFS file handle (but i'm not using nfs)
 
Same problem here, check this out... I got this after a system crash on debian lenny; after which i've reinstalled the root partition but kept /home (which is on a different partition).
fsck.ext3 says that /home is clean...



igi:~$ ls -l
ls: cannot access bin: Stale NFS file handle
ls: cannot access PICTURES_nortel_tmp: Stale NFS file handle
total 78568
d????????? ? ? ? ? ? bin
d????????? ? ? ? ? ? PICTURES_nortel_tmp
drwxr-xr-x 2 penguin penguin 4096 2008-11-22 23:06 TESTATICA
-rw-r--r-- 1 penguin penguin 31395624 2008-12-03 16:25 test.avi
-rw-r--r-- 1 penguin penguin 14698436 2008-12-04 15:36 test_divx_mp3.avi
-rw-r----- 1 penguin penguin 4240419 2008-11-19 22:43 toolsdev.tar.bz2
-rw-r--r-- 1 penguin penguin 5366 2008-10-19 13:29 tourpart7.html
drwxr-xr-x 10 penguin penguin 12288 2008-12-04 23:25 UNIX_HELP



Notice the weired directories with: d?????????
These dirs give me the: "Stale NFS file handle" error

igi:~$ rm -rf PICTURES_nortel_tmp
rm: cannot remove `PICTURES_nortel_tmp': Stale NFS file handle



Can't remove them or "ls -l" them or anything else (neither as root or when booted from a live distro, etc...)

Any insight on solving this issue (other than salvaging whats left on the /home partition and then recreating a new partition and or the file system) would be appreciated

penguin123 12-07-2008 07:44 PM

Solved it:

Even though the first time i did fsck.ext3 on the home partition.... it said it was clean but then when i tried with "force"... it found a bunch of "problems". after fsck finished (and i had to press "y" <yes> a few hundred times... it got rid (deleted the weired directories with: "Stale NFS file handle")

umount /dev/hde
fsck.ext -f /dev/hde


All times are GMT -5. The time now is 03:46 AM.