Page 1 of 1

Binding directories with mount Rate Topic: -----

#1 Tom9729   User is offline

  • Segmentation fault
  • member icon

Reputation: 181
  • View blog
  • Posts: 2,642
  • Joined: 30-December 07

Posted 05 January 2008 - 12:12 AM

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. :)

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.

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

If you use sudo, you would do.
sudo mount --bind X Y
sudo mount --bind X Z

It's easy (and useful)!

To unmount the directories, simply do.
umount Y
umount Z

Or if you use sudo.

sudo umount Y
sudo umount Z

Is This A Good Question/Topic? 0
  • +

Page 1 of 1