2003-07-23 19:25:32

by Johannes Ahlmann

[permalink] [raw]
Subject: directory inclusion in ext2/ext3

hi,

i have been looking for the possibility to display the contents of several
directories in another one, but have so far not found anything suitable.

the two possibilites i considered so far were:

- soft-linking all files one by one, but then changes in a linked file
(renaming, moving, deleting, ...) won't be noticed by the soft-links.
- LVM: exactly what i want as functionality but too low-level. i don't need
any device merging, striping, mirroring, but just want to be able to link
directory-contents.

i think it shouldn't be so hard to implement something similar to
softlinks in ext2 that allows directories to have something like an
include-directive to display contents of other directories as well.

hope this ain't too naive :-))

Johannes


2003-07-23 19:49:21

by Scott McDermott

[permalink] [raw]
Subject: Re: directory inclusion in ext2/ext3

[email protected] on Wed 23/07 21:36 +0200:
> i have been looking for the possibility to display the
> contents of several directories in another one, but have
> so far not found anything suitable.

This sounds like Al Viro's unionfs if I'm not mistaken.

2003-07-23 20:08:35

by Johannes Ahlmann

[permalink] [raw]
Subject: Re: Re: directory inclusion in ext2/ext3

Scott McDermott <vaxerdec () frontiernet ! net> on 2003-07-23 20:04:26:

>> i have been looking for the possibility to display the
>> contents of several directories in another one, but have
>> so far not found anything suitable.

>This sounds like Al Viro's unionfs if I'm not mistaken.

well, not really. unionfs is close because with a "mount -o bind" and
additive mounting my problem would be solved, but what i'm looking for is a
very high-level solution. as i said, my idea of solving this is to have an
inclusion directive in directory-files...

has nobody ever felt the lack of such functionality??

Johannes

2003-07-24 00:39:27

by Mike Fedyk

[permalink] [raw]
Subject: Re: directory inclusion in ext2/ext3

On Wed, Jul 23, 2003 at 10:22:24PM +0200, [email protected] wrote:
> well, not really. unionfs is close because with a "mount -o bind" and
> additive mounting my problem would be solved, but what i'm looking for is a
> very high-level solution. as i said, my idea of solving this is to have an
> inclusion directive in directory-files...
>
> has nobody ever felt the lack of such functionality??

I guess not.

What exactly does this help you to do?

What do you want to accomplish?

2003-07-24 01:09:14

by Grant Miner

[permalink] [raw]
Subject: Re: directory inclusion in ext2/ext3

I would also like this enhancement. Plan 9 is built around this
feature, and it does it as an int argument 'flag' to mount, such that
'flag' may be (these are defined in a header):

MREPL: Replace the old file by the new one. Henceforth, an evaluation of
old will be translated to the new file. If they are directories (for
mount, this condition is true by definition), old becomes a union
directory consisting of one directory (the new file).

MBEFORE: Both the old and new files must be directories. Add the
constituent files of the new directory to the union directory at old so
its contents appear first in the union. After an MBEFORE bind or mount,
the new directory will be searched first when evaluating file names in
the union directory.

MAFTER: Like MBEFORE but the new directory goes at the end of the union.

In addition, there is an MCREATE flag that can be OR'd with any of the
above. When a /create /system call (see /open/(2))
<http://plan9.bell-labs.com/magic/man2html/2/open> attempts to create in
a union directory, and the file does not exist, the elements of the
union are searched in order until one is found with MCREATE set. The
file is created in that directory; if that attempt fails, the /create
/fails.
...
(from http://plan9.bell-labs.com/magic/man2html/2/bind )

Further rationale can be provided if desired; just ask.

2003-07-24 03:33:52

by Johannes Ahlmann

[permalink] [raw]
Subject: Re: directory inclusion in ext2/ext3

On Thu, 24 Jul 2003 03:00:17 +0200 Mike Fedyk wrote:
>> my idea of solving this is to have
>> an inclusion directive in directory-files...
>>
>> has nobody ever felt the lack of such functionality??

> What exactly does this help you to do?
> What do you want to accomplish?

hmm, i have a lot of huge files on different hard drives and wish to access
them in a uniform fashion. i would like to sort ALL files in subdirectories
but have no need for an LVM, RAID or similar. for example:

/mnt/drive1/category1
/mnt/drive1/category2
/mnt/drive2/category1
/mnt/drive2/category2

(the data is so huge, that it is not possible to always merge categories on a
single disk!)
what i would like to do now is to be able to display all files of "cat1" and
"cat2" respectively in "/mnt/union/category1" and "/mnt/union/category2". yet
i don't wish to simply link the directories as this would complicate access
with growing number of hard drives the data is spread on!

it's a bit weird to explain, i hope it's understandable now :-)))

Johannes

2003-07-24 08:21:52

by Ihar 'Philips' Filipau

[permalink] [raw]
Subject: Re: directory inclusion in ext2/ext3

Mike Fedyk wrote:
> On Wed, Jul 23, 2003 at 10:22:24PM +0200, [email protected] wrote:
>
>>well, not really. unionfs is close because with a "mount -o bind" and
>>additive mounting my problem would be solved, but what i'm looking for is a
>>very high-level solution. as i said, my idea of solving this is to have an
>>inclusion directive in directory-files...
>>
>>has nobody ever felt the lack of such functionality??
>
> I guess not.
>
> What exactly does this help you to do?
>
> What do you want to accomplish?

How can you make /home & /opt from one fs to appear together with
/usr from another fs?

Symlinks? A lot of distros & apps do not support this because of
references like '../../../bin/echo'.
And sometimes one may need to do references like this. Symlinks do
not help... :-(((

2003-07-25 16:55:19

by Mike Fedyk

[permalink] [raw]
Subject: Re: directory inclusion in ext2/ext3

On Thu, Jul 24, 2003 at 05:48:34AM +0200, Johannes Halmann wrote:
> On Thu, 24 Jul 2003 03:00:17 +0200 Mike Fedyk wrote:
> >> my idea of solving this is to have
> >> an inclusion directive in directory-files...
> >>
> >> has nobody ever felt the lack of such functionality??
>
> > What exactly does this help you to do?
> > What do you want to accomplish?
>
> hmm, i have a lot of huge files on different hard drives and wish to access
> them in a uniform fashion. i would like to sort ALL files in subdirectories
> but have no need for an LVM, RAID or similar. for example:
>
> /mnt/drive1/category1
> /mnt/drive1/category2
> /mnt/drive2/category1
> /mnt/drive2/category2
>
> (the data is so huge, that it is not possible to always merge categories on a
> single disk!)
> what i would like to do now is to be able to display all files of "cat1" and
> "cat2" respectively in "/mnt/union/category1" and "/mnt/union/category2". yet
> i don't wish to simply link the directories as this would complicate access
> with growing number of hard drives the data is spread on!
>
> it's a bit weird to explain, i hope it's understandable now :-)))

Yes, I understand a little better.

But it just looks more like a good use for LVM than before.

You don't want the redundancy of raid, and are always adding space, so LVM
should be perfect for you.

Just use a nice filesystem that resizes easily, (or even online (while
mounted, etc)), and you're set.

Mike