[HowTo] SnapRAID in OMV

  • I've run into an output I don't understand using the snapraid script often linked to here: RE: [HowTo] SnapRAID in OMV


    I didn't change anything other than user variables such as my email, name of my containers, and action thresholds. But I get this output at the beginning when it runs and I couldn't figure out what a "filename argument" would be in this case.


    Code
    root@openmediavault:/usr/bin# snapraidscript.sh
    /usr/sbin/snapraidscript.sh: line 2: .: filename argument required
    .: usage: . filename [arguments]
    Setting up service array
    SnapRAID Script Job started

    Thanks for any help

    • Offizieller Beitrag

    Do you have the testing repo enabled and installed the version of the snapraid plugin that supports multiple arrays? This will break the snapraid script.

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.6 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    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!

  • Do you have the testing repo enabled and installed the version of the snapraid plugin that supports multiple arrays? This will break the snapraid script.

    I have openmediavault-snapraid 6.1 installed through the Open Media Vault plugin page. I didn't see anything in setting abut enabling testing repo or the multiple array version. I'm calling the script as "snapraidscript.sh" and put it in /usr/sbin upon advice from another threat if thats an issue.

    • Offizieller Beitrag

    I didn't see anything in setting abut enabling testing repo or the multiple array version. I'm calling the script as "snapraidscript.sh" and put it in /usr/sbin upon advice from another threat if thats an issue.

    That isn't a plugin issue then. Don't know about that script.

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.6 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    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!

  • That isn't a plugin issue then. Don't know about that script.

    I was trying to get that script working since it would disable things like Sonarr and Radarr downloading while sync and scrub is running. I can replicate a lot of the scheduling and "don't run if more than x many files are deleted" through OMV interface of Services/Snapraid/Settings but I can't find a definitive answer if downloading during a sync is bad.

  • .......but I can't find a definitive answer if downloading during a sync is bad.

    If you add files to an array member during a sync you are likely to get warnings from SnapRAID about this. I can't speak authoritatively, but it is my impression that those newly files are probably not protected by SnapRAID. The suggestion provided with the warning is to run the sync again, which seems to imply that my impression is correct.


    I avoid this problem by having my torrent client download to a directory that is excluded by a rule in SnapRAID. The downloaded files are moved to where they belong later when SnapRAID is not syncing.

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 7.x on headless Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 32GB ECC RAM.

  • Hi, guys!


    Question from newbie with Snapraid: Is really necessary to use some scripts such as https://github.com/auanasgheps/snapraid-aio-script (which doesn`t work and I didn`t figure out why) or it is enough to use 5 commands in any your custom sh file:

    Code: daily
    snapraid smart;  
    snapraid status;
    
    snapraid touch;  
    snapraid sync; 
    
    snapraid smart;  
    snapraid status;
    Code: weekly
    snapraid scrub; 

    Or just spend time and write my own script which will be checking if there is error - run scrub/fix etc?

  • If any script you are using doesn't work, find out why or try another - there are plenty of them out there.

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 7.x on headless Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 32GB ECC RAM.

  • The raw commands you list offer no flexibility as they run the defaults for the commands. So you should consider reading the SnapRaid manual to see if any of the options make sense to you and adjust accordingly. Also you don't get an emailed report that shows what was done or reports any problems encountered.

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 7.x on headless Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 32GB ECC RAM.

  • The raw commands you list offer no flexibility as they run the defaults for the commands. So you should consider reading the SnapRaid manual to see if any of the options make sense to you and adjust accordingly. Also you don't get an emailed report that shows what was done or reports any problems encountered.

    For notification I can use Schedule job and all output will be in letter and in telegram. Honestly, you can`t explain what is wrong with simple commands, but you continue to using it, nice!

  • d13m I'm the author of the script, tell me what's not working.

    Hi, thanks!

    in script-config.sh I just changed:

    Code
    EMAIL_ADDRESS="myAddress"
    FROM_EMAIL_ADDRESS="address_I_use_as_notification_in_OMV6"
    
    TELEGRAM=1
    TELEGRAM_TOKEN="my-token-here"
    TELEGRAM_CHAT_ID="my-chat-id-here"
    SPINDOWN=1
    SNAP_STATUS=1
    SNAPRAID_BIN="/home/snapraid/"

    And after execution snapraid-aio-script.sh

    Found, that was my mistake, according to description I decided that

    Code
    SNAPRAID_BIN="/home/snapraid/"

    Should be my folder where scripts placed, so changed to

    Code
    SNAPRAID_BIN="/usr/bin/snapraid"

    And script successfully started working.


    But I have a questions:

    1. Is it possible to have more details in telegram? I mean status and smart info?

    Just create one more job and all output received by telegram.


    2. I see one error

    Code
    spinning down /dev/sda
    /home/snapraid/snapraid-aio-script.sh: line 310: hd-idle: command not found

    I did not install hd-idle, probably it is the reason?

    Installed recommended hd-idle and it helped.

  • d13m nice to see some progress. So everything is working now? :)

    Yes, thanks a lot, just more carefully read description on github 😉


    May I ask here when I got message

    Zitat


    [WARNING] Deleted files (78807) / (500) violation (SnapRAID on omv6)

    If I understood correctly - That means that sync was not started, because maybe I want to recover this data?
    And for example tomorrow I will delete another 10 000 files and day after tomorrow... so my question - if I am sure that I deleted what I don`t need, it was not incidental, I have to run once one of force sync commands?

    If yes - which of them?

  • If I understood correctly - That means that sync was not started

    By default the script will not sync if the threshold is breached. The email will tell Sync is not authorized or something similar.


    The goal is to protect from unwanted massive deletions (delete protection) and ransomware (update protection). Not a backup, but still some form of protection.


    To go beyond this protection, you have two ways:

    - Increase thresholds to a value that fits your daily usage

    - Change SYNC_WARN_THRESHOLD setting to 0 - a sync will ALWAYS be forced. Be careful. This is the option I use, because emails/notifications will still alert that the threshold was breached.

  • If I don`t want to change your config and don`t know how many files I will delete tomorrow can I just make touch + sync from time to time?

  • If I don`t want to change your config and don`t know how many files I will delete tomorrow can I just make touch + sync from time to time?

    Sure, but it's a manual process.


    You also set how many times you'll be warned before forcing a sync.


    Example: If you set SYNC_WARN_THRESHOLD=2, there will be no sync for 2 runs, and finally the third will force a sync.


    Alternatively, there's a new option - not yet relased - called Added to Deleted Ratio. It will authorize a sync even if the delete threshold has been breached, but only if the ratio of added to deleted files is greater than the value set.

  • Sure, but it's a manual process.


    You also set how many times you'll be warned before forcing a sync.


    Example: If you set SYNC_WARN_THRESHOLD=2, there will be no sync for 2 runs, and finally the third will force a sync.

    Oh, with this "counter" it is the best option I think, because I can unpack my old git project there are 1000+ files, play around with it and remove and don`t know how many deleted/updated files I will have.

    Grazie for you work and help 😉

  • Oh, with this "counter" it is the best option I think, because I can unpack my old git project there are 1000+ files, play around with it and remove and don`t know how many deleted/updated files I will have.

    Grazie for you work and help 😉

    You can also exclude folders where you know you'll unpack temporary files, and will be excluded by the parity.


    This is managed by SnapRAID itself and can be achieved via OMV SnapRAID Settings.

Jetzt mitmachen!

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