public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC] Filesystem with multiple mount-points
@ 2004-05-02 13:24 Guennadi Liakhovetski
  2004-05-02 14:14 ` GNU/Dizzy
  2004-05-02 19:53 ` Denis Vlasenko
  0 siblings, 2 replies; 10+ messages in thread
From: Guennadi Liakhovetski @ 2004-05-02 13:24 UTC (permalink / raw)
  To: linux-kernel

Hi

Disclaimer: I am not a filesystem expert, so, what's below might be
absolute nonsense.

There are systems, where it is desirable to make some partitions,
possibly, including root, read-only, and some other, like, e.g., /var,
/home, /lib/modules read-writable. Those writable filesystems may be quite
small, so, putting them on separate partitions creates too much overhead
for filesystem metadata, journals... Making those directories soft-links
into one writable partition would work, but is not too nice.

So, how about adding a multiple mount-point option to some filesystem?
They would share metadata, journals, would be represented by several
directory-trees, and be mountable with, e.g.

mount -otree1 /dev/hda1 /var

or

mount /dev/hda1:1 /var

which, however, would be incompatible with older versions. /proc/mounts
would show something like

/dev/hda1:1 /var ...

df might just show tree1 - to maintain backwards compatibility. Later
mount and df could be tought to support this option natively.

Makes any sense at all?

Thanks
Guennadi
---
Guennadi Liakhovetski



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [RFC] Filesystem with multiple mount-points
  2004-05-02 13:24 [RFC] Filesystem with multiple mount-points Guennadi Liakhovetski
@ 2004-05-02 14:14 ` GNU/Dizzy
  2004-05-02 16:04   ` Sean Neakums
  2004-05-02 16:18   ` Guennadi Liakhovetski
  2004-05-02 19:53 ` Denis Vlasenko
  1 sibling, 2 replies; 10+ messages in thread
From: GNU/Dizzy @ 2004-05-02 14:14 UTC (permalink / raw)
  To: Guennadi Liakhovetski; +Cc: linux-kernel

On Sun, 2 May 2004, Guennadi Liakhovetski wrote:

> Hi
Hi

> 
> Disclaimer: I am not a filesystem expert, so, what's below might be
> absolute nonsense.
> 
> There are systems, where it is desirable to make some partitions,
> possibly, including root, read-only, and some other, like, e.g., /var,
> /home, /lib/modules read-writable. Those writable filesystems may be quite
> small, so, putting them on separate partitions creates too much overhead
> for filesystem metadata, journals... Making those directories soft-links
> into one writable partition would work, but is not too nice.
> 
> So, how about adding a multiple mount-point option to some filesystem?
> They would share metadata, journals, would be represented by several
> directory-trees, and be mountable with, e.g.

How about mounting the big volume somewhere and using -o bind to mount 
some paths within it in different places of your needs ? I know that -o 
bind doesnt honor -o ro yet but if you really needed maybe you can make a 
patch for that, I for one would be very interested about that.
check "man mount" about more information about "bind"

Also notice that linux (starting with some 2.3.x version if I remember 
well) already supports multiple mount points for a given "source" like
mount /dev/hda1 /mnt1
mount /dev/hda1 /mnt2 and so on

-- 
Mihai RUSU                                    Email: dizzy@roedu.net
GPG : http://dizzy.roedu.net/dizzy-gpg.txt    WWW: http://dizzy.roedu.net
                       "Linux is obsolete" -- AST

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [RFC] Filesystem with multiple mount-points
  2004-05-02 14:14 ` GNU/Dizzy
@ 2004-05-02 16:04   ` Sean Neakums
  2004-05-02 17:05     ` Herbert Poetzl
  2004-05-02 16:18   ` Guennadi Liakhovetski
  1 sibling, 1 reply; 10+ messages in thread
From: Sean Neakums @ 2004-05-02 16:04 UTC (permalink / raw)
  To: linux-kernel; +Cc: herbert

GNU/Dizzy <dizzy@roedu.net> writes:

> How about mounting the big volume somewhere and using -o bind to mount 
> some paths within it in different places of your needs ? I know that -o 
> bind doesnt honor -o ro yet but if you really needed maybe you can make a 
> patch for that, I for one would be very interested about that.

Herbert Poetzl's bind mount extensions should fit the bill here.
I am unsure of the current status of the patches, though.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [RFC] Filesystem with multiple mount-points
  2004-05-02 14:14 ` GNU/Dizzy
  2004-05-02 16:04   ` Sean Neakums
@ 2004-05-02 16:18   ` Guennadi Liakhovetski
  2004-05-02 16:28     ` viro
  1 sibling, 1 reply; 10+ messages in thread
From: Guennadi Liakhovetski @ 2004-05-02 16:18 UTC (permalink / raw)
  To: GNU/Dizzy; +Cc: linux-kernel

On Sun, 2 May 2004, GNU/Dizzy wrote:

> > for filesystem metadata, journals... Making those directories soft-links
> > into one writable partition would work, but is not too nice.
>
> How about mounting the big volume somewhere and using -o bind to mount
> some paths within it in different places of your needs ? I know that -o
> bind doesnt honor -o ro yet but if you really needed maybe you can make a
> patch for that, I for one would be very interested about that.
> check "man mount" about more information about "bind"
>
> Also notice that linux (starting with some 2.3.x version if I remember
> well) already supports multiple mount points for a given "source" like
> mount /dev/hda1 /mnt1
> mount /dev/hda1 /mnt2 and so on

See "not nice" above. With the proposed option I would like to avoid
having one file appear at multiple paths. IOW each file would appear in no
more than 1 place in the tree.

Guennadi
---
Guennadi Liakhovetski



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [RFC] Filesystem with multiple mount-points
  2004-05-02 16:18   ` Guennadi Liakhovetski
@ 2004-05-02 16:28     ` viro
  2004-05-02 17:58       ` Guennadi Liakhovetski
  0 siblings, 1 reply; 10+ messages in thread
From: viro @ 2004-05-02 16:28 UTC (permalink / raw)
  To: Guennadi Liakhovetski; +Cc: GNU/Dizzy, linux-kernel

On Sun, May 02, 2004 at 06:18:20PM +0200, Guennadi Liakhovetski wrote:
> See "not nice" above. With the proposed option I would like to avoid
> having one file appear at multiple paths. IOW each file would appear in no
> more than 1 place in the tree.

<shrug>

mount <whatever> /tmp/blah
mount --bind /tmp/blah/relative_path /desired_mountpoint
umount -l /tmp/blah

and you've got an exact equivalent of your "mount a subtree".

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [RFC] Filesystem with multiple mount-points
  2004-05-02 16:04   ` Sean Neakums
@ 2004-05-02 17:05     ` Herbert Poetzl
  0 siblings, 0 replies; 10+ messages in thread
From: Herbert Poetzl @ 2004-05-02 17:05 UTC (permalink / raw)
  To: linux-kernel

On Sun, May 02, 2004 at 05:04:52PM +0100, Sean Neakums wrote:
> GNU/Dizzy <dizzy@roedu.net> writes:
> 
> > How about mounting the big volume somewhere and using -o bind to mount 
> > some paths within it in different places of your needs ? I know that -o 
> > bind doesnt honor -o ro yet but if you really needed maybe you can make a 
> > patch for that, I for one would be very interested about that.
> 
> Herbert Poetzl's bind mount extensions should fit the bill here.
> I am unsure of the current status of the patches, though.

current status is simple, there are patches for
kernel 2.4 and 2.6 available, maybe a little outdated
but that should not be too hard to fix, if there is
some interest (so let me know ;).

I started to prepare those patches for inclusion
in mainline, but the first patch (atime) still has
not been included so I delayed the other patches,
because I do not want to walk an empty mile ...

best,
Herbert


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [RFC] Filesystem with multiple mount-points
  2004-05-02 16:28     ` viro
@ 2004-05-02 17:58       ` Guennadi Liakhovetski
  2004-05-02 22:10         ` Denis Vlasenko
  0 siblings, 1 reply; 10+ messages in thread
From: Guennadi Liakhovetski @ 2004-05-02 17:58 UTC (permalink / raw)
  To: viro; +Cc: Guennadi Liakhovetski, GNU/Dizzy, linux-kernel

On Sun, 2 May 2004 viro@parcelfarce.linux.theplanet.co.uk wrote:

> <shrug>
>
> mount <whatever> /tmp/blah
> mount --bind /tmp/blah/relative_path /desired_mountpoint
> umount -l /tmp/blah

Wow! I, actually, thought about it, but I didn't expect it to work right
now, I would expect the umount to fail with EBUSY... But it does work!
Guys, it rocks! The only slight inconvenience - mount still shows

/tmp/blah/relative_path /desired_mountpoint (bind)

which is not necessarily informative. A better display would be, perhaps

<whatever>:relative_path /desired_mountpoint (bind)

in /proc/mounts also not quite true:

<whatever> /desired_mountpoint

One might want to improve those...

Thanks
Guennadi
---
Guennadi Liakhovetski



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [RFC] Filesystem with multiple mount-points
  2004-05-02 13:24 [RFC] Filesystem with multiple mount-points Guennadi Liakhovetski
  2004-05-02 14:14 ` GNU/Dizzy
@ 2004-05-02 19:53 ` Denis Vlasenko
  1 sibling, 0 replies; 10+ messages in thread
From: Denis Vlasenko @ 2004-05-02 19:53 UTC (permalink / raw)
  To: Guennadi Liakhovetski, linux-kernel

On Sunday 02 May 2004 16:24, Guennadi Liakhovetski wrote:
> Hi
>
> Disclaimer: I am not a filesystem expert, so, what's below might be
> absolute nonsense.
>
> There are systems, where it is desirable to make some partitions,
> possibly, including root, read-only, and some other, like, e.g., /var,
> /home, /lib/modules read-writable. Those writable filesystems may be quite
> small, so, putting them on separate partitions creates too much overhead
> for filesystem metadata, journals... Making those directories soft-links
> into one writable partition would work, but is not too nice.

I use softlinks. It works 100%. I can run unlimited number
of NFS mounted diskless workstations. All of them have
ro root fs, can mount /usr ro or rw as needed.
/var, /tmp, /etc are always writable.

I use mount --bind for only one mountpoint,
everuthing else is handled by softlinks.

Why do you think it is not too nice?
--
vda


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [RFC] Filesystem with multiple mount-points
  2004-05-02 17:58       ` Guennadi Liakhovetski
@ 2004-05-02 22:10         ` Denis Vlasenko
  2004-05-04  1:35           ` Frank v Waveren
  0 siblings, 1 reply; 10+ messages in thread
From: Denis Vlasenko @ 2004-05-02 22:10 UTC (permalink / raw)
  To: Guennadi Liakhovetski, viro
  Cc: Guennadi Liakhovetski, GNU/Dizzy, linux-kernel

On Sunday 02 May 2004 20:58, Guennadi Liakhovetski wrote:
> On Sun, 2 May 2004 viro@parcelfarce.linux.theplanet.co.uk wrote:
> > <shrug>
> >
> > mount <whatever> /tmp/blah
> > mount --bind /tmp/blah/relative_path /desired_mountpoint
> > umount -l /tmp/blah
>
> Wow! I, actually, thought about it, but I didn't expect it to work right
> now, I would expect the umount to fail with EBUSY... But it does work!
> Guys, it rocks! The only slight inconvenience - mount still shows
>
> /tmp/blah/relative_path /desired_mountpoint (bind)
>
> which is not necessarily informative. A better display would be, perhaps
>
> <whatever>:relative_path /desired_mountpoint (bind)
>
> in /proc/mounts also not quite true:
>
> <whatever> /desired_mountpoint

You haven't symlinked /etc/mtab to /proc/mounts.
I always do it. Kernel knows better what is mounted, and where.
(at least supposed to know. You are right, currently /proc/mtab
is a bit not ok regarding bind mounts).

/etc/mtab is a historic userspace
hack for ancient Unix systems where kernel had no way to export
that info.
--
vda


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [RFC] Filesystem with multiple mount-points
  2004-05-02 22:10         ` Denis Vlasenko
@ 2004-05-04  1:35           ` Frank v Waveren
  0 siblings, 0 replies; 10+ messages in thread
From: Frank v Waveren @ 2004-05-04  1:35 UTC (permalink / raw)
  To: Denis Vlasenko; +Cc: linux-kernel

On Mon, May 03, 2004 at 01:10:00AM +0300, Denis Vlasenko wrote:
> You haven't symlinked /etc/mtab to /proc/mounts.
> I always do it. Kernel knows better what is mounted, and where.
It has it's charms, but you enter big-problem country once you start
doing stuff like mount -o loop.

-- 
Frank v Waveren                                      Fingerprint: 9106 FD0D
fvw@[var.cx|stack.nl] ICQ#10074100                      D6D9 3E7D FAF0 92D1
Public key: hkp://wwwkeys.pgp.net/8D54EB90              3931 90D6 8D54 EB90

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2004-05-04  1:35 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-02 13:24 [RFC] Filesystem with multiple mount-points Guennadi Liakhovetski
2004-05-02 14:14 ` GNU/Dizzy
2004-05-02 16:04   ` Sean Neakums
2004-05-02 17:05     ` Herbert Poetzl
2004-05-02 16:18   ` Guennadi Liakhovetski
2004-05-02 16:28     ` viro
2004-05-02 17:58       ` Guennadi Liakhovetski
2004-05-02 22:10         ` Denis Vlasenko
2004-05-04  1:35           ` Frank v Waveren
2004-05-02 19:53 ` Denis Vlasenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox