Unable to remove directory foo/foobar: File exists

Unable to remove directory foo/foobar: File exists

Post by see_my_sig » Mon, 12 Jan 2004 05:45:29


I tried removing a package for the SunPCi IIpro card using pkgrm, but
whilst it removed okay, but there remained some files in the directory
used for this package. I thought I'd try removing them, but the things
will not budge no matter what I try.

sparrow / # rm -rf /opt/SUNWspci2
rm: Unable to remove directory /opt/SUNWspci2/defaults/WIN2K: File
exists
rm: Unable to remove directory /opt/SUNWspci2/defaults/WIN2K.NTFS:
File exists
rm: Unable to remove directory /opt/SUNWspci2/defaults/WIN98: File
exists
rm: Unable to remove directory /opt/SUNWspci2/defaults/WINME: File
exists
rm: Unable to remove directory /opt/SUNWspci2/defaults/WINNT: File
exists
rm: Unable to remove directory /opt/SUNWspci2/defaults/WINNT.NTFS:
File exists
rm: Unable to remove directory /opt/SUNWspci2/defaults/WINXP: File
exists
rm: Unable to remove directory /opt/SUNWspci2/defaults/WINXP.NTFS:
File exists
and so on.

If I try to change to the directory /opt/SUNWspci2/defaults/WIN2K, I
see nothing there.

sparrow /opt/SUNWspci2/defaults/WIN2K # ls -la
total 6
drwxr-xr-x 4 root bin 512 Jan 10 20:22 .
drwxr-xr-x 10 root bin 1536 Jan 10 20:22 ..

but I can't delete this directory.

sparrow /opt/SUNWspci2/defaults/WIN2K # cd ..
sparrow /opt/SUNWspci2/defaults # rm -rf WIN2K
rm: Unable to remove directory WIN2K: File exists

/opt is local, mounted on the root system. I've tried rebooting the
machine, but still I can't remove them.

Any suggestions ?
 
 
 

Unable to remove directory foo/foobar: File exists

Post by Tom Hal » Mon, 12 Jan 2004 06:46:46

On 10 Jan 2004 12:45:29 -0800,
XXXX@XXXXX.COM (Dr. David Kirkby)



You probably have some filesystem corruption. I would try running
'fsck' (with the filesystem umounted, of course) ...


Regards,

Tom Hall < XXXX@XXXXX.COM >

 
 
 

Unable to remove directory foo/foobar: File exists

Post by waaly » Tue, 13 Jan 2004 02:13:19

----------------------------------------------------------------------------

Try to check if the ls you're using is an alias or it's /usr/bin/ls

Regards
Waleed Saber

----------------------------------------------------------------------------
 
 
 

Unable to remove directory foo/foobar: File exists

Post by waaly » Tue, 13 Jan 2004 02:43:12

----------------------------------------------------------------------------


Have you tried this with the root user, or normal user ?
May be you don't have read permission for these directories, so you
can cd to the directory but you cannot list the files in the directory



Best Regards
Waleed Saber


-----------------------------------------------------------------------------
 
 
 

Unable to remove directory foo/foobar: File exists

Post by Derkjan de » Thu, 15 Jan 2004 05:12:15


"Dr. David Kirkby" < XXXX@XXXXX.COM > wrote



I have had the same once, on a filesystem which had UFS logging enabled. I
unmounted the filesystem, ran fsck, then mounted the filesystem. After that
I was able to delete the directories.


regards,

Derkjan