Mergerfs not showing files

  • I had a mergerfs pool set up with two drives which was working fine, but recently I had to restart my server a few times (during some of the restart one of the drive that is in the pool was not connected, while the other was). Now once I put everything back and started up the server for normal use, the mergerfs file system is empty. The data shouldn't be lost, since if I SSH into the server I can cd to both of my drives and the files that were there are still there, but if I look at the SMB that is based on the mergerfs file system or if I cd to the /srv/mergerfs folder in the console, it is empty.


    Is there some way to fix this and make mergerfs "recognize" my files again?

    Any settings that I should do differently so this won't happen in the future?


    PS:

    This is the output for sudo omv-showkey mergerfs

    • Offizieller Beitrag

    Indeed, as you say, the data will never be deleted unless you delete it yourself.

    So I think the easiest thing to do is to remove that fusion and create a new one with the plugin. Once this is done you will have to redirect the shared folders to the new fusion group and that's it.

  • So if I remove the pool and recreate the pool with the same drives and same name will all my files be "restored" and the other application will be able to use the mergerfs file system?


    Some additional info, this is how my drives/folder structure looks (with some simplification) if I SSH into the server:


    So after I restarted, the folder structure recreated itself but the old files were not there and the applications that are using the mergerfs pool started creating files in this new /srv/mergerfs location.

    • Offizieller Beitrag

    So if I remove the pool and recreate the pool with the same drives and same name will all my files be "restored" and the other application will be able to use the mergerfs file system?

    As I already said, you have to redirect the shared folders to the new relative path. The best way to do this is to edit the shared folder and use the tree button to the right of the relative path field.

    So after I restarted, the folder structure recreated itself but the old files were not there and the applications that are using the mergerfs pool started creating files in this new /srv/mergerfs location.

    You didn't mention anything in your first post about applications writing to that mergerfs pool. In this case, in order to do what I said, you must first stop those applications (I assume we are talking about applications deployed through docker).

    After stopping them you can do the operation to delete the group and create it again.

    Once that is done, you must review the paths of the volumes that you have defined in each container so that they point to the new group.

    Redirect relative paths of shared folders to their location in the group as well.

    At that time you can start the applications again.


    Before you start doing all this, check what the applications that have written files did. Some files may have been written to the system disk. WinSCP can be useful to verify that.

    • Offizieller Beitrag

    If you are not sure about any action or have any questions, please ask before doing so. It is a simple operation but it is delicate if done incorrectly.

  • Zitat

    You didn't mention anything in your first post about applications writing to that mergerfs pool

    Sorry, I realized later that it's used and that's important. And yes it is used by apps in docker containers


    Zitat


    If you are not sure about any action or have any questions, please ask before doing so

    So in OMV under

    • Storage->mergerfs: I have a pool called "home_media_server"
    • Storage->File Systems: I have the physical drives and a FUSE.MERGERFS type file system called "/srv/mergerfs/home_media_server"
    • Storage->Shared Folders: I have a folder called "NAS_home" with relative path "NAS_home/" and absolute path "/srv/mergerfs/home_media_server/NAS_home"
    • Services->SMB->Shares: I have a share based on NAS_home folder

    My first issue is that the delete icon is greyed out if i select the "home_media_server" under Storage->mergerfs. But if I manage to remove and recreate the pool, then I'd need to edit the "NAS_home" shared folder to use the newly created FUSE.MERGERFS file system?


    Also I noticed, that under Storage->File Systems the "/srv/mergerfs/home_media_server" is not mounted. Could that be the underlying issue? I found this thread about this, could the solution there solve my problem as well? (I don't mind deleting the newly created files in the mergerfs location)

    • Offizieller Beitrag

    My first issue is that the delete icon is greyed out if i select the "home_media_server" under Storage->mergerfs. But if I manage to remove and recreate the pool, then I'd need to edit the "NAS_home" shared folder to use the newly created FUSE.MERGERFS file system?


    Also I noticed, that under Storage->File Systems the "/srv/mergerfs/home_media_server" is not mounted. Could that be the underlying issue? I found this thread about this, could the solution there solve my problem as well? (I don't mind deleting the newly created files in the mergerfs location)

    okay. Then do the following:

    1 - Make sure all your containers are stopped.

    2 - Create a folder manually to redirect the current shared folder temporarily. For example mkdir /NAS_temp

    3 - Edit the shared NAS_home folder and change its absolute path to /NAS_temp and its relative path to NAS_temp/ This will make the delete group button available, since the group should no longer be referenced. However, it allows you to continue with the actions without deleting that folder, permissions, samba, etc.

    4 - Then delete the mergerfs group and create a new group with the two disks, you can call it as you had before (home_media_server) or whatever you want.

    5 - Edit the shared folder NAS_home again. In the absolute path select the new mergerfs group. In the relative path, look for the folder that contains the files and select it. You should now have the files visible from any samba client.

    6 - Edit the containers and update the path of any volumes that were pointing to the mergerfs group with the new path. You are now ready to start that container and it should be reading and writing to the existing mergerfs group folder.


    Again, I hope I have been clear enough in my explanations, otherwise ask me again, I prefer you to be completely sure before doing anything.

  • Zitat


    Also I noticed, that under Storage->File Systems the "/srv/mergerfs/home_media_server" is not mounted. Could that be the underlying issue? I found this thread about this, could the solution there solve my problem as well? (I don't mind deleting the newly created files in the mergerfs location)

    I actually tried the solution from the other tread and it worked perfectly. There is also a great tip there to hit the Install Docker button under OMV-extras if the file system was added after the initial docker install (which was in my case) which will add all mounts to the config file so docker will wait at startup until all file systems are mounted, and hopefully prevent this happening again in the future.


    But thanks chente for the help anyway! :)

  • bszabo

    Hat das Label gelöst hinzugefügt.

Jetzt mitmachen!

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