LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Link Problems (https://www.linuxquestions.org/questions/linux-newbie-8/link-problems-745470/)

kantu 08-06-2009 12:35 AM

Link Problems
 
I use CentOs 5.3 and in it NTFS is not auto mounted so i will mount when required in /media
Now i made a link to /media and placed it on my desktop using this
Code:

[kantu@localhost Desktop]$ ln -s -T /media/ Media
This worked fine and now i have a shortcut. But the problem is in /media directory ,this link is present in /media also and is infinite i think
Code:

[kantu@localhost media]$ ls
downloads        Friends 3..4,5  Media  music        vuze
Friend1 2 3(10)  games          misc  SRIKANTH_13  windowsxp
 

[kantu@localhost Media]$ pwd
/media/Media/Media/Media/Media/Media/Media/Media/Media/Media/Media/Media/Media/Media/Media/Media/Media

It goes on if i keep giving cd Media
What went wrong ?
All i wanted was a shortcut to /media directory so as to easily access all my windows drives


(And one more thing i noticed though i created the link as a normal user the file needs root permissions to delete )

alan_ri 08-06-2009 04:01 AM

You shouldn't mount it in the /media directory, you should do it in the /mnt directory. For example in the /mnt/ntfs.

Try to do it like I've said with;
Code:

ln -s -n /mnt/ntfs windows
/media directory - Mount points for removable media such a CD-ROMs

/mnt directory - Temporarily mounted filesystems

Note that ls denotes symbolic links with an arrow after the name, pointing to the name of the target file;
Code:

$ mkdir -p /tmp/one/two
$ echo "test_a" >/tmp/one/two/a
$ echo "test_b" >/tmp/one/two/b
$ cd /tmp/one/two
$ ls -l
-rw-r--r-- 1 user group 7 Jan 01 10:01 a
-rw-r--r-- 1 user group 7 Jan 01 10:01 b
$ cd /tmp
$ ln -s /tmp/one/two three
$ ls -l /tmp/three
lrwxrwxrwx 1 user group 12 Jul 22 10:02 /tmp/three -> /tmp/one/two
$ ls -l /tmp/three/
-rw-r--r-- 1 user group 7 Jan 01 10:01 a
-rw-r--r-- 1 user group 7 Jan 01 10:01 b


kantu 08-06-2009 05:47 AM

That did it .Thanks a lot
I checked the link in /media
well only one link was there which said it was broken .
But why is it under root ?

alan_ri 08-07-2009 02:01 AM

I don't use Rad Hat/CentOS, I never did and I'm not sure if I remember correctly but in Red Hat you have to have root privileges for almost everything.

Quick Google search gave me this.

Quote:

-o acl allows manipulating file ACLs. If a file system is mounted without the -o acl mount option, users are allowed to view ACLs (with getfacl), but are not allowed to set them (with setfacl).
That's why I like simple distros. :D

The link you've said, well of course it's broken because target doesn't exist anymore and as I said, I guess you have to be root to delete it.

[EDIT]

Well it looks like you've already find out what I was trying to say;

Quote:

Posted by kantu;

(And one more thing i noticed though i created the link as a normal user the file needs root permissions to delete )


All times are GMT -5. The time now is 06:48 AM.