LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 01-09-2003, 08:49 AM   #1
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Rep: Reputation: 58
How to unlink a directory that is not linked?


I created a mess with symlinks that I cannot clear now:

- moved a directory from /home/user1/somedir to /largestoragearea/somedir
- created a symlink to its old place (symlinked /largestoragearea/somedir to /home/user1/somedir), which was a big mistake, since /home is also a symlink to /usr/home on that machine
- also symlinked /largestoragearea/somedir to /home/user2/somedir (this was also a mistake of the same sort)
- when seeing the mistake I successfully removed one of the symlinks (/home/user2/somedir)

But now I am still faced with the folowing problems:
- /home/user1/somedir seems to be not existing (although it was never deleted)
- listing /largestoragearea shows that there is a symlink (/home/user1/somedir) pointing to /largestoragearea/somedir
- /home/user1/somedir cannot be removed (no such file error)
- the ownership of /largestoragearea/somedir can no longer be changed (by root!), it remains owned by the person who is the owner of the (not existing?) symlink /home/user1/somedir

So, how can I clear this mess up?
I.e. how to remove the symlink (/home/user1/somedir), that seems to be not existing on one hand (when trying to list or remove it), but seems to exist on the other hand (since it produces strange side effects as if it was existing).

Is it a file system error? How to correct it?

Last edited by J_Szucs; 01-09-2003 at 09:49 AM.
 
Old 01-09-2003, 09:24 AM   #2
niknah
Member
 
Registered: Dec 2002
Location: In front of a computer
Distribution: UPS, DHL, FedEx
Posts: 466

Rep: Reputation: 38
to list a symlink you got to use ls -ld

when trying to do something with the directory use tab to type out the directory instead, this may take care of any spaces or funny characters in the name of the directory.

it may even be a hdd error, type "dmesg" to see if there're any problems.
 
Old 01-09-2003, 09:41 AM   #3
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Original Poster
Rep: Reputation: 58
Ls -ld only shows the link to the parent directory (naturally), and the semi-existing symlink is not shown.

Dmesg does not show any errors.

But I checked that I still have that semi-existing symlink, and the ownership of the other directory still cannot be changed by root (the latter being the side effect).

Last edited by J_Szucs; 01-09-2003 at 09:54 AM.
 
Old 01-09-2003, 10:23 AM   #4
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Original Poster
Rep: Reputation: 58
Used fsck /largestoragearea and now an other strange thing occured:
It seemed to correct an error, but the only thing that happened is that the semi-existing symlink now points to /largestoragearea/somedir/somedir (previously it pointed to /largestoragearea/somedir).
 
Old 01-09-2003, 11:44 AM   #5
niknah
Member
 
Registered: Dec 2002
Location: In front of a computer
Distribution: UPS, DHL, FedEx
Posts: 466

Rep: Reputation: 38
are you using reiserfs? if so backup your stuff now, and you may have to reformat the disk. reiserfs is bit more complicated and doesn't fix itself well after fsck.

if you're using ext? then I don't know, maybe umount and run e2fsck -f until there's no errors.
 
Old 01-09-2003, 11:58 PM   #6
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Original Poster
Rep: Reputation: 58
It is not reiserfs (I use an other kind of unix there that must not be named at this forum).
The problem seems to be solved in the meantime: since the semi-existing symlink pointed to a surplus directory (not existing before) after the fsck, I risked to delete that directory and I succeeded.
 
  


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
konquerror error: you have linked konq to inode/directory ... Tarzan-81 Linux - Software 5 01-13-2006 06:04 AM
RM: Cannot Unlink margolik Linux - Software 0 04-17-2004 12:03 PM
Winxp linked to Linux Linked to home network OverboardKiller Linux - Networking 2 06-09-2003 10:59 AM
cannot unlink simon Linux - General 1 07-31-2001 08:25 PM
How to unlink a directory? _TK_ Linux - General 4 04-25-2001 09:32 PM


All times are GMT -5. The time now is 10:51 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration