LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-10-2012, 09:58 AM   #1
rfsleal
LQ Newbie
 
Registered: Jan 2009
Posts: 6

Rep: Reputation: 0
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
 
Old 03-10-2012, 11:26 AM   #2
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
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.
 
Old 03-10-2012, 02:14 PM   #3
looop
Member
 
Registered: Oct 2011
Location: Denmark
Distribution: Fedora, Ubunut, macOS Mojave, RedHat, OpenBSD
Posts: 78

Rep: Reputation: Disabled
Same answer as anomie
But also try using sudo before rm and - instead of using recursive remove (-r) try only with force (-f)
 
Old 03-11-2012, 02:17 PM   #4
rfsleal
LQ Newbie
 
Registered: Jan 2009
Posts: 6

Original Poster
Rep: Reputation: 0
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!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to delete all empty folders rjo98 Linux - Newbie 3 06-07-2010 11:01 AM
Delete folder not empty C++ ohmygoth Programming 4 12-05-2009 09:40 PM
vi delete empty line? Junior_DBA Linux - Newbie 5 09-11-2008 03:21 PM
Can't Delete Directory SymLink Luvz2Fly Linux - Newbie 2 12-05-2006 12:45 PM
Delete Empty files whospeaks2me Linux - Newbie 2 07-18-2003 10:39 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration