Install ZFS Native on Kanotix / Debian Squeeze / Proxmox 2.1

This whole thing below is obsolete. I created a new post with up to date details for Debian 7.0 Wheezy

Ok, Ok, I admit, I’m going really crazy now….

as I described here -> Linux: Install Proxmox Virtual Environment on Debian 6.0 Squeeze Distro (Kanopix) I have Proxmov Virtual Environment running on Kanotix Debian.

I now spotted that I’m running slowly low of free disk space. I could mount space from my NAS via NFS-CIFS or ISCSI but that’s kind of too easy and for testing purpose the break to success ratio is too low 🙂 . And BTW I love ZFS. so I install it (cause I want to deduplicate and compress).

Based on Proxmox …This is pretty straight forward and almost too easy too.

Kanotix is using Debian and not ubuntu and certainly not the latest ubuntu so we need to choose an earlier dist.

1) become root and add the Key

sudo su -
apt-key adv --keyserver --recv-keys  F6B0FC61

2) we add the sources

echo "deb saucy main" > /etc/apt/sources.list.d/zfs.list
(updated to saucy on 08.2013)

3) make sure you have the headers installed

apt-get update
aptitude install dkms pve-headers-$(uname -r)

4) Create a link for the right sources
Update 12.02.2013 – made it universal for kernel versions

ln -s /lib/modules/$(uname -r)/build /lib/modules/$(uname -r)/source

5) Install ZFS

aptitude install ubuntu-zfs

kernel upgrade

After updating the Kernel you must do the following steps:

aptitude install pve-headers-$(uname -r)

(it will pick the current running kernel version. If you just updated the kernel you better reboot first.)

ln -s /lib/modules/$(uname -r)/build /lib/modules/$(uname -r)/source
# Also replace with the new to be installed kernel version 

aptitude reinstall spl-dkms  zfs-dkms

That should cover you on a kernel update

I choosed ZFS primary because under Proxmox there is one directory in which I store iso images. They are huge but rarely used but also for my OpenVZ containers the compression and deduplication is bringing me a huge saving in space.

I created a zpool called zfs-data

zpool create /dev/sda7 zfs-data

the latest zfs-native uses zpool V28 which supports compression and deduplication which I both intend to use.

I make them default

zfs set compression=on zfs-data
zfs setdedup=on zfs-data

They will now be inherited by all to be created filesystems in that zpool.

I create a Zs’ and mount it where I want to have it. In my case under /Proxmox/ZFS

zfs create zfs-data/data
I create another ZFS one for the ISO's
zfs create zfs-data/data/templates
zfs set compression=gzip-9 zfs-data

At the end you would like to make sure it gets mounted on time.

This is my zfs list

zfs list
zfs-data 18.7G 41.6G 37K legacy
zfs-data/data 18.6G 41.6G 6.97G legacy
zfs-data/data/template 11.7G 41.6G 11.7G legacy

You see I made them all legacy in order to be able to mount them with the fstab.

To do so run:

zfs set mountpoint=legacy zfs-data
zfs set mountpoint=legacy zfs-data/data
zfs set mountpoint=legacy zfs-data/template

ad add it to /etc/fstab

vi /etc/fstab
zfs-data /zfs-data zfs defaults 0 0
zfs-data/data /zfs-data/data zfs defaults 0 0
zfs-data/data/template /zfs-data/data/template zfs defaults 0 0

and reboot the box to see if it will blend

%d bloggers like this: