[Howto] Setup ZFS on OMV Step by Step for ZFS Fans.

  • There is a very good guide on how to install zfs on OMV in this forum here. Now I'm going to show you how to set it up step by step.(Assume your hardware meet zfs requirement).

    First, you need gpt-based disk or use -f parameter while create zfs pool. In the following step by step guide, I will use tank as zfs pool name and storage as the name of dataset. I'm going to use 3 hard drives to create raidz array.

    All right, let start. login to your server with ssh.

    1. Create a raidz pool.
    To make sure your zfs works on OMV, you have to use disk id to create pool.(get it from /dev/disk/by-id).
    zpool create tank raidz -o ashift=12 scsi-SATA_XXXXXXXXXX1 scsi-SATA_XXXXXXXXXX2 scsi-SATA_XXXXXXXXXX3

    2. Create a 500G zfs dataset in the pool.
    zfs create -V 500G tank/storage

    3. Partition the dataset.
    sfdisk -q /dev/tank/storage << EOF

    4. Format the dataset partition with 4k block (!!!This is The Most Important Part, otherwise your OMV won't see your formated dataset!!!)
    To do this, you have to use -F parameter.(Force format)
    mkfs.ext4 -F -b 4096 /dev/tank/storage-1

    5. Now you can use webgui to mount your dataset.
    Logon to webgui, click on Filesystems under Storage. highlight the new device you just created and click on mount button.

    6. Create your share folder.
    Go back to your ssh screen. Get into /media. You will see a new uuid. Make a directory to be shared inside this new uuid. Switch back to webgui, click on Shared Folders under Access Right Management. Click on Add button to bring up an Add shared Folder screen. Fill in the shared folder's Name, choose the new Volume, select the directory in the Path field, assign a permission and even make a comment then click OK button. Now your share folder is ready. You can setup other services with this folder in webgui.

    Okay, that 's all for this simple step by step guide. I hope everybody has a Happy New year and Happy NASing in 2013!!

  • Thanks for this step by step guide but can you explain the certain steps more detailed?
    For example: What is the option " ashift=12" in the first step for?

    How do I set up a raid 5 array in ZFS? Just switch raidz to raid5?

  • First of all you should read into the technical detail of ZFS. It is completely different to anything else in the unix world (btrfs will be similar).

    ashift will align the ZFS blocks to the 4k blocks of modern disks. Otherwise it would be 9 and then would be misaligned to the disks sectors, which has a very bad performance impact on read and esp. on write speeds.

    Raid5 does not exists within the terminology of ZFS. RaidZ is the implementation of "Raid5" in ZFS. It can do some stuff much better then Raid5 as it is aware of all filesystemactivities. In principle it uses an additional disks for redundancy information - as Raid5 does.

    Hope that helps.

    Everything is possible, sometimes it requires Google to find out how.

  • Hi,

    I'm pretty newbie to zfs but wanna switch over from NAS4Free to OMV soon.. on NAS4Free I have some issues with the web interface and with the SMB mount.
    So, before trying everything, I just set up my OMV test system in VirtualBox, 4 drives, etc. Works fine.

    Until this point, everything worked just like a charm, with the newest OMV installation + zfs.
    My issue begins here:


    root@openmediavault:~# sfdisk -q /dev/tank/storage << EOF
    > 0,
    > EOF
    /dev/tank/storage: Not a directory

    sfdisk: Fatal error: cannot find /dev/tank/storage

    And yepp, there's no "tank" or whatsoever in /dev. I made your steps via copy-paste just for a quick&dirty try and to avoid mistakes, so - I think I avoided mistakes. :) What might be missing ? For me, the pool "tank" doesn't seem to be listed in /dev ..

    Some more help for diag:


    System is /dev/sda1, sda2-sda3-sda4 are 1GB virtual HDD each.
    Any ideas, how to proceed, what to correct ?

  • Furthermore.. actually.. I can already use /tank/storage.. I see them in the root directory, can generate file(s) in "storage" and seems to work.. zfs is a filesystem, why do we need to partition a filesystem with ext4 and so on ?

  • Omg.
    zfs -create /tank/storage (using all of the available space) creates no device in /dev. But if I specify -V 2G then it does. Huh, I'm wrong or this shit is really buggy. :lol:

  • Quote from "A64"

    Furthermore.. actually.. I can already use /tank/storage.. I see them in the root directory, can generate file(s) in "storage" and seems to work.. zfs is a filesystem, why do we need to partition a filesystem with ext4 and so on ?

    My understanding is that you can't see them in the GUI, as ZFS on Squeeze doesn't have UUIDs. I will know tomorrow, when I try to migrate my NAS4Free install to OMV... ;)

  • I am not sure where the post is at the moment but there is a tutorial on using ZFS with OMV by faking the shared folders with a small USB device or similar. As you have gathered running an ext4 FS on top of ZFS defeats much of the purpose of ZFS and adds a layer of complexity.. I am running a 40TB ZFS tank with a 2GB USB as a stub handling all of my shared folders. Basically I map the folders I create on the USB stick to the ones I want to share in the tank, since they have a UUID OMV picks them up and I manage them with the UI but all data goes to my 40TB tank.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!