Re: equivalent of Linux mount -o bind

2011-02-02 Thread travis+ml-openbsd-misc
On Fri, Jan 28, 2011 at 03:52:53PM -0800, Travis H. wrote:
 So I'm curious if there's something in OpenBSD that's similar to the
 mount -o bind /dir1 /dir2 to make dir1 appear where dir2 is.

For those who asked, one sample use is for something like this:

Starting with the 2.4-series Linux kernels, it has been possible to
mount a filesystem simultaneously in two different places. Aha! you
might think, as I did. Then surely we can mount the backups read-only
in /snapshot, and read-write in /root/snapshot at the same time!

Alas, no. Say your backups are on the partition /dev/hdb1. If you run
the following commands,

mount /dev/hdb1 /root/snapshot
mount --bind -o ro /root/snapshot /snapshot

then (at least as of the 2.4.9 Linux kernel--updated, still present in
the 2.4.20 kernel), mount will report /dev/hdb1 as being mounted
read-write in /root/snapshot and read-only in /snapshot, just as you
requested. Don't let the system mislead you!

In the example above, the second mount call will cause both of the
mounts to become read-only, and the backup process will be unable to
run. Scratch this one.

Update: I have it on fairly good authority that this behavior is
considered a bug in the Linux kernel, which will be fixed as soon as
someone gets around to it. If you are a kernel maintainer and know
more about this issue, or are willing to fix it, I'd love to hear from
you!
--
Effing the ineffable since 1997. | http://www.subspacefield.org/~travis/
My emails do not usually have attachments; it's a digital signature
that your mail program doesn't understand.
If you are a spammer, please email j...@subspacefield.org to get blacklisted.

[demime 1.01d removed an attachment of type application/pgp-signature]



Re: equivalent of Linux mount -o bind

2011-02-02 Thread Kevin Chadwick
On Wed, 2 Feb 2011 09:13:04 -0800
travis+ml-openbsd-m...@subspacefield.org wrote:

 I have it on fairly good authority that this behavior is
 considered a bug in the Linux kernel

So what's wrong with user rights and what exactly is the use of this
(when this bug is fixed) apart from for confusion especially when adding
lines of possibly buggy code to the kernel?

Strange, in an attempt to answer a question that as far as I can see
no-one asked you've made me ask the question you attempted to answer???




Re: equivalent of Linux mount -o bind

2011-02-02 Thread john slee
On 3 February 2011 03:13,  travis+ml-openbsd-m...@subspacefield.org wrote:
 Update: I have it on fairly good authority that this behavior is
 considered a bug in the Linux kernel, which will be fixed as soon as
 someone gets around to it. If you are a kernel maintainer and know
 more about this issue, or are willing to fix it, I'd love to hear from
 you!

I'd suggest that

(a) an OpenBSD mailing list probably isn't the best place to talk
 about Linux kernel bugs or go looking for maintainers

(b) you patch your systems. Linux 2.4.9 is of a similar age
 to OpenBSD 3.0, says Google: released nine+ years ago.
 Linux 2.4.20 is a year or so newer than that

(c) you retest with a newer Linux kernel before reporting any
  bugs, once you have located the appropriate non-OpenBSD
  fora in which to do so

That said, I suppose you _could_ use this behaviour to populate
chroots, since you can use it for individual files and directories,
as well as whole filesystems. But OpenBSD preference seems
to be to keep such places as desolate as possible, so what use?

John



Re: equivalent of Linux mount -o bind

2011-01-29 Thread Stuart Henderson
On 2011-01-28, Travis H. tra...@bitrot.info wrote:
 So I'm curious if there's something in OpenBSD that's similar to the
 mount -o bind /dir1 /dir2 to make dir1 appear where dir2 is.

I think an nfs loopback mount is the closest thing.

 I seem to recall a mount_nullfs but don't see it in the latest
 OpenBSD.

It was removed.



equivalent of Linux mount -o bind

2011-01-28 Thread Travis H.
So I'm curious if there's something in OpenBSD that's similar to the
mount -o bind /dir1 /dir2 to make dir1 appear where dir2 is.

I seem to recall a mount_nullfs but don't see it in the latest
OpenBSD.

Please note that I'm not trying to start a flame war, so there's
no need to make Linux comments.

BTW, the vnconfig manpage should probably indicate that the image need
not be a file, you can use a slice/partition too.