home OCFS2 installation notes

Build and install the xenified kernel. ("hg pull http://xenbits.xensource.com/linux-2.6-xen.hg") I suggest doing this in the Xen domU where it will be used. (The modules will be installed correctly.)

Build and install OCFS2 (http://oss.oracle.com/projects/ocfs2/files/source/v1.1).

Build and install OCFS2-tools (http://oss.oracle.com/projects/ocfs2-tools/dist/files/source/v1.1/ocfs2-tools-1.1.5.tar.gz).

Edit /etc/default/o2cb:

 O2CB_ENABLED=true
 O2CB_BOOTCLUSTER=eng00

Edit /etc/ocfs2/cluster.conf:

        node:
                ip_port = 7777
                ip_address = 169.236.8.35
                number = 0
                name = engcluster0004
                cluster = eng00

        node:
                ip_port = 7777
                ip_address = 169.236.8.36
                number = 1
                name = engcluster0005
                cluster = eng00

        cluster:
                node_count = 2
                name = eng00

Start the domU with access to the shared device (disk.append(phy:/dev/etherd/e0.0p6,/dev/sdc1,w!)). Not the use of the exclamation point (!). Xen will disallow mounting the same device in multiple guests without this.

Create an OCFS2 partition:

 mkfs.ocfs2 /dev/sdc1

Start the cluster:

 /usr/src/ocfs2-tools-1.1.5/vendor/common/o2cb.init start

Mount the partition:

 mount /dev/sdc1 /mnt/shared

You should be able to run the last two steps on another guest domain. Both will now be able to interact with the filesystem.

To automate startup, first copy the init files to /etc/init.d:

  cp /usr/src/ocfs2-tools-1.1.5/vendor/common/o2cb.init /etc/init.d/o2cb
  cp /usr/src/ocfs2-tools-1.1.5/vendor/common/ocfs2.init /etc/init.d/ocfs2

Debian's ocfs2-tools (0.99.12-1) is too old to use but it will make the /etc/rc?.d entries for o2cb. It does not make the ocfs2 entries. I use these:

 lrwxrwxrwx 1 root root 14 Dec 26 19:44 /etc/rc0.d/K20o2cb -> ../init.d/o2cb
 lrwxrwxrwx 1 root root 14 Dec 26 19:44 /etc/rc1.d/K20o2cb -> ../init.d/o2cb
 lrwxrwxrwx 1 root root 14 Dec 26 19:44 /etc/rc2.d/S20o2cb -> ../init.d/o2cb
 lrwxrwxrwx 1 root root 15 Dec 26 19:59 /etc/rc2.d/S40ocfs2 -> ../init.d/ocfs2
 lrwxrwxrwx 1 root root 14 Dec 26 19:44 /etc/rc3.d/S20o2cb -> ../init.d/o2cb
 lrwxrwxrwx 1 root root 15 Dec 26 19:59 /etc/rc3.d/S40ocfs2 -> ../init.d/ocfs2
 lrwxrwxrwx 1 root root 14 Dec 26 19:44 /etc/rc4.d/S20o2cb -> ../init.d/o2cb
 lrwxrwxrwx 1 root root 15 Dec 26 20:00 /etc/rc4.d/S40ocfs2 -> ../init.d/ocfs2
 lrwxrwxrwx 1 root root 14 Dec 26 19:44 /etc/rc5.d/S20o2cb -> ../init.d/o2cb
 lrwxrwxrwx 1 root root 15 Dec 26 20:00 /etc/rc5.d/S40ocfs2 -> ../init.d/ocfs2
 lrwxrwxrwx 1 root root 14 Dec 26 19:44 /etc/rc6.d/K20o2cb -> ../init.d/o2cb

init files and symlinks