[Unionfs] Can't make branch read only
Herton Ronaldo Krzesinski
herton at mandriva.com.br
Tue Oct 23 16:02:26 EDT 2007
Em Tuesday 23 October 2007 16:13:40 Olivier Blin escreveu:
> Erez Zadok <ezk at cs.sunysb.edu> writes:
> >> - mount -t unionfs -o remount,mode=/live/foo=ro none /live/union
> >>
> >> The last command, while should switch the branch to read only mode as
> >> the documentation specifies, doesn't work, the branch /live/foo
> >> continues to be read-write, and if you write something to /live/union
> >> you confirm this as there will be still writes to /live/foo (and
> >> /proc/mounts continues to show /live/foo as rw too). Any ideas?
> >>
> >> I tried this with unionfs 2.1.3 and also with 2.1.7 but with same
> >> results.
> >
> > Herton, you cannot set the leftmost branch to be readonly, in a union
> > mounted read-write. If the union is mounted read-write, then the
> > leftmost branch must be writeable, to allow copyup. If you want to set
> > the leftmost branch to readonly, it is the same as saying that you want
> > the whole union to be readonly. In that case, remount your entire
> > filesystem readonly:
> >
> > # mount -t unionfs -o remount,ro none /live/union
>
> Our use case is / as union, so we can't really remount the union
> read-only (it's busy).
>
> We used to be able to make the lefmost branch read-only with unionfs
> 1.x, even if the union was writable.
> This allowed to boot with a tmpfs as rw branch of the / union, ask for
> some settings, remount the tmpfs branch ro, safely copy the changes
> from tmpfs to a new directory (on disk), and add this new directory in
> the union with rw mode.
>
> > Check your kernel console messages (e.g., run dmesg). You'll should have
> > seen this message:
> >
> > printk(KERN_ERR "unionfs: leftmost branch cannot be read-only "
> > "(use \"remount,ro\" to create a read-only union)\n");
>
> Actually, the "mount -t unionfs -o remount,mode=/live/foo=ro none
> /live/union" command succeeds, with no error message, and nothing in
> syslog.
Yes. And debugging here what happens in this case is that unionfs_remount_fs
is called with options NULL, so the "goto out_error" early in the function
triggers, and do_remount_mode_option isn't even executed.
>
> Thanks
--
[]'s
Herton
More information about the unionfs
mailing list