[HowTo] SnapRAID in OMV

    • AndrewZ wrote:

      @crashtest,
      found this - github.com/OpenMediaVault-Plug…avault-snapraid/issues/14
      and your comment there "I'm fine with the /etc/default/ file and that should allow your changes to survive upgrades"
      It seems that was never implemented :

      Again, my regrets for being misleading. I was under the (false/untested) impression that omv-mkconf snapraid would integrate manual changes to the snapraid config file.

      I would still try an include (*.bak) statement in the GUI. From what I've seen, changes made to SNAPRAID in the GUI are appended to the end of the config file. Since these files are parsed start to finish, it's possible that an option later in the parsing order may countermand or reset options earlier in the order.

      Unfortunately, it appears that you'd have to set the same command for every drive protected. Still, it's worth a try.
    • AndrewZ wrote:

      It seems that was never implemented
      There was an accepted pull request but I guess I never pushed it out because of another pull request I need to test.
      omv 4.1.23 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.15
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • crashtest wrote:

      Since these files are parsed start to finish, it's possible that an option later in the parsing order may countermand or reset options earlier in the order.
      As I mentioned earlier, the later is ignored according to the manual, "Previous rules have the precedence over the later ones".

      crashtest wrote:

      changes made to SNAPRAID in the GUI are appended to the end of the config file
      Will be good to have some dummy file imported into the right place of the config, possibly with a check for file existence. This way we can just add all the necessary commands through such file. Or even 2 files - snapraid-pre and snapraid-post, to add content to the beginning and the end of the main config. Just an idea.
    • AndrewZ wrote:

      This way we can just add all the necessary commands through such file. Or even 2 files - snapraid-pre and snapraid-post, to add content to the beginning and the end of the main config. Just an idea.
      That is starting to defeat the purpose of the plugin. If you are going to write most of the conf file, then you don't need the plugin. I will try to look at pushing out the new version with the pull request. Just don't use the include/exclude section and put everything in the default file if you want. OR you can blank the default file and put everything in the include/exclude section.
      omv 4.1.23 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.15
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • @ryecoaaron,
      I noticed that the update is available and upgraded immediately. My mistake ;)
      Error during upgrade process:

      Source Code

      1. Reading package lists...
      2. Building dependency tree...
      3. Reading state information...
      4. The following packages will be upgraded:
      5. openmediavault-snapraid
      6. 1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
      7. Need to get 0 B/44.0 kB of archives.
      8. After this operation, 0 B of additional disk space will be used.
      9. (Reading database ... (Reading database ... 5%(Reading database ... 10%(Reading database ... 15%(Reading database ... 20%(Reading database ... 25%(Reading database ... 30%(Reading database ... 35%(Reading database ... 40%(Reading database ... 45%(Reading database ... 50%(Reading database ... 55%(Reading database ... 60%(Reading database ... 65%(Reading database ... 70%(Reading database ... 75%(Reading database ... 80%(Reading database ... 85%(Reading database ... 90%(Reading database ... 95%(Reading database ... 100%(Reading database ... 61590 files and directories currently installed.)
      10. Preparing to unpack .../openmediavault-snapraid_3.7.4_all.deb ...
      11. Unpacking openmediavault-snapraid (3.7.4) over (3.7.3) ...
      12. Setting up openmediavault-snapraid (3.7.4) ...
      13. Updating configuration database ...
      14. Running migration conf.service.snapraid_3.7.4
      15. cat: /etc/default/omv_snapraid_excludes: No such file or directory
      16. dpkg: error processing package openmediavault-snapraid (--configure):
      17. subprocess installed post-installation script returned error exit status 1
      18. Processing triggers for openmediavault (4.1.23-1) ...
      19. Updating locale files ...
      20. Updating file permissions ...
      21. Purging internal cache ...
      22. Restarting engine daemon ...
      23. Errors were encountered while processing:
      24. openmediavault-snapraid
      25. >>> *************** Error ***************
      26. <<< *************************************
      27. >>> *************** Error ***************
      28. <<< *************************************
      29. >>> *************** Error ***************
      30. <<< *************************************
      Display All




      Then the error comes up when I'm navigating into Snapraid in the menu tree:

      Source Code

      1. The property 'updthresh' does not exist in the model 'conf.service.snapraid'.
      and here are details:

      Source Code

      1. Error #0:
      2. OMV\AssertException: The property 'updthresh' does not exist in the model 'conf.service.snapraid'. in /usr/share/php/openmediavault/config/configobject.inc:71
      3. Stack trace:
      4. #0 /usr/share/php/openmediavault/config/configobject.inc(186): OMV\Config\ConfigObject->assertExists('updthresh')
      5. #1 /usr/share/php/openmediavault/config/configobject.inc(271): OMV\Config\ConfigObject->set('updthresh', '0', false)
      6. #2 /usr/share/php/openmediavault/config/configobject.inc(233): OMV\Config\ConfigObject->setFlatAssoc(Array, false, false)
      7. #3 /usr/share/php/openmediavault/config/database.inc(90): OMV\Config\ConfigObject->setAssoc(Array, false)
      8. #4 /usr/share/openmediavault/engined/rpc/snapraid.inc(61): OMV\Config\Database->get('conf.service.sn...')
      9. #5 [internal function]: OMVRpcServiceSnapRaid->getSettings(NULL, Array)
      10. #6 /usr/share/php/openmediavault/rpc/serviceabstract.inc(123): call_user_func_array(Array, Array)
      11. #7 /usr/share/php/openmediavault/rpc/rpc.inc(86): OMV\Rpc\ServiceAbstract->callMethod('getSettings', NULL, Array)
      12. #8 /usr/sbin/omv-engined(537): OMV\Rpc\Rpc::call('SnapRaid', 'getSettings', NULL, Array, 1)
      13. #9 {main}
      Display All
      The rest is working fine, I only had to manually populate /etc/default/omv_snapraid_excludes

      Finally, this section in /usr/share/openmediavault/mkconf/snapraid probably needs correction:

      Source Code

      1. # Add dynamic default excludes
      2. cat <<EOF >> ${SNAPRAID_CONFIG}
      3. exclude /${SNAPRAID_FILENAME}*
      4. EOF
    • AndrewZ wrote:

      Then the error comes up when I'm navigating into Snapraid in the menu tree:
      This is what I get for assuming a pull request is tested. 3.7.5 in the repo now.

      AndrewZ wrote:

      Finally, this section in /usr/share/openmediavault/mkconf/snapraid probably needs correction:
      What needs correction?

      frankschm wrote:

      Also i got a lot of warnings like WARNING! Ignoring special 'socket' file 'FILEPATH' during the sync-process.
      This isn't something the plugin can fix.
      omv 4.1.23 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.15
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • AndrewZ wrote:

      with the current code we have the following line added to the config, looks strange for me
      exclude /snapraid.conf*
      I have no such files at / on my system, so I see no reason to exclude them.
      My apologies if I'm missing something.
      Thank you for the quick fix.
      When you put a leading slash on a file, snapraid looks at the root of the mount for each drive in the array not the absolute path in the root of the system. In my original code, I was excluding the snapraid.conf file everywhere but the pull request argued that someone may want to have a backup in a subfolder. Not sure why since it is a generated file but I really didn't care.
      omv 4.1.23 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.15
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • AndrewZ wrote:

      P.S. plugin Information page now requires an update in regards to default excludes.
      While I don't mind the feature in the plugin, I would prefer people not use it since it requires the command line and really not need by 99% of users.
      omv 4.1.23 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.15
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • @ryecoaaron
      I see your point and actually meant something different - I've got a feeling that all the defaults mentioned on the Information page are not in the config anymore, so I had to put them into /etc/default/omv_snapraid_excludes. For me it was like 'there are no exclusions by default'. Again, maybe it just me and I'm missing something ;)
    • AndrewZ wrote:

      I see your point and actually meant something different - I've got a feeling that all the defaults mentioned on the Information page are not in the config anymore, so I had to put them into /etc/default/omv_snapraid_excludes. For me it was like 'there are no exclusions by default'. Again, maybe it just me and I'm missing something
      I see what you meant now. Fixed in 3.7.6 in the repo now. The default file will now be named /etc/default/openmediavault-snapraid though because it is created using the proper dpkg method.
      omv 4.1.23 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.15
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!