LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Cannot delete directory: non empty because a crazy symlink (https://www.linuxquestions.org/questions/programming-9/cannot-delete-directory-non-empty-because-a-crazy-symlink-933759/)

rfsleal 03-10-2012 09:58 AM

Cannot delete directory: non empty because a crazy symlink
 
Hi there:

On trying to remove a directory the system complaints that either it is not empty, or it's not a directory, or it does not exist.

When doing the directory listing it alternatively gives:

Code:

rleal@steele:~> ls -lai
ls: cannot access .ENX: Not a directory
total 0
1107332729 drwx------ 2 rleal users 0 Mar  8 20:46 .
  49931132 drwx------ 3 rleal users 0 Mar 10 16:38 ..
        ? l????????? ? ?    ?    ?            ? .ENX

rleal@steele:~> ls -lai
ls: cannot read symbolic link .ENX: Not a directory
total 0
1107332729 drwx------ 2 rleal users 0 Mar  8 20:46 .
  49931132 drwx------ 3 rleal users 0 Mar 10 16:38 ..
1107528392 lrwxrwxrwx 1 rleal users 4 Mar  6 21:47 .ENX

No matter how I try to remove the file, it always complaints with the not a directory message:

Code:

rleal@steele:~> find . -inum 1107528392 -exec rm -rf {} \;
find: `./.ENX': Not a directory

The file system is a Iomega StorCcenter ix2 locally mounted on a cifs share. Also tried sshfs and even access from a DO$ console to no avail.
Any ideas?

Tnkx

anomie 03-10-2012 11:26 AM

Quote:

Originally Posted by rfsleal
The file system is a Iomega StorCcenter ix2 locally mounted on a cifs share.

Try deleting it from the host (Iomega / Windows-based?) system instead.

looop 03-10-2012 02:14 PM

Same answer as anomie
But also try using sudo before rm and - instead of using recursive remove (-r) try only with force (-f)

rfsleal 03-11-2012 02:17 PM

No way as sudo. However the host runs a 2.6.31.8 linux. I could login as root on a ssh shell and got rid of the whole directory tree.

Thanks for your help!


All times are GMT -5. The time now is 02:38 AM.