On Sun, Apr 6, 2008 at 2:43 PM, Henry Nestler <Henry.Ne@...> wrote:
> Hello Marwan,
> Marwan Al-Sabbagh wrote:
> > On Thu, Apr 3, 2008 at 6:43 PM, David Kaufman <david@...> wrote:
> >> Hi,
> >> I'd like to use unionfs in colinux:
> >> http://www.fsl.cs.sunysb.edu/project-unionfs.html
> >> My goal is to have several colinux instances sharing a large read-only
> >> filesystem (like the OS images that ship with colinux) and saving their
> >> local changes to smaller writable local "unioned" filesystems. This would
> >> help me to repeatedly test-install large, complicated software packages
> >> that we develop (such as http://krang.sf.net), with the ability to quickly
> >> roll back the O/S to its pristine state and re-do as many times as needed,
> >> and also to make it easy to identify and isolate all changes made to the
> >> underlying distro afterwards (by examining the writable directory mounted).
> >> I read that unionfs was "baked in" to the linux kernel since 2.6.14 and
> >> also see that it is supported by my distro (debian etch) so I was
> >> disappointed when:
> >> mount -t unionfs -o dirs=/Fruits:/Vegetables none /mnt/healthy
> >> complained that:
> >> unknown file system unionfs
> >> Is unionfs not baked into the colinux kernel, too? Am I doing something
> >> wrong (or not doing something else right?) Do I need to get the source,
> >> compile and load the kernel module for colinux? I've never done that
> >> before, but for this I'd be anxious to give it a try!
> >> I'm running a recent 0.8.0 snapshot (at the moment) but would be willing to
> >> up-, down-, or side-grade to get unionfs running!
> >> Thanks!
> >> -dave
> > Dear David,
> > Unionfs is not in the default Linux kernel yet but should be in the
> > future, this Quote is taken from http://en.wikipedia.org/wiki/UnionFS
> > "As of January 2007, Unionfs 2.0 has been included into Andrew
> > Morton's Linux -mm tree, thus slated for eventual inclusion in the
> > Linux kernel mainline source tree."
> > I've patched and compiled unionfs support into the colinux kernel,
> > and it works great. As Henry mentioned there are no conflicts. I
> > compiled it using coLinux-0.7.2 on debian 4 Etch. But the process
> > pretty much applies to whichever distro and coLinux versions. I wrote
> > a bash script that does the whole thing for you, as follows:
> > * download colinux source, unionfs source, linux kernel source
> > * patch kernel with colinux patch and unionfs patch
> > * configure kernel for unionfs
> > * compile the kernel image and modules
> > The script isn't too long about 60 lines, I've also tried to make it
> > structured and readable. So you should be able to easily see what it's
> > doing, and modify it for other versions or purposes. You can download
> > the script at http://marwan.tv/build-unionfs-kernel.sh
> > Two additional notes. Run the script as root or sudo, and run the
> > following before running the scripts to install the packages needed to
> > compile the Linux kernel:
> > apt-get install build-essential gettext bison flex automake autoconf unzip bzip2
> > Best of luck, and I hope you find the script and this post helpful.
> > Marwan Al-Sabbagh
> We have tried the module on Debian 4. We have build coLinux kernel
> 188.8.131.52 with unionfs patch 184.108.40.206. But it crashes the Kernel. The
> minor differ version from .18 to .19 versions should not the problem.
> David Kaufman wrote to me offlist:
> > sudo su -
> > modprobe unionfs
> > mkdir fruits vegies healthy
> > touch fruits/apple vegies/carrot
> > echo "I am a fruit" > fruits/tomato
> > echo "I am a vegetable" > vegies/tomato
> > mount -t unionfs -o dirs=/root/fruits:/root/vegies \
> > none /root/healthy
> > dir healthy # works!
> > cat healthy/apple # doesn't crash
> > cat healthy/tomato # should print: "I am a fruit"
> > # (but crashes colinux instead) :-)
> I have replaced the "/root" with "/tmp" in the steps and have the same
> result as David.
> BUG at .../devel-gcc412/linux-220.127.116.11-source/fs/unionfs/fanout.h:313"
> static inline void verify_locked(struct dentry *d)
> BUG_ON(!mutex_is_locked(&UNIONFS_D(d)->lock)); <=== failed
> Have changed the lines above into WARN + BUG to have the caller tree.
> static inline void verify_locked(struct dentry *d)
> if (WARN_ON(!mutex_is_locked(&UNIONFS_D(d)->lock)))
> ------- Now, can see the callers: -----------------------
> Registering unionfs 2.3.2 (for 18.104.22.168) on .18
> WARNING: at
> :315 verify_locked()
> [<c0103b7a>] show_trace_log_lvl+0x1a/0x30
> [<c0103cb2>] show_trace+0x12/0x20
> [<c0104ae5>] dump_stack+0x15/0x20
> [<c884255c>] unionfs_file_revalidate+0x63c/0xfc0 [unionfs]
> [<c884545e>] unionfs_readpage+0x3e/0x1d0 [unionfs]
> [<c0144d23>] __do_page_cache_readahead+0x1e3/0x2b0
> [<c0144e52>] blockable_page_cache_readahead+0x62/0xc0
> [<c01450a9>] page_cache_readahead+0x149/0x1f0
> [<c013ed70>] do_generic_mapping_read+0x4f0/0x5a0
> [<c0140c92>] generic_file_aio_read+0x122/0x1c0
> [<c015de1f>] do_sync_read+0xcf/0x110
> [<c015e705>] vfs_read+0xb5/0x140
> [<c015eaed>] sys_read+0x3d/0x70
> [<c01028f2>] syscall_call+0x7/0xb
> colinux: Linux VM terminated
> colinux: BUG at
> console: Monitor1492: Detached
> I can not see any coLinux related things there. Perhaps some should
> fillout a bugreport on unionfs?
> My changed code you can see from versions message "on .18"
> Marwan, what patchfile you have used? What version of unionfs?
> Henry N.
I used the following files/versions:
I used coLinux 0.7.2 source, it used the 2.6.22 kernel by default,
the closest patch to that was unionfs-2.2.4_for_22.214.171.124.diff. Now I
did run a diff between Linux 126.96.36.199 and 2.6.22, and I confirmed
that none of the files patched by unionfs had changed significantly.
I tried the example mentioned above with the fruits and vegies and
it all worked with no kernel crash, and it produced the expected
results. The vmlinux and vmlinux-modules.tar.gz that I'm using with
built in support for unionfs can be downloaded here:
Good luck, hope that solves the problem.