Skip to content
Álvaro Jurado edited this page Sep 14, 2016 · 2 revisions

ZFS for Harvey-OS

ZFS is the LVM and File System designed by Sun Microsystems. ZFS for Harvey-OS is based on ZFS/FUSE for Linux, done as part of the Google Summer of Code 2006 initiative.

Harvey is an effort to provide a modern, distributed, 64 bit operating system.

Prerequisites

The compilation process was tested on Debian 8. It must be very similar in Ubuntu and derivatives.

To install all dependences:

apt-get install git make gcc scons fuse libfuse-dev libaio-dev libssl-dev libattr1-dev

If you want to use the libixp included in your Linux distro:

apt-get install libixp-dev

Compiling

First, you have to download the source:

git clone https://github.com/fuchicar/zfs.git

To compile the entire source tree:

cd zfs/src
scons

If you see the output: scons: done building targets. the compilation went well

If you want to compile only files modified, you have to do:

scons zfs-9p

Using custom libixp

It is probably that you have your own libixp. Suppose that the library is in /usr/src/libixp path:

scons harvey=/usr/src/libixp

Running

Loading FUSE/ZFS modules

First, you have to ensure that fuse module is loaded:

lsmod | grep fuse

If the result is in blank, you have to load the fuse module:

modprobe fuse

Next, you have to run the ZFS daemon. The executable is under zfs/src/zfs-9p path with the name: zfs-9p, You only have to execute it as root.

Create a ZFS partition

We are going to suposse that you have a /dev/sdb1 partition to be used by ZFS (you can use an entire disk instead of a partition, for example, /dev/sdb)

All ZFS commands are located under zfs/src/cmd path.

First step is create a new zpool:

zfs/src/zpool/zpool create -m /mnt/ZTEST ZTEST /dev/sdb1

You can change ZTEST name by which you want.

To check the correct zpool execution:

zfs/src/zpool/zpool status
  pool: ZTEST
 state: ONLINE
 scrub: none requested
config:

    NAME        STATE     READ WRITE CKSUM
    ZTEST       ONLINE       0     0     0
      sdb1      ONLINE       0     0     0

errors: No known data errors

Mount a ZFS partition

This operation is not needed if you executed zpool create previously.

To mount a zpool:

zfs/src/zfs/zfs mount ZTEST

Unmount a ZFS partition

To unmount a zpool:

zfs/src/zfs/zfs unmount ZTEST

Connect from Harvey

The 9P server is started after mounting operation, so you need to mount a zpool before be able to connect to zfs-9p.

From a Harvey command line:

srv tcp!10.0.2.2!1441 z
post...
mount /srv/z /n/z

Now you have the zpool mounted under /n/z path