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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
01-09-2003, 07:49 AM
|
#1
|
|
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:
|
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 08:49 AM.
|
|
|
|
01-09-2003, 08:24 AM
|
#2
|
|
Member
Registered: Dec 2002
Location: In front of a computer
Distribution: UPS, DHL, FedEx
Posts: 465
Rep:
|
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.
|
|
|
|
01-09-2003, 08:41 AM
|
#3
|
|
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:
|
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 08:54 AM.
|
|
|
|
01-09-2003, 09:23 AM
|
#4
|
|
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:
|
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).
|
|
|
|
01-09-2003, 10:44 AM
|
#5
|
|
Member
Registered: Dec 2002
Location: In front of a computer
Distribution: UPS, DHL, FedEx
Posts: 465
Rep:
|
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.
|
|
|
|
01-09-2003, 10:58 PM
|
#6
|
|
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:
|
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.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 11:26 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|