[HOWTO] Instal ZFS-Plugin & use ZFS on OMV

  • just that I am having problems installing the latest versions, managed to get the zfs icon But there were errors at the end of the zfs install and it fails to start with errors, cannot find module zfs even though I can see it in the directory.

    • Offizieller Beitrag

    just that I am having problems installing the latest versions, managed to get the zfs icon But there were errors at the end of the zfs install and it fails to start with errors, cannot find module zfs even though I can see it in the directory.

    The zfs icon means the plugin is installed. You are most likely having problems compiling the zfs module. What is the output of:


    dpkg -l | egrep "linux-image|linux-header|openm|zfs"

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Pretty sure those are old notes especially since they apply to OMV 1.x. and are over two years old. You can't even install zfs on OMV 1.x or 2.x since wheezy was never supported and ZoL took down the wheezy repo (we use zfs packages from the Debian repos now).

    I will let @raulfg3 fix his posts if he sees it as the proper thing to do. It is hard to maintain old posts though.

    As this is Supposed' to be the instruction set for installing zfs on OMV3 (why isn't it pinned so) It would seem the obvious thing to do I would have thought!

  • The zfs icon means the plugin is installed. You are most likely having problems compiling the zfs module. What is the output of:
    dpkg -l | egrep "linux-image|linux-header|openm|zfs"


    Here you go...


    root@openmediavault:/# dpkg -l | egrep "linux-image|linux-header|openm|zfs"
    ii libzfs2linux 0.6.5.9-2~bpo8+1 amd64 OpenZFS filesystem library for Linux
    ii linux-image-4.8.0-0.bpo.2-amd64 4.8.11-1~bpo8+1 amd64 Linux 4.8 for 64-bit PCs (signed)
    ii linux-image-amd64 4.8+77~bpo8+1 amd64 Linux for 64-bit PCs (meta-package)
    ii openmediavault 3.0.65 all Open network attached storage solution
    ii openmediavault-keyring 1.0 all GnuPG archive keys of the OpenMediaVault archive
    ii openmediavault-omvextrasorg 3.4.23 all OMV-Extras.org Package Repositories for OpenMediaVault
    iF openmediavault-zfs 3.0.6 amd64 OpenMediaVault plugin for ZFS
    ii zfs-dkms 0.6.5.9-2~bpo8+1 all OpenZFS filesystem kernel modules for Li nux
    ii zfs-zed 0.6.5.9-2~bpo8+1 amd64 OpenZFS Event Daemon
    ii zfsutils-linux 0.6.5.9-2~bpo8+1 amd64 command-line tools to manage OpenZFS fil esystems

  • So, looking at that, you don't have any headers installed, the kernel is a full version back (current is 4.9), and you're about 6 releases behind on the ZFS plugin. The ZFS plugin thing won't hurt anything right off the top, but you flat-out need the linux headers, and probably the 4.9 kernel, in order to proceed.

  • So, I went ahead and installed the Docker-GUI plugin, and started messing around with it just for something to do. What I wasn't aware of when I did that is that Docker apparently automatically creates datasets for containers that you create (and boy, does it ever. I think I've got 13 datasets for two containers and a broken and deleted one I can't get rid of), but because of whatever it's doing in order to use them, all of the datasets it creates has a mountpoint property of "legacy".


    So when I go to the ZFS plugin now, I see this:

    Code
    The configuration object 'conf.system.filesystem.mountpoint' is not unique. An object with the property 'dir' and value 'legacy' already exists.

    Clicking Show Details gives:


    Code
    Error #0: exception 'OMV\AssertException' with message 'The configuration object 'conf.system.filesystem.mountpoint' is not unique. An object with the property 'dir' and value 'legacy' already exists.' in /usr/share/php/openmediavault/config/database.inc:480 Stack trace: #0 /usr/share/openmediavault/engined/rpc/fstab.inc(119): OMV\Config\Database->assertIsUnique(Object(OMV\Config\ConfigObject), 'dir') #1 [internal function]: OMVRpcServiceFsTab->set(Array, Array) #2 /usr/share/php/openmediavault/rpc/serviceabstract.inc(124): call_user_func_array(Array, Array) #3 /usr/share/php/openmediavault/rpc/rpc.inc(86): OMV\Rpc\ServiceAbstract->callMethod('set', Array, Array) #4 /usr/share/omvzfs/Utils.php(209): OMV\Rpc\Rpc::call('FsTab', 'set', Array, Array) #5 /usr/share/openmediavault/engined/rpc/zfs.inc(208): OMVModuleZFSUtil::fixOMVMntEnt(Array) #6 [internal function]: OMVRpcServiceZFS->getObjectTree(Array, Array) #7 /usr/share/php/openmediavault/rpc/serviceabstract.inc(124): call_user_func_array(Array, Array) #8 /usr/share/php/openmediavault/rpc/rpc.inc(86): OMV\Rpc\ServiceAbstract->callMethod('getObjectTree', Array, Array) #9 /usr/sbin/omv-engined(536): OMV\Rpc\Rpc::call('ZFS', 'getObjectTree', Array, Array, 1) #10 {main}


    Clearly the plugin is expecting Mountpoint to be a unique item, and that it will return an actual directory no matter what.

  • Okay, since I had some time and I like beating my skull against brick walls until one or the other breaks, I gave a crack at trying to fix this issue with Docker using the ZFS driver and creating gobs of clones and other filesystems.


    I tracked it to /usr/share/omvzfs/Utils.php, line 178; this is in the fixOMVMntEnt function, and it tells OMV to add anything it finds that has a mountpoint that isn't "none" to $current[]. I've included the function below just so folks don't have to flip back and forth.


    What I did was on Line 178, I replaced "none" with "legacy" for the string that $mntpoint is matching against, and the page loads, with everything seeming to work. Bonus!


    Now, clearly the exception for "none" is in there for a reason, though I can't think of anything other than a new zpool - and even then, probably not - that would have a mountpoint of "none"; zvols maybe but the $filesystems variable gets populated by a ZFS command that specifies filesystems only. Anyhow, still want to include it. So I go digging around, and I come up with the following:



    PHP
    $mntpoint = $filesystem->getMountPoint();
    			if($mntpoint!=("none"||"legacy"))
    				$current[] = ["fsname"=>$name, "dir"=>$mntpoint];

    This is when all hell breaks loose, and I don't know why. I'm pretty sure if I had clue one what I was doing with a programming language in general, never mind PHP in particular, I'd figure this out immediately, but it breaks a bunch of stuff. Specifically, everything is fine when I load into the Web UI, Shared Folders are normal, etc. I go into the ZFS plugin, relatively quickly everything loads and I see all the datasets, including the Docker ones, in the screen. And then if I go into Shared Folders, the device is listed as N/A for each shared folder. When I check /etc/openmediavault, I've got 17 extra files (config.xml.0001 through 0017), each one of which is removing one of the mount entries for the actual ZFS datasets.


    In my bumbling around, I found mention that != can do funky things, so I tried !== for strict checking, and that fails just like "none" by itself does. I also discovered that something odd happens when I'm using just "legacy". The config.xml file gets mangled somehow; instead of "<uuid></uuid>", as an example, it's suddenly replaced with "<uuid/>" in the config.xml.0001 file. It's also, for example, timing out my web sessions even though I have it set to 0 (and both config.xml and config.xml.0001 reflect that).


    @ryecoaaron and @luxflow, if either one of you could tell me if I'm just doing something fundamentally stupid here and/or how to fix it, I'd appreciate it.


    Realistically, mountpoints shouldn't be treated as unique - especially with the way Docker works - but I can see why you wouldn't want to mess with that.


    As an aside, this did reveal a bug on the Filesystems screen - it won't display more than 25 filesystems. Gonna go file that.

    • Offizieller Beitrag

    Did you try:


    if (($mntpoint !== "none") && ($mntpoint !== "legacy"))

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Yep, that appears to have done the trick.


    I was getting confused on what the config.xml.0001 was - didn't realize it was the revert instead of the new config - and whatever was broken before is fine now.


    Still getting session timeout for some reason; Not a huge deal but kind of weird.

  • As a note, I pretended to be a cool kid and forked the plugin, committed my "fix"/dirty hack to it, and issued a pull request. This was forked about 2230 EDT on 4/3 so should include the latest changes; updating broke it which is what prompted the whole affair.

    • Offizieller Beitrag

    As a note, I pretended to be a cool kid and forked the plugin, committed my "fix"/dirty hack to it, and issued a pull request. This was forked about 2230 EDT on 4/3 so should include the latest changes; updating broke it which is what prompted the whole affair.

    Pull request accepted and 3.0.14 in the repo now.

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • May I ask what the current state of ZFS is on OMV3.


    I’m thinking of using OMV on a newly acquired HP Microserver Gen8 which now has 12GB of ECC RAM and a E-1220L V1 CPU, so ZFS is a possibility rather than remaining with ext4 and RAID5. This would be on a simple home network using the OMV device as a central file server, media server and for backups, and it can run pi-hole. So nothing very elaborate.


    I’m currently testing OMV in virtualbox and have reached this point:



    My questions are:


    1. Is the combination of ZFS & OMV3 considered ready for everyday use?


    2. As using the CLI can potentially break OMV, what ZFS command should not be used at the CLI?


    3. Can tools such as zfs-auto-snapshot and zfsnap be installed and used at the CLI?


  • 1. I'm using it every day for some fairly important and non-replaceable data - family pictures, tax forms, etc - for both my primary storage and offsite backup. OMV3 isn't officially released yet, but I've been using it for a long while now, and in general it's considered "done" except for some plugins.


    2. I believe @luxflow corrected the issues with OMV and ZFS command line; if you manually create a zpool or dataset, the first time you access the ZFS plugin it will automatically add the newly created pools/datasets to the config and prompt you to apply changes.


    3. I have used zfsnap in the past, and recently changed to zfs-auto-snapshot, which is working fine as well. I changed over mostly because zfs-auto-snapshot was easier to setup different snapshot schedules on a per-dataset basis than zfsnap was. In both cases, I was running it via Git, as there is currently no facility for setting up snapshot automation in the plugin. Manual snapshots can be done, but automated ones aren't there. I believe luxflow had been looking at it, but I don't know if he'd had the time to do anything with it.

  • I am using omv3 and the zfs plugin for my home environment since one year now. So far no problems at all.


    Greetings Hoppel

    ----------------------------------------------------------------------------------
    openmediavault 6 | proxmox kernel | zfs | docker | kvm
    supermicro x11ssh-ctf | xeon E3-1240L-v5 | 64gb ecc | 8x10tb wd red | digital devices max s8
    ---------------------------------------------------------------------------------------------------------------------------------------

  • @wolfstarr


    Perhaps some creative use of cronjobs could be an alternative for basic auto-snapshot creation without the need for
    zfs-auto-snapshot.


    @Hoppel


    A year of solid use inspires confidence.



    Just been looking at the OMV system backup function and backing up to data drives. But clonezilla does not support zfs as of now and I have yet to check systemrescuecd. What method(s) have you used for OMV system backups to a zfs pool?


    How are using zfs send/receive?


    There's also the question of the best arrangement for storage of docker containers/images and if there is any benefit to getting docker to using a zfs driver, assuming that's possible.

  • My omv3 is virtualized in a kvm on a proxmox host. I use the backup methods from my host for this kvm. My sas controller (lsi 3008) is passed through.

    ----------------------------------------------------------------------------------
    openmediavault 6 | proxmox kernel | zfs | docker | kvm
    supermicro x11ssh-ctf | xeon E3-1240L-v5 | 64gb ecc | 8x10tb wd red | digital devices max s8
    ---------------------------------------------------------------------------------------------------------------------------------------

  • as @wolffstarr said, most cli command just works which include creating, deleting dataset, and changing properties
    except changing mountpoint, and dataset name, these are only allowed in gui
    if you change these in cli, you have to edit /etc/openmediavault/config.xml file manually
    Even in worst case, only break in omv, can be fixed with editing config.xml, no data loss, since omv-zfs is just gui wrapper,


    and I'm busy currently, so I can't contribute omv plugins now, but it doesn't mean I leave omv

    OMV3 on Proxmox
    Intel E3-1245 v5 | 32GB ECC RAM | 4x3TB RAID10 HDD
    omv-zfs | omv-nginx | omv-letsencrypt | omv-openvpn
    Click link for more details

  • @'hoppel


    A sas raid card can be fitted to the The HP Gen8, but that's overkill for my needs. Can promox itself install in "Root on ZFS" mode now?


    @'luxflow


    Thanks for the very useful added information, I hadn't noticed the mount point could be changed via editing zfs properties. The work you've done in OMV is much appreciated.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!