InterMezzo ext3 HOWTO
---------------------
This document describes how to configure InterMezzo with ext3 journalling
support in the Linux kernel.  It focusses on configuring ext3 with your
kernel and InterMezzo only.  You should first read the InterMezzo-HOWTO
for information on general InterMezzo use and configuration.


Compiling Your Kernel
---------------------
If you want to have journalling support for InterMezzo, you will need
to compile a new kernel.  You do not need a new kernel if you are only
going to use ext2 with the InterMezzo kernel module, presto.

First, you need to apply Stephen Tweedie's ext3 kernel patch.  We
have included a version of the ext3 0.0.2d patch against the official
linux-2.2.14 kernel sources in presto/patches/ext3-0.0.2d-2214.diff,
as there are a few minor problems with applying Stephen's patch against
the standard linux 2.2.14 kernel sources.

You may also want to check ftp://ftp.uk.linux.org/pub/linux/sct/fs/jfs
for a more up-to-date version of Stephen's ext3 patch.  If you applied
Stephen's patch instead of the one from the InterMezzo sources, you also
need to apply presto/patches/journal_sym.diff to allow presto to start
and stop ext3 journal transactions itself.

Once you have applied the ext3 patch you need to configure the kernel to
use the new ext3 support (either with "make config", "make menuconfig",
or "make xconfig") by saying "Y" to the option:

Filesystems->Second extended fs development code

or by otherwise setting the option CONFIG_EXT3_FS=y.  While it is possible
to compile the ext3 code as a module, it currently does not work this way.
Now compile and install your kernel as per usual.


Compiling Presto with ext3 support
----------------------------------
In order for presto to be aware of the ext3 support in the kernel, it needs
to be reconfigured and recompiled.  In the presto/ directory, run
"make config" and check that "EXT3 journalling support" is enabled.  Now
run "make install" to compile and install the presto module.


Running InterMezzo with ext3 support
------------------------------------
In addition to the normal InterMezzo configuration procedures documented in
the InterMezzo-HOWTO, there are a few extra steps needed to enable the ext3
support in presto.  You should read presto/patches/README.ext3 to learn
about general ext3 support, and how to set up a journal file.

Basically, this involves creating a journal file, and then passing
the journal inode number to the ext3 filesystem as a mount option.
You also need to tell InterMezzo that you are using an ext3 filesystem
for the cache, instead of the default ext2 cache filesystem type.

To create a journal file, you first need to mount your InterMezzo filesystem
as a regular ext2 filesystem:

mount -t ext2 -o loop /tmp/fs0 /izo0

You then need to create a journal file, and find out the inode number:

dd if=/dev/zero of=/izo0/.journal bs=1k count=1k
ls -i /izo0/.journal

It is assumed that you have already created the kml and last_rcvd files.
Now unmount the filesystem, and remount it as an ext3 InterMezzo filesystem:

umount /izo0
mount -t InterMezzo -o loop,cache_type=ext3,mtpt=/izo,volume=testvol,\
	journal=12 /tmp/fs0 /izo0

Note that you only need to pass the "journal=<inode>" option the first time
the filesystem is mounted as ext3.


That's it.  Now presto will atomically update the filesystem and the
KML/last_rcvd logs.  If a cache operation (create/remove/rename/etc) is
interrupted for any reason, it will either have made it entirely to
disk, or it will not appear on the disk or in the KML at all.
