OMV8 on deb13: openmediavault-zfs bug - filesystem UUIDs not unique so not creating "mntent" entries ?

  • ryecoaaron IIRC when adding filesystem datasets to a zfs pool, each dataset should have a unique UUID. Currently they are not and the system fails to create the correct "mntent" entries in the main xml config file. The Webui filesystem display is incorrect as a consquence and "shared folders" cannot be created for zfs filesystem datasets. etc.


    Test config: debian-13.2.0-amd64-netinst.iso + omv install script https://github.com/OpenMediaVa…-Developers/installScript in a libvirt VM. Fully updated.


    • Official Post

    when adding filesystem datasets to a zfs pool, each dataset should have a unique UUID. Currently they are not and the system fails to create the correct "mntent" entries in the main xml config file. The Webui filesystem display is incorrect as a consquence and "shared folders" cannot be created for zfs filesystem datasets. etc.

    Is this broken in omv7? the plugin hasn't changed anything other than omv dependency and omv8 hasn't changed anything in this area.


    Creating a pool added a mntent entry.

    Adding a filesystem to the pool creates a mntent entry for the filesystem but removes the pool's mntent entry in the omv database.

    Clicking discover removed the filesystem's mntent entry and adding the pool's back.


    I don't have time to try this on omv7 right now. I also don't have time to figure out what changed to cause this for the next week or so.


    I can't say it enough times but it would be REALLY nice if someone else helped with this plugin.

    omv 8.1.1-1 synchrony | 6.17 proxmox kernel

    plugins :: omvextrasorg 8.0.2 | kvm 8.0.7 | compose 8.1.5 | cterm 8.0 | borgbackup 8.1.7 | cputemp 8.0 | mergerfs 8.0 | scripts 8.0.1 | writecache 8.1.1


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


    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!

  • @ryecoarron


    1. AFAIKT, the reported bug in OMV8 does not exits in OMV7. (Surely people would have made that known by now?)


    2. Clearly an error in adding/deleting a zfs "filesystem" object, but where & why?


    3. I'm not a developer, so I report errors and id cause where possible. The code behind the zfs plugin is fairly complex.


    4. I appreciate it's not straight forward maintaining someone else's code, especially if you think it's not well structured. And it is just one of many you undertake to maintain on behalf of the user community.


    5. For the more techinical end user, debugging OMV is a challenge. You can start with putting omv-engined in debug mode and examine rpc calls, but if there's nothing obvious at that point, what next? You're not dealing with complied code with a full blown debugger where you can step through code and examine variable values etc. Maybe I'm dumb, but what else is there but to try to read/follow the relevant backend code? That's no easy task if you're not familiar with the language of OO Class, objects and methods, let alone deciding just what is the relevant code in the first place.

    • Official Post

    2. Clearly an error in adding/deleting a zfs "filesystem" object, but where & why?

    I think most of it is in the fixOMVMntEnt function in /usr/share/omvzfs/Utils.php. I ran it through AI to fix it up to save myself a lot of time but the testing is the part I know I probably don't cover all the bases on. If you want to download my changed Utils.php and restart engined to see if this fixed the problem and/or broke something new, that would be helpful - https://omv-extras.org/testing/Utils.php

    This code does backup /etc/openmediavault/config.xml to /root/ (currently) if it breaks something. The part I don't like is that it changes the uuid of the mntent entries and then changes the sharedfolders pointing at them if it has to add a missing pool/filesystem. This seems dangerous as well. I need to work on it more but it at least is adding everything to the mntent section.

    omv 8.1.1-1 synchrony | 6.17 proxmox kernel

    plugins :: omvextrasorg 8.0.2 | kvm 8.0.7 | compose 8.1.5 | cterm 8.0 | borgbackup 8.1.7 | cputemp 8.0 | mergerfs 8.0 | scripts 8.0.1 | writecache 8.1.1


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


    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!

    Edited 3 times, last by ryecoaaron ().

  • @ryecoarron I had got as far as thinking the fixOMVMntEnt function in /usr/share/omvzfs/Utils.php could be the source of reported issue. That code is tricky for a non-developer to follow as it appears to build and compare a kind of before and after array of filesystem UUIDs and calls setMntentProperty under certain conditions.


    I have applied your fix, but there is still a problem.


    What now works is:


    1. Each new zfs filestsystem now gets a unique value for the omvzfsplugin:uuid property.


    2. Adding a zfs dataset adds the correct "mntent" entries to config.xml. Deleting zfs datasets, deletes the relevant mntent entries as it should.



    What doesn't work is the "undo" of pending changes.


    1. Add a zfs filesystem dataset and it appears on the datatable UI page before confirming the change with apply. If you "undo" the change the added added filesystem is still present in the table and cannot be deleted, resulting in a red error:



    2. If you make the initial confirmation of deleting a filesystem dataset, it's removed from the UI table along with the relevant mntent entry. Clicking on "undo" pending change does not revert those changes. The user is not returned to the pool table page, but is routed to "/#/".



    The problems with "undo" of pending changes when adding or deleting zfs filesystems also exist in OMV7.

    • Official Post

    I've always hated the undo with filesystem related things and never test it. undo only restores the database. if the php makes any non-database changes, they would have to be tracked somehow and reverted. I can make the changes apply immediately removing the undo option. I more worried about the other functionality working.

    omv 8.1.1-1 synchrony | 6.17 proxmox kernel

    plugins :: omvextrasorg 8.0.2 | kvm 8.0.7 | compose 8.1.5 | cterm 8.0 | borgbackup 8.1.7 | cputemp 8.0 | mergerfs 8.0 | scripts 8.0.1 | writecache 8.1.1


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


    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!

  • I've always hated the undo with filesystem related things and never test it. undo only restores the database. if the php makes any non-database changes, they would have to be tracked somehow and reverted. I can make the changes apply immediately removing the undo option. I more worried about the other functionality working.

    Understood. Would it be possible to amend the initial UI message when confirming the deletion of zfs objects that cannot be undone?


    So far my test show your fix works for keeping zfs filesystem datasets "mntent" entries aligned in the config.xml. Thanks again for looking at this.

    • Official Post

    Would it be possible to amend the initial UI message when confirming the deletion of zfs objects that cannot be undone?

    If it never shows you an "undone" button (or apply for that matter), does it still need to tell you that?

    omv 8.1.1-1 synchrony | 6.17 proxmox kernel

    plugins :: omvextrasorg 8.0.2 | kvm 8.0.7 | compose 8.1.5 | cterm 8.0 | borgbackup 8.1.7 | cputemp 8.0 | mergerfs 8.0 | scripts 8.0.1 | writecache 8.1.1


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


    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!

  • NO. AFAIK, the only actions on the omv storage zfs pools datatable page that currently accompanied by a "pending configuration" message are adding or deleting filesystem datasets (I've not looked at clones). As long as the correct mntent entries are added/deleted on the main config.xml there's no point in an "apply button" if there can be no "undo".

    • Official Post

    That is an easy change to make.

    omv 8.1.1-1 synchrony | 6.17 proxmox kernel

    plugins :: omvextrasorg 8.0.2 | kvm 8.0.7 | compose 8.1.5 | cterm 8.0 | borgbackup 8.1.7 | cputemp 8.0 | mergerfs 8.0 | scripts 8.0.1 | writecache 8.1.1


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


    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!

    • Official Post

    8.0.1 is in the repo with the new discover code and the apply change immediately.

    omv 8.1.1-1 synchrony | 6.17 proxmox kernel

    plugins :: omvextrasorg 8.0.2 | kvm 8.0.7 | compose 8.1.5 | cterm 8.0 | borgbackup 8.1.7 | cputemp 8.0 | mergerfs 8.0 | scripts 8.0.1 | writecache 8.1.1


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


    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!

  • Thanks & testing now. Seems OK.


    Just to say in the case of filesystem datasets with snapshots, attempted deletes result in RED ERROR messages and the appearance of the pending config changed banner. In this case, the "undo" does work and acts correctly as the backend validation rightly prevents the dataset delete from taking place.


Participate now!

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