[HowTo] SnapRAID in OMV

  • Thanks for the reply Solo.


    I have nearly everything set up like I want it.
    Snapraid running, RSync is setup ok. (owncloud and notificaton etc.. all ok now.) Mirrored disk 1 and 2, with snapraid parity on drive 3.
    only one thing for me to go now.
    How to get a cron job to work. I figured out with cron you mean "Scheduled Jobs" or "Anacron". The first is per default present, and anacron is a plugin which I now downloaded. And the plugin is user friendly in the sense that it allows you to upload a script. :) I havent found a lot of scripts available yet, or a place where I can find the commands to use. Might be I did not look in the right place yet. I did find this and this one. But I don't fully understand what they do or if they are right for me. Can someone help me with this?


    I think it is good to be able to use 5 separate scripts/commands to schedule. I wont be using them all, but its probably good to have it written out somewhere how to do it all. :)
    Sync
    Scrub
    Check
    Diff
    Status


    Personally I think i'd use sync, scrub and status.


    Thanks for any help given :)

  • Another question besides the above onec :).
    Situation:
    DataDisk 1
    DataDisk 2
    ParityDisk 1


    Datadisk 1: contains all my important documents, homevideos and pictures.... etc.
    Datadisk 2: mirror of datadisk 1
    I have 1/month: RSync to backups DataDisk 1 > DataDisk 2.
    I have 1/week: SnapRAID Sync


    Do I need to worry about timestamp issues on disk 2 for SnapRAID sync job?
    Why do I ask? I just got a warning about the DataDisk being empty or backuped with fresh timestamps during attempt sync from GUI. So now I forced the sync through PuTTy. I hope this is a one time thing.

  • I would think just doing the sync command daily (or less if you don't add files often) would be good enough. The others could be run manually from time to time. The omv-snapraid-diff (your second link) is solo's script. It is beneficial because it writes the log that you can view in the log viewer. It may require some customizing though.


    As for your second post, snapraid doesn't know that you have the same files on each drive. It is just calculating parity from the files on both drives. Do you have the exact error?

    omv 5.6.18 usul | 64 bit | 5.11 proxmox kernel | omvextrasorg 5.6.3 | kvm plugin 5.1.7
    omv-extras.org plugins source code and issue tracker - github


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

  • Thanks for the replies. :) Much appreciated.


    @ ryecoaaron: I just tried open logfiles of SnapRAID in 'system logs' and look at the actual text.. Cant seem to open that. This is what I see.



    Code
    Error #6000:
    exception 'OMVException' with message 'Failed to open the log file (filename=/var/log/snapraid.log).' in /usr/share/openmediavault/engined/rpc/logfile.inc:83
    Stack trace:
    #0 [internal function]: OMVRpcServiceLogFile->getList(Array, Array)
    #1 /usr/share/php/openmediavault/rpcservice.inc(125): call_user_func_array(Array, Array)
    #2 /usr/share/php/openmediavault/rpc.inc(79): OMVRpcServiceAbstract->callMethod('getList', Array, Array)
    #3 /usr/sbin/omv-engined(501): OMVRpc::exec('LogFile', 'getList', Array, Array, 1)
    #4 {main}


    So showing actual log doesnt work I guess.
    But if I remember correctly:
    I first did a Sync job with DISK 1 containing data (Disk 2 still empty).
    RSync to mirror Disk 1 > Disk 2.
    Run Sync job again, which resulted in a message telling me the number of changes is too large, due to rebuild, whipe or backup/restore without timestamp preservations. (This is where I did a sync forced)
    This is where my question came from. But I havent restarted the sync job since I backuped disk 1 to disk 2.


    Just to test, I ran the syncjob again. It works fine. Disk 1 contains some newer files compared to disk 2. Sync job does his work. I gues this setup like this works fine. :)


    @ solo, that would be awesome. But don't pressure yourself over it. Its not a critical thing, but nice to have in the foreseen future.
    btw, the link you send with 'separating job and schedule' doesnt work for me. Guess me not being a team member (yet) causes this... lol

  • Click Clear. The log file isn't created until you click clear or a log entry is logged. The pushbuttons in the snapraid plugin don't log anything (yet).


    You must have some weird rsync options causing this issue.

    omv 5.6.18 usul | 64 bit | 5.11 proxmox kernel | omvextrasorg 5.6.3 | kvm plugin 5.1.7
    omv-extras.org plugins source code and issue tracker - github


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

  • Hello,


    i have setup snapRAID in omv 1.x with 7 Disks, 2 Parity Disks, 5 Data Disks.


    I just have a questions about the user-expirience of the snapRAID Plugin. (maybe I just don't see how to achive this easily from webui)


    I start a sync job from the webui... (let's say its a very long sync job)
    -After some time webui has session timeout.
    Is there any way to see the current % of the sync job? (from Webui)


    Would it not be a nice feature (in the snapRAID plugin) to see that there is an active sync job and the current % of the sync job, time when the last sync job was successfully done.


    Regards
    firsttris

  • I wrote code to output this:


    I'll look into the %-display @ sync output

  • some more question:


    1.)
    lets say i have just lost 1 disks... all other disks seem to be okay!
    > ill replace this disk with a new one, configure the new disk in the snapRaid plugin to be the disk.
    If i press "Fix" in the snapraid plugin it will run a full snapshot restore which means by default the full array is processed. (basically it will run snapraid fix)
    (This will take a long time..) 100gb was filled on my lost disk, a "snapraid fix" took 7 hours!


    But if i restore just this ONE disk using:
    snapraid -d name_of_the_lost_Disk fix
    it will be quite faster than "snapraid fix"
    Is this correct? (have not tried it..)


    In Snapshop Plugin (webui) it would not be nice to have a Button to Fix only the selected disk.


    2.)
    How can i remove a data disk from an existing snapraid array?


    Snapraid Manual:

    Quote


    First change in the configuration file the related "disk" option to point to an empty directory, and then run a "sync" command with the option "-E".
    snapraid sync -E
    The "-E" option just tells at SnapRAID to proceed even when detecting an empty disk.
    When the "sync" command terminates, remove the "disk" option from the configuration file.


    Means i have to edit my /etc/snapraid.conf and change my disk for example:
    from: disk data5 /media/82301664-5b23-4b2e-aba6-92ceb9d2cd7a
    to: disk data5 /home/emptyFolderForSnapraid/


    Is this correct?


    Is there a way to remove a data disk correctly from snapraid array in the snapraid plugin (webui) ?


    regards
    firsttris

  • Thx for your response, really appreciate your work.
    Openmediavault is mindblowing.


    By setting up snapRAID on my server this ideas came up. Maybe you`ll like them too ;)


    My Summary:


    1.) (In SnapRaid Plugin) Possibility to see if there is an active snapRAID job, jobtype and current status of job.
    [Maybe execute all snapRAID functions with external logfile display the logfile in SnapRaid plugin? Using a manual refresh button like in syslog]


    2.) Fix selected Disk(s) Button > snapraid -d name_of_the_lost_Disk fix


    3.) Correctly remove a disk from a SnapRaid Array.
    [Which means config will be change (the removed disk is pointing to an empty directory on sys e.g. /home/empty/) and sync is executed using -E (snapraid sync -E)


    Regards
    firsttris

  • I have updated my server from OMV 0.5 to a fresh clean installation of OMV 1.1.


    And I have seen that the omv-snapraid-diff script is allready included in /usr/local/bin. I using it with an anacron job and until now it is working without problems for me.


    But, can I already use the scrub section of this script? Or is this function commented out because of any problems?


    Thanks.
    kalle

  • Well, one of my disks started to throw warnings at the smart check. I do have read the manual and I have some questions, perhaps you could give me a hand.
    Yesterday I made a Sync. I don't add files so often so that would be good. (note that I only make syncs, anything more)
    Now, I simply have to shutdown the server, swap the disk for a new one, restart, point the previous disk configuration in snapraid to the new one and push the fix button?


    And what happens with AUFS?
    Do I have to do something previously to unplug the old disk?
    This command I suppose it's the replacement to "fix" button for doing a single disk. But what it's supposed to be the name, the gui or the name I gave it (sas1, sas2...)? Old, or new? (I want to replace it, not plugging on another port)
    And the log file... it's the parity in the parity disk?

    Code
    snapraid -d name_of_the_defective_Disk -l /path/to/logfile fix


    It seems to me more of a command to prepare things before unplugging. ?(

  • There is a little typo in line 349 of omv-snapraid-diff.
    The " in the middle is to much.


    Code
    echo "SnapRAID SCRUB-Cycle count not met. No scrub was run." - $(date)" >> $TMP_OUTPUT
  • Yesterday I made a Sync. I don't add files so often so that would be good. (note that I only make syncs, anything more)
    Now, I simply have to shutdown the server, swap the disk for a new one, restart, point the previous disk configuration in snapraid to the new one and push the fix button?


    yes, then Snapraid checks and fixes ALL files that have been deleted since the last sync, which takes long. With the other command you posted, you'll restore only the files on the defective disk. But both of the commands work.


    And what happens with AUFS?

    remove the disk from the AUFS-Pool before removing it. After Snapraid has finished recovering, you can add the new disk back to the Pool


    This command I suppose it's the replacement to "fix" button for doing a single disk. But what it's supposed to be the name, the gui or the name I gave it (sas1, sas2...)? Old, or new? (I want to replace it, not plugging on another port)
    And the log file... it's the parity in the parity disk?

    Code
    snapraid -d name_of_the_defective_Disk -l /path/to/logfile fix


    It seems to me more of a command to prepare things before unplugging. ?(


    see above

    There is a little typo in line 349 of omv-snapraid-diff.
    The " in the middle is to much.


    Code
    echo "SnapRAID SCRUB-Cycle count not met. No scrub was run." - $(date)" >> $TMP_OUTPUT


    of course. Will fix this tomorrow.
    Thx for reporting

Participate now!

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