Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
soft link and mounting with bind option
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
sram
n00b
n00b


Joined: 27 Mar 2004
Posts: 45

PostPosted: Mon Feb 27, 2006 3:37 am    Post subject: soft link and mounting with bind option Reply with quote

What is the difference between these two. mainly from their usage point of view and if you could, implementation also.

thanx in advance
Back to top
View user's profile Send private message
platojones
Veteran
Veteran


Joined: 23 Oct 2002
Posts: 1602
Location: Just over the horizon

PostPosted: Mon Feb 27, 2006 8:04 am    Post subject: Reply with quote

With a bind mount, a filesystem (or part of a file system) can be mounted in multiple places. A soft (or symbolic) link simply creates a reference to another file or directory. I don't really know what you have in mind, but the main difference would be how they are managed: with ln or with mount. In practice, they seem to accomplish much the same thing. I don't think a bind mount can mount a standard file, for instance, but you can create a soft link to one. From a management standpoint, mounts are globally visible and can be managed through fstab, where links are local to their locations. Another consideration would be if you wanted to detect a soft link. Many standard utilities take soft links into account (such as cp and tar, which can discriminate between a soft link and a real directory and act according to the flags you've set). Here's a good article on bind mounts, btw:

http://www-128.ibm.com/developerworks/library/l-fs3.html#g01
Back to top
View user's profile Send private message
nephros
Advocate
Advocate


Joined: 07 Feb 2003
Posts: 2139
Location: Graz, Austria (Europe - no kangaroos.)

PostPosted: Tue Mar 21, 2006 7:26 pm    Post subject: Reply with quote

platojones wrote:
I don't think a bind mount can mount a standard file, for instance, but you can create a soft link to one.

Actually you can.
From man mount:
Quote:
Since Linux 2.4.0 it is possible to remount part of the file hierarchy somewhere
else. The call is
mount --bind olddir newdir
After this call the same contents is accessible in two places. One can also
remount a single file (on a single file).

_________________
Please put [SOLVED] in your topic if you are a moron.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum