Welcome to Dream.In.Code
Become an Expert!

Join 149,924 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,932 people online right now. Registration is fast and FREE... Join Now!




Binding directories with mount

 
Reply to this topicStart new topic

> Binding directories with mount

Tom9729
Group Icon



post 4 Jan, 2008 - 11:12 PM
Post #1


Ever want to have a directory (and the files within it) available in a couple places at once? One solution is to use symbolic links, but since there's already a tutorial on that I'm going to cover another way to do it. smile.gif

You could "bind" the directory to multiple mount points.

For example, if you have directory X full of cool files, which you also want available in directories Y and Z, you could do the following commands.

CODE

su
mount --bind X Y
mount --bind X Z


If you use sudo, you would do.
CODE

sudo mount --bind X Y
sudo mount --bind X Z


It's easy (and useful)!

To unmount the directories, simply do.
CODE

su
umount Y
umount Z


Or if you use sudo.

CODE

sudo umount Y
sudo umount Z
Go to the top of the page
+Quote Post


Register to Make This Ad Go Away!


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 1/8/09 02:54PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month