[HowTo] SnapRAID in OMV

  • In the plugin, the Diff Script Settings might interest you. After configuring them you can press the Scheduled diff button to set up an automated run of the diff/sync/scrub.


    I do not use this feature myself, preferring to use one of the available third party snapRAID helper scripts.

    --
    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.

  • OMV 4 - Removing a disk - I've been loosing files (Not folder it seems, just the contents) off my WD 4TB drive which is part of my snapraid setup.

    To try to pin down the cause I decided to remove the drive from snapraid and run it as a single HDD without influence from any plugins.


    I'd like to think I used this method, but it hasn't really worked as I 'd imagined :o(


    "How can I remove a data disk from an existing array?

    To remove a data disk from the array do:

    • Change in the configuration file the related "disk" option to point to an empty directory - (Created /empty)
    • Remove from the configuration file any "content" option pointing to such disk - (Deleted the line)
    • Run a "sync" command with the "-E, --force-empty" option:
      Code
      snapraid sync -E
      The "-E" option tells at SnapRAID to proceed even when detecting an empty disk.
    • When the "sync" command terminates, remove the "disk" option from the configuration file. - (Duly Deleted)

    Your array is now without any reference to the removed disk. "


    I deleted the drive in the GUI and rebooted for good measure.


    Tested - snapraid check, and I got;


    Disk '4tbdata01' with uuid '2f54d155-695d-48e5-a50b-d13f39f6d0e8' not present in the configuration file!

    If you have removed it from the configuration file, please restore it

    If you have renamed it, run 'sync' to update the new name


    Diff and sync give the same response.


    The configuration file looks like this after the procedure, which is what I might expect.


    # this file was automatically generated from

    # openmediavault Arrakis 4.1.35-1

    # and 'openmediavault-snapraid' 3.7.7



    block_size 256

    autosave 0

    #####################################################################

    # OMV-Name: 4tbparity01 Drive Label: 40tbsdb

    parity /srv/dev-disk-by-label-40tbsdb/snapraid.parity



    #####################################################################

    # OMV-Name: 2tbdata01 Drive Label: 2tbsdc

    content /srv/dev-disk-by-label-2tbsdc/snapraid.content

    disk 2tbdata01 /srv/dev-disk-by-label-2tbsdc



    #####################################################################

    # OMV-Name: 2tbdata02 Drive Label: 2tbsde

    content /srv/dev-disk-by-label-2tbsde/snapraid.content

    disk 2tbdata02 /srv/dev-disk-by-label-2tbsde



    #####################################################################

    # OMV-Name: 1tbdata01 Drive Label: 1tbsdd

    content /srv/dev-disk-by-label-1tbsdd/snapraid.content

    disk 1tbdata01 /srv/dev-disk-by-label-1tbsdd



    exclude /snapraid.conf*

    exclude *.unrecoverable

    exclude lost+found/

    exclude aquota.user

    exclude aquota.group

    exclude /tmp/

    exclude .content

    exclude *.bak


    1 x Parity and 3 x data drives minus the previous data drive.


    Where did I go wrong?

    • Change in the configuration file the related "disk" option to point to an empty directory - (Created /empty)

    For the above step, exactly what did you have for that disk in the snapraid.conf file?

    --
    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.

  • If /srv/empty existed and was an empty directory, then snapraid sync -E should have worked and removing the disk 4tbdata01 entry in snapraid.conf should have been the end of it.

    --
    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.

    2 Mal editiert, zuletzt von gderf ()

  • If /srv/empty existed and was an empty directory, then snapraid sync -E should have worked and removing the disk 4tbdata01 entry in snapraid.conf should have been the end of it.



    Yes. I'm puzzled. The chances are that i've been fat fingered or distracted.

    I think I could probarbly re-add the drive and try the procedure again, but having gotten this far, is there another way of telling OMV that the drive is no longer part of Snapraid which would allow me to run the maintenance commands on the rest of the array?

  • I don't think there is any other way. The drive is probably still referenced in the snapraid.content file until it is properly removed.


    I am not sure why the OMV snapRaid plugin will allow you to remove a drive from the configuration without at least suggesting that some further manual intervention is needed.

    --
    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.

  • So, my 30TB NAS is ready. All data is copied from 3 other older OMV installations.


    yesterday I have manually started sync and waited some many hours and it was ready this morning. Then enabled cron en started one time the job manually.

    Got an email and info was sent.


    in OMV5 I have enabled to SnapRaid diff .. Looking in the cron I noticed that it was starting a script in /usr/sbin/omv-snapraid-diff

    what contains the diff script SCRIPTVERSION="1.1.0"


    Kewl !

    5x HP Microserver Gen8, 4x with OMV. (3x OMV4 and 1x OMV5)

    (Busy with migrating to 1 NAS) Puffer: 4x3TB RAID5; Nemo:4x3TB RAID5; Shark: 4x2TB RAID5 and Whale: 4x10TB UNIONFS with SNAPRAID

  • Although the included SnapRaid script is fine, it's very basic and there are better alternatives which cover more stuff.


    Have a look at the one I'm using now, you won't find it as is because I've customized it. I run it everyday with the settings you see, but you can customize many of them. Every setting that can be customized is documented so you understand what you're changing.


    You need to rename the file to sh.


    EDIT FROM THE FUTURE (2022)
    The script attached here was just an experiment. Please do not use it!

    Take a look my GitHub repository here to download the current version of the script, which has been expanded a lot also thanks to the community!

  • Thanks..

    auanasgheps

    Would also be nice to know what crontab command you use to start this daily

    as this custom script needs some additional parameters ;)


    oeps.. scripts was wrongly moved to the server causing some breaks to dissapear.

    5x HP Microserver Gen8, 4x with OMV. (3x OMV4 and 1x OMV5)

    (Busy with migrating to 1 NAS) Puffer: 4x3TB RAID5; Nemo:4x3TB RAID5; Shark: 4x2TB RAID5 and Whale: 4x10TB UNIONFS with SNAPRAID

    Einmal editiert, zuletzt von aroundmyroom ()

  • Just create a scheduled job from the GUI that executes this script when you want. I've set it everyday at 12pm (midday), but it's my personal preference.


    What do you mean was wrongly moved?

    OMV BUILD - MY NAS KILLER - OMV 6.x + omvextrasorg (updated automatically every week)

    NAS Specs: Core i3-8300 - ASRock H370M-ITX/ac - 16GB RAM - Sandisk Ultra Flair 32GB (OMV), 256GB NVME SSD (Docker Apps), 2x16TB HDDs w/ SnapRAID - Fractal Design Node 304 - Be quiet! Pure Power 11 350W


    My all-in-one SnapRAID script!

  • I copied it to my windows system in notepad, than copied it to my console, but here something went wrong

    I solved that.

    I now know what i can do ;)

    5x HP Microserver Gen8, 4x with OMV. (3x OMV4 and 1x OMV5)

    (Busy with migrating to 1 NAS) Puffer: 4x3TB RAID5; Nemo:4x3TB RAID5; Shark: 4x2TB RAID5 and Whale: 4x10TB UNIONFS with SNAPRAID

  • Line endings in Windows Notepad files are not the same as those in Linux text files. The two are not compatible.

    --
    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.

  • Line endings in Windows Notepad files are not the same as those in Linux text files. The two are not compatible.

    That's what I was about to say! You either convert line endings with Notepad++... or just transfer the file over.

    The line ending thing I learnt it at my expense some time ago...

    OMV BUILD - MY NAS KILLER - OMV 6.x + omvextrasorg (updated automatically every week)

    NAS Specs: Core i3-8300 - ASRock H370M-ITX/ac - 16GB RAM - Sandisk Ultra Flair 32GB (OMV), 256GB NVME SSD (Docker Apps), 2x16TB HDDs w/ SnapRAID - Fractal Design Node 304 - Be quiet! Pure Power 11 350W


    My all-in-one SnapRAID script!

  • Try Wordpad in Windows next time and see what happens.

    --
    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,


    I am totally new to OMV and is trying to test out using it with SnapRaid. But I am having some weird trouble selecting disks.


    I have 4x 1TB disks that I want to set up as 3 data drives with content file and 1 disk as parity,


    Have installed the OMV-Extras and the SnapRaid plugin. The disks are empty.


    When I open SnapRaid->Drives and choose to Add drives, I get a pop-up. When I select the dropdown list I get a millisecond of an updating spinning arrow and then the list is empty.


    But the disks are there and they do show up if I for instance try to create a regular raid.


    Really have no idea but have tried to remove SnapRaid, reboot, reinstall, reboot - but it stays the same.


    Any help would be appreciated :)


    I have attached my syslog.

  • You say the disks are empty but are they formatted and contain a filesystem yet?

    --
    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.

  • #619: I originally tried having them as wiped and blank, and have since my post tried having them individually formatted (XFS) under Filesystems. Alas, didn't change the behavior of SnapRaid dropdown menu.


    I can add that the setup is an Intel DQ77KB motherboard with 16GB RAM, 3470T CPU. OMV is installed to a Samsung 256GB miniPCIe SSD, the four disks are all 1TB Seagate 2.5" - ST1000LM035-1RK1. All the 1TB disks are set up to not power down. I want to do spindown, but I figured they might have trouble spinning up fast enough for the listing in the dialogue box to catch on. But that didn't change anything.

  • Have you mounted the drives yet?


    Can you create directories and files on these drives? If so I have no idea what the problem is.

    --
    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.

    Einmal editiert, zuletzt von gderf ()

  • Have you mounted the drives yet?


    Can you create directories and files on these drives? If so I have no idea what the problem is.

    I ended up rolling back everything, including OMV-Extras, rebooting and then going again. Worked this time. Probably some n00b mistake on my part. Thank you for responding to my cry for help :)

Jetzt mitmachen!

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