Image of the glider from the Game of Life by John Conway
Skip to content

Install ZFS on Debian GNU/Linux

Table of Contents

Zpool Administration ZFS Administration Appendices
0. Install ZFS on Debian GNU/Linux 9. Copy-on-write A. Visualizing The ZFS Intent Log (ZIL)
1. VDEVs 10. Creating Filesystems B. Using USB Drives
2. RAIDZ 11. Compression and Deduplication C. Why You Should Use ECC RAM
3. The ZFS Intent Log (ZIL) 12. Snapshots and Clones D. The True Cost Of Deduplication
4. The Adjustable Replacement Cache (ARC) 13. Sending and Receiving Filesystems
5. Exporting and Importing Storage Pools 14. ZVOLs
6. Scrub and Resilver 15. iSCSI, NFS and Samba
7. Getting and Setting Properties 16. Getting and Setting Properties
8. Best Practices and Caveats 17. Best Practices and Caveats

UPDATE (May 06, 2012): I apologize for mentioning it supports encryption. Pool version 28 is the latest source that the Free Software community has. Encryption was not added until pool version 30. So, encryption is not supported natively with the ZFS on Linux project. However, you can use LUKS containers underneath, or you can use Ecryptfs for the entire filesystem, which would still give you all the checksum, scrubbing and data integrity benefits of ZFS. Until Oracle gets their act together, and releases the current sources of ZFS, crypto is not implemented.

Quick post on installing ZFS as a kernel module, not FUSE, on Debian GNU/Linux. The documents already exist for getting this going, I'm just hoping to spread this to a larger audience, in case you are unaware that it exists.

First, the Lawrence Livermore National Laboratory has been working on porting the native Solaris ZFS source to the Linux kernel as a kernel module. So long as the project remains under contract by the Department of Defense in the United States, I'm confident there will be continuous updates. You can track the progress of that porting at http://zfsonlinux.org.

UPDATE (May 05, 2013): I've updated the installation instructions. The old instructions included downloading the source and installing from there. At the time, that was all that was available. Since then, the ZFS on Linux project has created a proper Debian repository that you can use to install ZFS. Here is how you would do that:

$ su -
# wget http://archive.zfsonlinux.org/debian/pool/main/z/zfsonlinux/zfsonlinux_2%7Ewheezy_all.deb
# dpkg -i zfsonlinux_2~wheezy_all.deb
# apt-get update
# apt-get install debian-zfs

And that's it!

If you're running Ubuntu, which I know most of you are, you can install the packages from the Launchpad PPA https://launchpad.net/~zfs-native.

UPDATE (May 05, 2013): The following instructions may not be relevant for fixing the manpages. If they are, I've left them in this post, just struck out.

A word of note: the manpages get installed to /share/man/. I found this troubling. You can modify your $MANPATH variable to include /share/man/man8/, or by creating symlinks, which is the approach I took:

# cd /usr/share/man/man8/
# ln -s /share/man/man8/zdb.8 zdb.8
# ln -s /share/man/man8/zfs.8 zfs.8
# ln -s /share/man/man8/zpool.8 zpool.8

Now, make your zpool, and start playing:

$ sudo zpool create test raidz sdd sde sdf sdg sdh sdi

It is stable enough to run a ZFS root filesystem on a GNU/Linux installation for your workstation as something to play around with. It is copy-on-write, supports compression, deduplication, file atomicity, off-disk caching, encryption, and much more. At this point, unfortunately, I'm convinced that ZFS as a Linux kernel module will become "stable" long before Btrfs will be stable in the mainline kernel. Either way, it doesn't matter to me. Both are Free Software, and both provide the long needed features we've needed with today's storage needs. Competition is healthy, and I love having choice. Right now, that choice might just be ZFS.

{ 19 } Comments

  1. OdyX using Firefox 12.0 on Windows 7 | April 18, 2012 at 1:44 am | Permalink

    How happens that zfsonlinux is not yet packaged in Debian ?

    As far as I read http://zfsonlinux.org/faq.html#WhatAboutTheLicensingIssue , Debian could distribute the zfsonlinux source and build it on user machines using dkms for example, right?

  2. cristalinox using Google Chrome 18.0.1025.168 on GNU/Linux 64 bits | May 1, 2012 at 1:28 am | Permalink

    sudo dpkg -i *_amd64.deb
    before
    Now do the same for ZFS ?????

  3. Aaron Toponce using Debian IceWeasel 10.0.4 on GNU/Linux 64 bits | May 1, 2012 at 2:36 pm | Permalink

    According to the post:

    $ sudo dpkg -i ~/src/{spl,zfs}/*.deb

    That should take care of both the SPL and ZFS packages.

  4. Gary using Firefox 15.0a1 on GNU/Linux 64 bits | May 4, 2012 at 3:48 pm | Permalink

    You can't build zfs until spl devel is installed.... at least I couldn't :)

  5. Rudd-O using Google Chrome 17.0.963.83 on GNU/Linux 64 bits | May 6, 2012 at 2:55 am | Permalink

    I wrote a guide to get ZFS (and a root file system backed by it) on Fedora.

    http://rudd-o.com/linux-and-free-software/installing-fedora-on-top-of-zfs/index

  6. DaFresh using Safari 7534.48.3 on Mac OS | May 6, 2012 at 10:06 am | Permalink

    Odyx, there is a licencing problem, CDDL for ZFS, GPL for Debian/Linux, which are not compatible.

  7. Daniel Mccumllam using Firefox 3.6.28 on Windows XP | May 16, 2012 at 1:36 am | Permalink

    Brilliant update information pal. Sounds like you install ZFS on Debian GNU/Linux. I hope I can install soon for mentioning it supports encryption. Thanks!

  8. Paul Nienaber using Google Chrome 19.0.1084.56 on Mac OS | June 25, 2012 at 11:18 am | Permalink

    Dude, './configure --mandir=/usr/local/share/man'. Problem solved. Thanks for the heads-up that it's going to do that :)

  9. Jonas using Debian IceWeasel 10.0 on GNU/Linux 64 bits | July 8, 2012 at 8:39 am | Permalink

    Very useful guide! I can now import my old FreeNAS ZFS disks on my new Debian server. Awesome.

  10. Martin using Opera 9.80 on GNU/Linux | December 8, 2012 at 3:22 pm | Permalink

    Thank You very much. Short and sweet. I had zfs-fuse running and was quite happy but always wanted to change to the kernel module. With Your post it worked like a charm. Make sure zfs-fuse is deinstalled, because You get a conflict on installing the zfs-Packages.

    Regards,

    Martin

    Debian Sid Distro Aptosid w. 3.6.9

  11. bodhi using Safari 536.26.17 on Mac OS | December 17, 2012 at 1:04 am | Permalink

    Thanks for the instruction. I've downloaded the source and compiled spl and zfs for armv5. Compilation went OK, no problem. But I got this error in building the deb (make deb):

    spl-0.6.0-rc12.armv5tel.rpm is for architecture armv5tel ; the package cannot be built on this system.

    Any idea why?

  12. Aaron Toponce using Google Chrome 25.0.1359.3 on Mac OS | December 17, 2012 at 7:13 am | Permalink

    Probably because it's using "alien" to covert the RPM to a DEB. I would file a bug report.

  13. bodhi using Safari 536.26.17 on Mac OS | December 18, 2012 at 1:11 am | Permalink

    Thanks for the response Aaron. Glad to know you think it's related to "alien" (not armv5 arch).

  14. David Anderson using Google Chrome 23.0.1271.97 on GNU/Linux 64 bits | December 18, 2012 at 8:37 am | Permalink

    Can I install a non-root system on 12.10? (because the grub issue is not yet fixed for 12.10)

  15. Aaron Toponce using Debian IceWeasel 10.0.11 on GNU/Linux 64 bits | December 18, 2012 at 12:28 pm | Permalink

    I'm not sure what you mean. Do you mean that you want to install ext4 (or something else) on / and ZFS elsewhere? In my case, I use ext4 for /, due to the GRUB problems you mention, and use ZFS for /home/, /var/cache/ and /var/log/ on my workstation. Of course, on our storage servers at work, ZFS is usually mounted to /backup/ or something else based on its function.

  16. David Anderson using Google Chrome 23.0.1271.97 on GNU/Linux 64 bits | December 18, 2012 at 2:19 pm | Permalink

    Aaron, that IS what I meant... The repo is for 12.04 only at this time.

  17. David E. Anderson using Google Chrome 23.0.1271.97 on GNU/Linux 64 bits | January 2, 2013 at 9:48 pm | Permalink

    on 12.10 I had to add zlib1g-dev and uuid-dev to the pre-requisite installed software

  18. Dju using Debian IceWeasel 17.0.6 on GNU/Linux 64 bits | June 9, 2013 at 9:55 am | Permalink

    hi

    thanks for all the explainations !
    i was planning on setting up my filer @home with 3/4 disks (proliant microserver, with Debian wheezy)
    Now i've spent a few hours reading this article, i will definitely use ZFS :)

    By the way, about the bug you're talking about when sharing a dataset with samba, the issue is not in ZFS but samba, i've known it for a long time...
    Basically, when accessing the share from a remote computer with a user/password, samba will refuse the access, because the local user on your server is NOT included in samba users list....
    To do that, yout need to add it by typing
    smbpassword -a your_user
    then enter the password twice. then it will work ;)

  19. Ante using Google Chrome 29.0.1547.57 on Mac OS | September 1, 2013 at 2:40 am | Permalink

    Hi,

    I have been following this instructions but at the last step I get following:
    Package debian-zfs is not available, but is referred by another package.
    This may mean that the package is missing, has been obsoleted, or is only available from another source

    E: Package 'debian-zfs' has no installation candidate

{ 27 } Trackbacks

  1. [...] Оригинал статьи: тут Поделиться ссылкой:Facebookпо электронной [...]

  2. [...] about how you can administer your ZFS filesystems and pools. You should start first by reading how to get ZFS installed into your GNU/Linux system here on this blog, then continue with this [...]

  3. [...] Install ZFS on Debian GNU/Linux [...]

  4. [...] Install ZFS on Debian GNU/Linux [...]

  5. [...] Install ZFS on Debian GNU/Linux [...]

  6. [...] Install ZFS on Debian GNU/Linux [...]

  7. [...] Install ZFS on Debian GNU/Linux [...]

  8. [...] Install ZFS on Debian GNU/Linux [...]

  9. [...] Install ZFS on Debian GNU/Linux [...]

  10. [...] Install ZFS on Debian GNU/Linux [...]

  11. [...] Install ZFS on Debian GNU/Linux VDEVs RAIDZ The ZFS Intent Log (ZIL) The Adjustable Replacement Cache (ARC) Exporting and Importing Storage Pools Scrub and Resilver Getting and Setting Properties Best Practices and Caveats [...]

  12. [...] Install ZFS on Debian GNU/Linux [...]

  13. [...] Install ZFS on Debian GNU/Linux [...]

  14. [...] Install ZFS on Debian GNU/Linux VDEVs RAIDZ The ZFS Intent Log (ZIL) The Adjustable Replacement Cache (ARC) Exporting and Importing Storage Pools Scrub and Resilver Getting and Setting Properties Best Practices and Caveats [...]

  15. [...] Install ZFS on Debian GNU/Linux [...]

  16. [...] Install ZFS on Debian GNU/Linux [...]

  17. [...] Install ZFS on Debian GNU/Linux VDEVs RAIDZ The ZFS Intent Log (ZIL) The Adjustable Replacement Cache (ARC) Exporting and Importing Storage Pools Scrub and Resilver Getting and Setting Properties Best Practices and Caveats [...]

  18. [...] Install ZFS on Debian GNU/Linux [...]

  19. [...] Install ZFS on Debian GNU/Linux VDEVs RAIDZ The ZFS Intent Log (ZIL) The Adjustable Replacement Cache (ARC) Exporting and Importing Storage Pools Scrub and Resilver Getting and Setting Properties Best Practices and Caveats [...]

  20. [...] Install ZFS on Debian GNU/Linux [...]

  21. [...] Install ZFS on Debian GNU/Linux [...]

  22. [...] Install ZFS on Debian GNU/Linux [...]

  23. zfsonlinux and kernel 3.7.7-1-ARCH - not right now...

    A new kernel (3.7.7) was released today for the arch linux. Currently, the zfsonlinux in the aur was not adapted on it. I have updated my zfsonlinux automake tool with a more secure option. Before you are going to rebuild the zfs modules, the tool now...

  24. [...] Install ZFS on Debian GNU/Linux [...]

  25. [...] Install ZFS on Debian GNU/Linux [...]

  26. […] 另外,发现ZoL上面的一个文档不错,包含了ZFS一些内部原理,比如ARC、COW等,值得推荐。 此条目发表在 […]

  27. ZFS Stammtisch - Seite 163 | October 7, 2013 at 1:39 am | Permalink

    […] von ZFS verdeutlicht. Mir hilft das gerade sehr, mich in die Materie einzuarbeiten. Hier der Link: Aaron Toponce : Install ZFS on Debian GNU/Linux […]

Post a Comment

Your email is never published nor shared.

Switch to our mobile site