You are not logged in.

#1 2008-01-08 10:42:50

ledet
Member
From: Aalborg, Denmark
Registered: 2007-11-22
Posts: 38

mount --bind bind two directories to one mountpoint [SOLVED]

Hi

I have 3 directories, files1, files2 and files. I would like to 'mount --bind' files1 and files2 in files, so that when you enter files you see the contents of both files1 and files2. Is this possible and how do I do it smile

Thank you in advance

/ledet

Last edited by ledet (2008-01-08 15:14:54)

Offline

#2 2008-01-08 12:25:33

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: mount --bind bind two directories to one mountpoint [SOLVED]

mount --bind allows access to one set of files from two different mount points. You want to access two sets of files from one mount point, so you need to use unionfs or aufs. Both are supported by the Arch kernel package.

Offline

#3 2008-01-08 13:03:32

ledet
Member
From: Aalborg, Denmark
Registered: 2007-11-22
Posts: 38

Re: mount --bind bind two directories to one mountpoint [SOLVED]

Thanks! I'll take a look at aufs

Offline

#4 2008-01-08 13:32:52

ledet
Member
From: Aalborg, Denmark
Registered: 2007-11-22
Posts: 38

Re: mount --bind bind two directories to one mountpoint [SOLVED]

Installed aufs and aufs-utils. Got it working with this command:

mount -t aufs -o dirs=/path/to/files1:/path/to/files2 none /path/to/files

To mount the dirs automatically, I added this line to fstab:

none    /path/to/files     aufs    dirs=/path/to/files1:/path/to/files2 0 0

Offline

#5 2008-01-08 14:10:53

Cerebral
Forum Fellow
From: Waterloo, ON, CA
Registered: 2005-04-08
Posts: 3,108
Website

Re: mount --bind bind two directories to one mountpoint [SOLVED]

I think this is one of the best "asking for help" threads I've seen. 

A question was asked, a starting-point was given, the potential solution researched by the questioner, and then the final solution posted by the OP so that anyone else looking for this answer will have it.

Awesome.

Offline

#6 2008-01-08 14:38:30

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: mount --bind bind two directories to one mountpoint [SOLVED]

Not yet completed....no solved statement in title....


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#7 2008-01-08 14:52:38

lloeki
Member
From: France
Registered: 2007-02-20
Posts: 456
Website

Re: mount --bind bind two directories to one mountpoint [SOLVED]

Cerebral, not to mention the crystal clear title chosen, the 'thanks' post, and the minimality of post counts in that case (4).

lilsirecho, yes, so close to perfection... once one marks it solved, I'll make a snapshot of it!

Last edited by lloeki (2008-01-08 14:53:38)


To know recursion, you must first know recursion.

Offline

#8 2008-01-08 15:15:30

ledet
Member
From: Aalborg, Denmark
Registered: 2007-11-22
Posts: 38

Re: mount --bind bind two directories to one mountpoint [SOLVED]

Is it okay now smile

Offline

#9 2008-01-08 15:24:14

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: mount --bind bind two directories to one mountpoint [SOLVED]

w00t!!


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#10 2008-01-08 15:59:25

Wilson Phillips
Member
From: Vicksburg, MS, USA
Registered: 2007-09-24
Posts: 70

Re: mount --bind bind two directories to one mountpoint [SOLVED]

You gotta love it when a great plan comes together.

High Fives all around. No. We are not doing the group hug thing!


Guarantee does not cover shark bite, bear attack, or children under 5.

Offline

#11 2012-11-10 14:06:30

solar
Member
Registered: 2011-03-01
Posts: 77

Re: mount --bind bind two directories to one mountpoint [SOLVED]

group lending of hands then?


I am hilariously insane. yup. you won't notice though.. I promise...I think.

Offline

#12 2012-11-10 19:47:03

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: mount --bind bind two directories to one mountpoint [SOLVED]

A four year necrobump and an empty post?

Please don't do that
https://wiki.archlinux.org/index.php/Fo … Bumping.27

Closing


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB