Rebuilding greyhole pool after reinstalling OMV

  • Had my mediaserver set-up, running like a charm including plex services to many remote devices. Was having some trouble adding new media prepared on one PC over my home LAN as a windows share, so I started messing around with permissions and sharing until I had it screwed up good. Decided my only choice was to do a restore using my Clonezilla backup. Learned something new in that process, but it was a painful lesson. My Clonezilla backup was on the top directory of a 300 GB WD Passport. My OS drive in the server is only a 100GB SSD. In the course of doing the restore Clonezilla erased the SSD, but then could not do the restore because the source drive was 3 times larger than the target. Tried all kinds of ways to migrate the backup to a 32 GB flash drive but got no where. Bottom line, had to do a complete reinstall and set it up anew. Now, to the point - I had my 4, 4TB media drives in a greyhole pole, so each of them already has a greyhole directory on them. My plan was to re-create the greyhole pool on the now restored system, but am not sure whether I need to do something with the existing greyhole directories first. (Also, BTW, I am having trouble installing the MySQL plugin - though other PLEX and other plugins installed no problem. Just goes to "Get: http:// etc, and sits there).


    Any advice would be appreciated.


    UPDATE: The issue installing MySQL (and a couple of other problems) was solved. I had to comment the deb CDROM out of my sources.list

    G Elliott


    System:
    Silverstone Tek DS380B Mini-ITX DTX NAS Case
    Silverstone Tek 450W SFX PSU
    ASUS H87I-Plus Mini ITX
    Intel Pentium G3420 3.2GHZ
    Patriot G2 2x4 GB DDR3
    Samsung EVO 120 GB SSD (System)
    WD Black 4x4TB (Media)
    Openmediavault 4.1.8.2-1 (Arrakis)
    Plexmedia Server - remote media access
    XBMC - Kodi for local/home theater (SMB)

    Einmal editiert, zuletzt von gtelliott ()

  • To backtrack a little bit; the fact that your clonezilla image is stored on a 300GB drive is irrelevant. What is relevant is the size of the original drive that was imaged.


    Are you saying that you imaged your 100GB SSD with clonezilla and now you cannot restore the image to the same 100GB SSD ? If that is the case, then something is wrong. Storing the image on a 300GB (or 6TB, or whatever) drive makes no difference.


    If you can figure this restore issue out, you might not have to mess with all the other stuff.

  • Thanks Cogitech for taking the time to reply. When I decided to go ahead and restore using the backup on the passport - followed the steps but it would never offer me the option to choose to restore - only the two options to either back up an image or a device. Point being, yeah I think something was wrong with my back up because clonezilla was not detecting it as a "device-image" from which it could restore. Anyway - at the point of no return now. I monkeyed around with that Passport until none of my OS's would even recognize the device anymore. I ultimately had to clean it in diskpart using CLI on my Windows PC - then reformat to even use it. So, here I am with my server all set up and the media drives all in, but I'm afraid to move on setting up plex and greyhole the way I had them again, because the data drives already have greyhole directories on them - and one still has the former plex library directory on it. My first inclination is just to delete those directories (if it will let me) - and rebuild. What I am unclear on is, since greyhole "balances" the data across the drives in the pool - if I delete the greyhole directories how is it going to effect the samba shared files that were on the drives brought into the pool. (It looks like none of those original files were actually moved - but there is a lot of them so I can't be certain. )


    Thanks again.

    G Elliott


    System:
    Silverstone Tek DS380B Mini-ITX DTX NAS Case
    Silverstone Tek 450W SFX PSU
    ASUS H87I-Plus Mini ITX
    Intel Pentium G3420 3.2GHZ
    Patriot G2 2x4 GB DDR3
    Samsung EVO 120 GB SSD (System)
    WD Black 4x4TB (Media)
    Openmediavault 4.1.8.2-1 (Arrakis)
    Plexmedia Server - remote media access
    XBMC - Kodi for local/home theater (SMB)

  • I took a few minutes to look through the differing media files (MKV's mostly" on the drives that were in the greyhole pool. All are greyed out with red X's over them - and indications that they are unavailable to to "broken links". I assume this is a reference to the various symbolic links that are part of greyhole. a.k.a., just deleting the greyhole directories from the drives appears to be a no-no. However, I did come across this wiki page for reconnecting a pool for an Amahi reinstall here: https://wiki.amahi.org/index.p…ing_Greyhole_storage_pool, and an Amahi blog discussion by Greyhole's developer (Boudreau) discussing how to reconnect your greyhole pool after an OS reinstall here: https://forums.amahi.org/viewt…ee3612e474edbf4d&start=10


    Because of my effort to copy my backup file to another computer in order to put it on a smaller drive, I do have copies of most of the root and user folders/files from that backup that those discussions refer to, including my greyhole.config file, my Samba folder and my fstab file. Nonetheless, I don't think I have anywhere the skill or knowledge to use the information from those discussions to pull off without some guidance from someone vastly more knowledgeable.

    G Elliott


    System:
    Silverstone Tek DS380B Mini-ITX DTX NAS Case
    Silverstone Tek 450W SFX PSU
    ASUS H87I-Plus Mini ITX
    Intel Pentium G3420 3.2GHZ
    Patriot G2 2x4 GB DDR3
    Samsung EVO 120 GB SSD (System)
    WD Black 4x4TB (Media)
    Openmediavault 4.1.8.2-1 (Arrakis)
    Plexmedia Server - remote media access
    XBMC - Kodi for local/home theater (SMB)

  • Hi G,


    Well one thing that makes Greyhole complicated is the fact that it stores all of it's metadata (info about what files it is putting where and which symlinks it has created, etc.) in an SQL database. Without that database, all you really have is drives with files and symlinks. I only used greyhole for about 10 days and then abandoned it, but this is what I know.


    - Greyhole moves files to the ".greyhole" directory on the disk (or disks, depending on how many copies you chose for that share)
    - Greyhole creates symlinks in the "landing zone" disk, which is where the actual share folder is (the one you used to create the Samba share originally)
    - Greyhole tracks all this in a database


    Without the database, Greyhole has no idea about what is where. As I said above, you just have symlinks and files. With a newly re-installed OMV, the symlinks may not even be relevant anymore (perhaps broken symlinks = red Xs in your OS).


    The good news is, your files are (likely) still there, in the ".greyhole" directories. These are hidden by default, but you'll find them if you ssh into OMV and then "cd" to /media/UUID/.greyhole/ (where UUID is the UUID of your data disk(s).


    The least complicated way to deal with this (which is what I did when Greyhole exploded on me) is to amalgamate all those files in the ".greyhole" directories onto a separate drive that can hold them all, and then blow away everything. At that point you can start a whole new Greyhole pool, or look at other options.


    To amalgamate all those files in the ".greyhole" directories onto another drive, I used rsync at the command-line. You can do it manually from your windows machine if you like, as long as you have appropriate permissions to the various file systems.


    There may be a simpler way of doing all this. I am no Greyhole expert, I am just someone who had a similar situation and dealt with it.


    I switched to snapraid + mhddfs to accomplish my goals. So far it is very simple and very effective, and I do not foresee me ever having to start from scratch again.

  • By the way, I think I know what might have happened with your clonezilla backup. I suspect that you "cloned" your 100GB system disk onto the 300GB disk. If this is the case, you would have had to "clone" the 300GB drive back to the 100GB drive.


    Next time you use clonezilla, use the "image" mode. This saves the image as a file which can be stored on any device (as long as it is large enough) and can be easily restored when the time comes.

  • I image my system drive to a folder in the root of one of the data disks. Then it is there for a fast restore if my system disk fails, or if I screw it up but have not done that for quire a while.

  • Thank you for your thoughts and time Cogitech - and you too Tekkb. Yes Cogitech - I pretty much figured out that I had cloned the drive/partition rather than an image of the OS when I did the backup (still don't know how but that was months ago). That was why I spent most of Saturday trying to clear any other files of that Passport, then shrink the partition with the backup on it down to 80GB using GParted. I let GParted run all day and all night but it never got past "the read only . . . was successful" so I had to cancel it and shut it down. After that the Passport was too corrupt to do anything with so I had to reformat it and move on.


    Tekkb - I had actually intended to clone an image to a regular USB Flash Drive that I could just leave in one of the ports on the serve - but could not find one in the house that day so I used the Passport - and screwed it up anyway.


    As for the prospect of migrating the files within the Greyhole directories on the media drives, I'll have to look at that. I had Greyhole set to make two copies of each file, but I still don't know how much storage space those files would require - but the total data used on the 3 main media drives (including the greyhole directories) in the pool is in excess of 13TB. I actually used Greyhole as my last, best way to protect the media because it looked like any other choice for true redundancy would have been a problem with so much data on a serve that only stores 7 media drives. I have seen much conversation on here about folks going to snapraid and mhddfs - and will look at it once I am sure I can safely retrieve my media - but I haven't looked at it enough to know if storage space will be an issue.


    My preference would be to reconnect the pool, then remove the drives from the pool correctly using the pool management tools.

    G Elliott


    System:
    Silverstone Tek DS380B Mini-ITX DTX NAS Case
    Silverstone Tek 450W SFX PSU
    ASUS H87I-Plus Mini ITX
    Intel Pentium G3420 3.2GHZ
    Patriot G2 2x4 GB DDR3
    Samsung EVO 120 GB SSD (System)
    WD Black 4x4TB (Media)
    Openmediavault 4.1.8.2-1 (Arrakis)
    Plexmedia Server - remote media access
    XBMC - Kodi for local/home theater (SMB)

  • Your data is safe in those .greyhole directories, however, even if you could "reconnect the pool, then remove the drives from the pool correctly" I do not think you would magically just get all your files back as they were before.


    If I were you, I would:


    1) Disable or uninstall the greyhole plugin.


    2) ssh into OMV (as root) and rename each ".greyhole" directory (on each data drive) to "Data1", "Data2", "Data3", etc.


    Code
    mv /media/UUID_of_your_disk/.greyhole /media/UUID_of_your_disk/Data1


    etc.


    Note: to get UUIDs for disks you can use a combination of the following commands:


    Code
    blkid


    Code
    df -h


    Note2: when typing the UUID in the path at the command-line, simply type the first letter or 2 and then hit tab and it will autocomplete.


    3) Log in to OMV webGUI and install the "unionfilesystems 1.2" plugin


    4) Once installed, go to the "Aufs/Mhddfs" plugin, click "Add", give your new pool (volume) a name, select mhddfs from the dropdown, and then select all the data drives except one (doesn't matter which, but remember which) and click save. We are leaving one drive out because it will become the parity disk in the snapraid, eventually.


    5) Now we want to amalgamate everything in the Data1, Data2, etc. directories into a common directory in the pool. This will remove duplicates and provide a more convenient structure. Simply do:


    Code
    mkdir /media/UUID_of_pool_volume/Media

    Name this directory whatever you want, but I will use "Media" in the example.


    Code
    rsync -av --ignore-existing --remove-source-files /media/UUID_of_Disk1/Data1/* /media/UUID_of_pool_volume/Media/

    This effectively "moves" everything from Disk1's "Data1" directory to the pool's "Media" directory. Continue with the rest of the "Data" directories on the other disks...


    Code
    rsync -av --ignore-existing --remove-source-files /media/UUID_of_DiskN/DataN/* /media/UUID_of_pool_volume/Media/

    (where "N" is replaced accordingly)


    ...continue until all the media files/folders from the Data1, Data2, DataN directories (including the stuff from the disk you left out of the pool) are contained in /media/UUID_of_pool_volume/Media


    *** You should now have an mhddfs pool with a top-level Directory ("Media" in my example) that has all your (non-duplicate) media files in it.


    6) Go to SMB/CIFS and create a new share - use the "Media" folder on that "pool" volume.


    7) Use your windows machine to browse to this new share. You should be able to see all your media files in the "Media" folder. Anything written to that share will go in the pool.


    8 ) Now, it is simply a matter of moving or deleting any directories or data off that "reserved" (non-pool) drive and then installing snapraid and setting it up. It is really easy. Just follow the guide and use the non-pool drive for parity. Note: Until this step is taken and you complete a snapraid "sync", your data is not redundant!


    If you have any questions about any of this, ask before doing it. Your data is safe as long as you don't get hasty.


    P.S. The rsync command above will move the files to the pool and amalgamate it all, but it will leave behind all the empty directories in the "Data1..DataN" directories. You'll have to go back and delete them, with the "rm" command.


    P.P.S. Using rsync for this is slow compared to the unix "mv" command, however "mv" cannot merge as we need it to here.

  • Your too good and working too hard cogitech but I do very much appreciate the work. Not at the computers now (iPhone so forgive typos) will work at it first thing in the morning and update (or post my first question) thanks again G

    G Elliott


    System:
    Silverstone Tek DS380B Mini-ITX DTX NAS Case
    Silverstone Tek 450W SFX PSU
    ASUS H87I-Plus Mini ITX
    Intel Pentium G3420 3.2GHZ
    Patriot G2 2x4 GB DDR3
    Samsung EVO 120 GB SSD (System)
    WD Black 4x4TB (Media)
    Openmediavault 4.1.8.2-1 (Arrakis)
    Plexmedia Server - remote media access
    XBMC - Kodi for local/home theater (SMB)

  • No worries.


    Take it slow and don't proceed to the next step unless you 100% understand it.


    Also note that I may have forgotten something, or there might be better ways to do some of the things I have written. If so I can only hope that some other nerds chime in and slap me with a big fish.

  • Morning Cogitech (and all who review). I apologize for the delay in getting back on this - ran into a few roadblocks but I am now up, running and restoring Plex libraries. Here's my report. I was a complete "fail" at the rsync source code. I copied and pasted your rysnc code - inserting (what I thought were) the UUID's for the renamed greyhole folders where appropriate. Response was statements to the effect that neither the source or target directories existed. I assumed I had just screwed up the line or syntax - and prepared to re-code. Unfortunately - when I looked back at the source drive/folder, where it used to contain 3.62 TB's of data, it reflected that it now only contained 26 MB. The source data went somewhere, but where that is, is still a mystery to me.


    Anyway, fearful that any additional efforts to use the code might leave me with zero copies of my media files, I shut it down, pulled the data drives out and installed the current Debian Wheezy OS with the desktop environment so that I could (hopefully) be able to better visualize the media files, etc at the terminal. I then restored the media drives and manually moved each individual .mkv, .mp4 and .m4v file (all 548) off the former greyhole drive into new folders on a new drive. It took me pretty much days as many of the files are 30GB+. Though a few of the mp4 files appear to be bad - they may have been bad before. Near as I can tell there are only 2 files missing altogether - and again, they could have been lost before the crash.


    Anyway, like I say the libraries are restoring as I speak and I will soon I look at your suggestion of mhddfs and snapraid - and tekkb's symlink setup. Want to first look at the issue that got me into the restore/crash problem to begin with. I create/format all of the media backups I put on the server on a PC that is hardwired into the same - home LAN as the Server. When I need to add/remove/rename or otherwise work with an individual media file that is already on the server - I open the Server and (1) copy/move the new file into the Share Folder over the LAN, delete a bad file that is already on the server, rename if scraper problems, etc. Anyway, when I was trying to add/remove/rename individual files that were in SMB share folders - but on drives that were also in the greyhole pools I started getting "cannot communicate with MediaServer" error messages. That was what led me to mess around with the permissions on the PC to the point that the server eventually disappeared from the LAN altogether. I already know I have to rename all of the individual Show backups before I can add them to my Plex Library, because they were previously scraped into a library by Plex - so the names have more than the required S01-E02 info, a.k.a., Plex says "your library has no content" even though I can see the files on the PC - and run them no problem as SMB shared files on MY HTPC.


    If I assume I will probably need to move new files in, remove bad files and/or rename/edit individual media files that are on the server - by opening them as SMB shares on a LAN PC, which storage/redundancy set-up would any of you suggest?


    Thanks as always. gte


    UPDATE: Show names turned out to be fine - don't know why Plex originally said "your library contains no content" the first time I tried to add them - in now.

    G Elliott


    System:
    Silverstone Tek DS380B Mini-ITX DTX NAS Case
    Silverstone Tek 450W SFX PSU
    ASUS H87I-Plus Mini ITX
    Intel Pentium G3420 3.2GHZ
    Patriot G2 2x4 GB DDR3
    Samsung EVO 120 GB SSD (System)
    WD Black 4x4TB (Media)
    Openmediavault 4.1.8.2-1 (Arrakis)
    Plexmedia Server - remote media access
    XBMC - Kodi for local/home theater (SMB)

    Einmal editiert, zuletzt von gtelliott ()

  • If I assume I will probably need to move new files in, remove bad files and/or rename/edit individual media files that are on the server - by opening them as SMB shares on a LAN PC, which storage/redundancy set-up would any of you suggest?


    Sorry to hear that things didn't go smoothly, but at least you had the sense to remove the drives and avoid catastrophe while re-building.


    Regarding the specific question above, my answer is not greyhole. The reason I say this is because greyhole takes action on it's own, moving/copying files, creating symlinks, updating the database, etc. It is automated - and it often starts doing these things right at the worst possible times, like when you are in the middle of mass file transfers or renaming and moving files around manually yourself. This is exactly what proved to be a huge issue for me with greyhole - it literally brought my NAS to its knees.


    I am using my NAS much the way you do and I have had zero issues with mhddfs and snapraid.


    mhddfs is a "set it and forget it" arrangement. Solid.


    Snapraid only takes action when you want it to. You can do it manually or setup cron jobs for late at night, or whatever. Either way, it'll never clobber your system when you are trying to do other things. Like any RAID, it is not a replacement for backups. For critical data that cannot be found elsewhere (ie. re-downloaded from the Internet, etc.), you will still want to backup (regardless of what drive redundancy you have in place).

  • I've answered my own question. I don't have a second server capable of handling so much data so - Tekkb's solution is a no-go. Gonna go with the aufs snapraid suggested by Cogitech. One question. My plexmediaserver library is on the drive (otherwise empty) I think I'll use as the parity drive, so I gotta move it. I've seen old threads talking about editing the etc/default/plexmediaserver file - but I think that was before Plex was a plug-in. On the settings tab for Plex in the WebGui - it says "Database files will move to new location if database volume is changed". Can I take that to mean that I can just change the volume - and the configuration changes will take care of themselves - or is it a warning not to change your volume and cause your database files to be moved to a location and screw up your existing configuration?


    Thanks
    gtelliott

    G Elliott


    System:
    Silverstone Tek DS380B Mini-ITX DTX NAS Case
    Silverstone Tek 450W SFX PSU
    ASUS H87I-Plus Mini ITX
    Intel Pentium G3420 3.2GHZ
    Patriot G2 2x4 GB DDR3
    Samsung EVO 120 GB SSD (System)
    WD Black 4x4TB (Media)
    Openmediavault 4.1.8.2-1 (Arrakis)
    Plexmedia Server - remote media access
    XBMC - Kodi for local/home theater (SMB)

  • Ah. I see we posted simultaneously Cogitech. Thanks again for your input - and you see I have decided to take your suggestion. I don't really want my plexmediaserver library to be in the snapraid/aufs itself, Do you have any info on the question of moving it off that drive?


    G


    UPDATE: BTW I did see an older discussion in which the original author had his media drives set up in Snapraid and loaded into a Plex library, and one of the moderators, davidh2k or ryecorr I think said something to the effect of, "why do you need a pool if all of the data is already in a Plex library". I have been thinking about that - and I think I get what he means. Snapraid makes sense for the redundancy, but I am not sure what the aufs pooling adds to the deal.

    G Elliott


    System:
    Silverstone Tek DS380B Mini-ITX DTX NAS Case
    Silverstone Tek 450W SFX PSU
    ASUS H87I-Plus Mini ITX
    Intel Pentium G3420 3.2GHZ
    Patriot G2 2x4 GB DDR3
    Samsung EVO 120 GB SSD (System)
    WD Black 4x4TB (Media)
    Openmediavault 4.1.8.2-1 (Arrakis)
    Plexmedia Server - remote media access
    XBMC - Kodi for local/home theater (SMB)

    Einmal editiert, zuletzt von gtelliott ()

  • Ah. I see we posted simultaneously Cogitech. Thanks again for your input - and you see I have decided to take your suggestion. I don't really want my plexmediaserver library to be in the snapraid/aufs itself, Do you have any info on the question of moving it off that drive?


    G


    I think you need to take some time to consider exactly what it is that you want to accomplish and then consider which tools you need in order to accomplish them.


    When you say that you don't want your plexmediaserver library to be in the snapraid/aufs itself, it makes me wonder what your goals are for the system. Or, are you referring to the plexmediaserver database?


    You are correct that you will want to get everything off the drive that you want to use as the snapraid parity disk. I am pretty sure that the option in the plex plugin allows you to move the database to a different drive. If it was me, I would want that database to be in the snapraid, but that's totally up to you.


    One thing that I think is important is to really think of snapraid and mhddfs as completely separate things. They work awesome together, but don't think that one depends on the other or anything. You can easily use one without the other if want to.


    PS. I really do recommend mhddfs over aufs - especially since you say you will be moving, renaming, deleteing, etc. files. This is one thing that aufs does very poorly - it is in fact the main caveat of aufs that makes people choose mhddfs.


    P.P.S. Do some reading about how to use "exceptions" to prevent certain files and folders from getting included in the snapraid parity data. This way you can store your database on any disk in the snapraid (except the parity drive) but then simply choose not to include it in the parity data sync, if you wish.

  • Thanks Cogitech. Yes - I mean the Plex database. I read somewhere in another thread that snapraid has some problem if the plex database is in there. If that is not the case, I am fine with it being in there. I think the discussion was something about there being a problem with Plex library updates if the database was on one of the snapraid drives.


    Oh - and BTW, I have not looked into the differences between aufs and mddhfs yet, but understand your suggestion.


    G.


    UPDATE: Looked back through those threads on including the PMS database on a snapraid volume. You were all over it Cogitech. Keep it in there but exclude from sync (I am sure there is a better way to copy and past from this thread last March:


    Re: Setting up Snapraidby T-A-Z » Thu 13. Mar 2014, 15:18


    For excludes you may not specify a full path, rather a relative path. For example:


    Code: Select allexclude /plexmediaserver
    exclude /d1/downloads
    exclude /d1/incomplete
    exclude /d2/downloads
    exclude /d2/incomplete
    exclude /poolshare

    G Elliott


    System:
    Silverstone Tek DS380B Mini-ITX DTX NAS Case
    Silverstone Tek 450W SFX PSU
    ASUS H87I-Plus Mini ITX
    Intel Pentium G3420 3.2GHZ
    Patriot G2 2x4 GB DDR3
    Samsung EVO 120 GB SSD (System)
    WD Black 4x4TB (Media)
    Openmediavault 4.1.8.2-1 (Arrakis)
    Plexmedia Server - remote media access
    XBMC - Kodi for local/home theater (SMB)

    2 Mal editiert, zuletzt von gtelliott ()

  • This is a really simplified drawing of what things might look like once set up. A picture is sometimes worth a thousand words, as they say:



    When the "Data Vault" volume starts to run low on space, you throw another drive in, add it to the mhddfs volume, then add it to the snapraid and... go back to doing important stuff.


  • You actually don't specify "paths" in the traditional sense. You simply specify "file names" and "folder names". Regardless of what drive they are on, snapraid will omit them if they have "file names" or "folder names" that are in the exceptions list.

  • Plex database is not a Samba share with the plugin. The folder is not available in the web ui to be shared with Samba either. The chown for the plexmediaserver folder is plex:nogroup (not users for group). But nice diagram.... :)


    I have not seen anyone have issues with the plex database being in a snapraid pool either. when using mhdffs. I do find a time stamp problem with aufs.


    http://zackreed.me/articles/82-snapraid-with-plexmediaserver

Jetzt mitmachen!

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