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

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • [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
      0,
      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!!

      The post was edited 1 time, last by Solo0815 ().

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

      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?
    • Re: [Howto] Setup ZFS on OMV Step by Step for ZFS Fans.

      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.
    • Re: [Howto] Setup ZFS on OMV Step by Step for ZFS Fans.

      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:

      root@openmediavault:~# mount
      /dev/sda1 on / type ext4 (rw,errors=remount-ro)
      tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
      proc on /proc type proc (rw,noexec,nosuid,nodev)
      sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
      udev on /dev type tmpfs (rw,mode=0755)
      tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
      devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
      tmpfs on /tmp type tmpfs (rw)
      tank on /tank type zfs (rw,xattr)
      tank/storage on /tank/storage type zfs (rw,xattr)


      and

      root@openmediavault:~# df -h
      Filesystem Size Used Avail Use% Mounted on
      /dev/sda1 3.7G 1011M 2.6G 29% /
      tmpfs 1007M 0 1007M 0% /lib/init/rw
      udev 1002M 1002M 0 100% /dev
      tmpfs 1007M 0 1007M 0% /dev/shm
      tmpfs 1007M 4.0K 1007M 1% /tmp
      tank 2.1G 0 2.1G 0% /tank
      tank/storage 2.1G 0 2.1G 0% /tank/storage


      System is /dev/sda1, sda2-sda3-sda4 are 1GB virtual HDD each.
      Any ideas, how to proceed, what to correct ?
    • Re: [Howto] Setup ZFS on OMV Step by Step for ZFS Fans.

      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 ?
    • Re: [Howto] Setup ZFS on OMV Step by Step for ZFS Fans.

      "A64" wrote:

      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... ;)
    • Re: [Howto] Setup ZFS on OMV Step by Step for ZFS Fans.

      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.