Donate Share

aufs

Email Archive: aufs-users (read-only)

2006:
Jan
   
Feb
   
Mar
   
Apr
   
May
   
Jun
(1)
Jul
   
Aug
(9)
Sep
(6)
Oct
(5)
Nov
(6)
Dec
(16)
2007:
Jan
(37)
Feb
(138)
Mar
(102)
Apr
(62)
May
(31)
Jun
(92)
Jul
(71)
Aug
(16)
Sep
(103)
Oct
(76)
Nov
(50)
Dec
(47)
2008:
Jan
(56)
Feb
(58)
Mar
(100)
Apr
(101)
May
(89)
Jun
(32)
Jul
(57)
Aug
(73)
Sep
(40)
Oct
(72)
Nov
(96)
Dec
(31)
2009:
Jan
(43)
Feb
(130)
Mar
(130)
Apr
(120)
May
(68)
Jun
(31)
Jul
(63)
Aug
(39)
Sep
(30)
Oct
(48)
Nov
(22)
Dec
   
From: Michael Towers <mt.42@we...> - 2008-03-11 08:59
Here is an example using the new 'shwh' (show-whiteouts) option,
available in aufs-20080310.

Junjiro:
Maybe you'd like to check this through and include it in the cvs source?

########################################################
# EXAMPLE USAGE OF THE 'shwh' OPTION ------ 2008.03.11 #
########################################################

The show-whiteout ('shwh') option can be used to merge aufs branches
containing whiteouts.

This example is based on the usage in larch-5.2
(http://larch.berlios.de), a live USB-stick construction kit, based on
Arch Linux.
The live system has an aufs root mount comprising three layers:
Bottom: 'system', squashfs (underlying base system), read-only
Middle: 'mods', squashfs, read-only
Top: 'overlay', ram (tmpfs), read-write

The top layer is loaded at boot from a tar-lzo archive, which can also
be saved at shutdown, to preserve the changes made to the system during
the session.

When larger changes have been made, or smaller changes have accumulated,
the tar-lzo archive will have reached a size where loading and saving it
take an appreciable time. At this point, it would be nice to be able to
merge the two overlay branches ('mods' and 'overlay') and rewrite the
'mods' squashfs, clearing the top layer and thus restoring save and load
speed.

This merging is simplified by the use of another aufs mount, of just the
two overlay branches using the new 'shwh' option.
In larch, access to the individual branches of the root aufs is made
possible by using 'mount -o bind' in the initramfs. The tmpfs is made
available at /.livesys, containing mount points /.livesys/mods and
/.livesys/overlay for the two overlay branches. The new, merging aufs
mount will be at /.livesys/merge_union and it can be prepared using the
command:

# mount -t aufs \
-o ro,shwh,br:/.livesys/overlay=ro+wh:/.livesys/mods=rr+wh \
aufs /.livesys/merge_union

Note that the aufs mount must be 'ro'. A merged view of the two overlay
branches is then available at /.livesys/merge_union, and the new feature
is that the whiteouts (.wh..wh..opq, etc.) are visible!

[[[ Remounting is also possible, e.g.

# mount -t aufs -o ro,br:b1=ro+wh:b2=ro+wh aufs mp
# mount -o remount,shwh mp

Note again that the mount must be 'ro' before using remount with the
'shwh' option. Making the whiteouts vanish again is also possible:

# mount -o remount,noshwh mp
]]]

It is now possible to save the combined contents of the two overlay
branches to a new squashfs, e.g.:

# mksquashfs /.livesys/merge_union /path/to/newmods.squash

This new squashfs archive can be stored on the boot device and the
initramfs will use it to replace the old one at the next boot.

[[[ A new tar-lzo overlay must of course also be built, e.g. (retaining
as root directory 'overlay'):

# tar -cf - -C /path/to overlay | lzop > /path/to/newoverlay.tar.lzo
]]]

Share and Enjoy!
mt


    From: <sfjro@us...> - 2008-03-11 16:20
    Michael Towers:
    > Here is an example using the new 'shwh' (show-whiteouts) option,
    > available in aufs-20080310.
    >
    > Junjiro:
    > Maybe you'd like to check this through and include it in the cvs source?

    Thank you very much.
    Actually I was going to ask you to write a sample to describe the
    feature/meaning of shwh option, because it is hard to understand and use
    this feature. And I may be confusing 'visible whiteout' forever. :-)
    Currently I didn't decide yet whether to include your documents into CVS
    tree or to mention in Tips document.

    Here are my comments.
    - CONFIG_AUFS_SHWH is required.
    - How is your impression on LZO? Is it small, and fast?
    - It is necessary to flush the pseudo-link.
    - With currect version, you can 'remount,ro,shwh' in one-shot.


    Junjiro Okajima