Know How -- ZFS -- Really don't panic
ZFS on Linux via FUSE. Links:An ultra-short HowTo
Here is my way how I got running ZFS on Debian 5.0.4 (Lenny)Prerequisites
This is for a build on Debian Lenny. This is the list I needed after installing a minimal Debian Lenny from scratch:apt-get install scons
apt-get install libssl-dev
apt-get install fuse-utils libfuse-dev libfuse2
apt-get install build-essential zlib1g-dev
apt-get install libaio-dev
apt-get install libattr1-dev
apt-get install git git-core
First Download
cd into some directory of your choice where you want to build zfs. Each step is based on the one before (so if you restart be sure to be in the right directory!): Get the source:git clone http://git.zfs-fuse.net/official
cd official
git checkout -b testing origin/testing
Later you can update
This probably are the commands (I am not so used to GIT to know if these are correct):git pull origin
git merge origin/testing
git pull origin
git merge origin/testing
Build
Always do the complete build after update! Build and install the tools (without debugging!):cd src
scons -c
scons
sudo scons install
sudo cp -i ../contrib/zfsrc /etc/zfs/.
sudo vi /etc/zfs/zfsrc
scons -c
scons debug=2
Run
Run the ZFS userland kernel (do not miss the modprobe!):su -
cd zfs-fuse
modprobe fuse
./run.sh
First steps for creating a pool
Now you can create your pool:zpool create POOLNAME raidz2 /dev/DRIVE1 /dev/DRIVE2 /dev/DRIVE3 /dev/DRIVE4
Notes
- Without the modprobe I was missing /dev/fuse
- Without the "debug=2" the kernel is so quiet that you cannot trace any problems.
- Manuals are missing completely. Manuals are not important, as all zfs commands tell some help if called without arguments. Also ZFS is easy, as soon as you started with it you know everything. See First Steps.
Experimenting with different versions
If you are experimenting with different versions, you will find some annoying "feature" of scons: Scons is not able to handle installs properly:scons -c
scons install
rm -f /usr/local/sbin/z{db,fs,fs-fuse,pool,streamdump,test}
scons install
vi lib/libzfscommon/include/sys/fs/zfs.h
#define ZFS_IOC ('Z' << 8)
#define ZFS_IOC (('Z'+XXXXX) << 8)
Note that upstream recommended to change the socket path etc. like in the patch attached to following post:
groups.google.com/group/zfs-fuse/msg/803ba07156652208
-Tino, 2010-05-17
- The good thing about this is, that it makes it possible to run different versions of zfs fuse in parallel.
- The bad thing about this is, that it may be cumbersome to change 3 places in a source just to be sure to have zfs versions to not interfere with each other.