Reuse zpool data

  • Hello,

    I am using Openmediavault 7.

    Following a ram problem I had major damage to my server. It was still working but with a lot of errors at startup.

    But the zpool remained intact. It contains a lot of data.

    So I exported the zpool then reinstalled the system and all the plugins, etc... Then I imported the zpool and the data is still there.


    When I create shared folders, I reuse the folders already on the zpool. But it's as if there's nothing in them when I assign them to different services.

    To be on the safe side, I've only done this with two plugins that can handle data.


    I suspect that creating the shared folder will overwrite the data in the folder that was created on the previous system.

    Or the data is not seen.

    I would like to reuse the zpool data for services on the new system.


    Can you help?


    Thank you!

    • Official Post

    Check the relative path of those shared folders, edit the settings and check the path with the tree icon on the right in the GUI.

    Remember that to mount a root folder of a ZFS dataset the initial relative path must be / Did you create datasets in the pool?

    • Official Post

    What do you mean by datasets ?

    Introduction to ZFS — openzfs latest documentation

    If you do not use datasets you are creating folders and files directly in the pool.

    To create a dataset in the GUI select the pool and press the Add button. Then press Add filesystem|snap|volume. Give it a name and choose a mount point (I advise /srv/[POOL_NAME]/[DATASET_NAME]). Press Add.

    Once a dataset is created in the GUI, it will appear in the file systems tab as one more. Create a shared folder on that file system and in the relative path type /

    If you already have folders created directly in the pool, I don't know how to solve that. I guess you should copy that data to a dataset.

  • Thank you for your quick and clear answers.


    Unfortunately I created the folders directly in the pool.

    Why do they have to create a datasheet beforehand?

    It's a bit of a shame because the new openmediavault clearly sees the folders created previously and on the command line you can see that the files are in them.

    And it worked very well like that before.

    I can't create a datasheet because the data is already in the pool.

    Unless the pool preserves and integrates the data, which I doubt very much?


    Or create new folders in the pool and move the data manually into the new folder then delete the old folder but that's a bit barbaric and I don't know if it would work?

    And there's 1.5 TB to move and the disks aren't ssd.


    Is there any other way, or is it impossible ?

    • Official Post

    Why do they have to create a datasheet beforehand?

    If you create folders directly in the group as you have done, you may have problems with snapshots or some other problems. Read the link I linked to the openzfs documentation, there you can see what a dataset is.

    But this is no reason why you can't create a shared folder in the existing path. It's not an OMV or plugin requirement, just ZFS good practice. If nothing has changed lately that should work, you should be able to create a shared folder in the GUI even if that folder is in the pool directly. So I think the problem is still the same, I think you are not specifying the relative path correctly.

    Or create new folders in the pool and move the data manually into the new folder then delete the old folder but that's a bit barbaric and I don't know if it would work?

    And there's 1.5 TB to move and the disks aren't ssd.

    I would say that's the only way.

  • I understand the broad outlines, but it gets complicated at the end.


    This part seems to concern the problem directly:


    "This is because a ZFS pool will always have a mountable filesystem called the root dataset, which is mounted at pool creation. At creation, a pool is imported into the system, such that an entry in the zpool.cache file is created. At time of import or creation, the pool stores the system’s unique hostid and for the purposes of supporting multipath, import into other systems will fail unless forced."


    My pool is mounted at the root without any particular mount point.

    Next time I'll know that I need to create a mount point as you've described. And then use the new file system for the shared folders.

    But you say it's good practice, so is it mandatory to transform data from an Openmediavault to a new Openmediavault?


    My pool comes from a previous Openmediavault which crashed due to a ram problem. I exported this pool before reinstalling the system, plugins, etc, then importing it to the freshly installed system.


    You say it's just a relative path problem.

    When I create a shared folder, I give it a name, I select the pool (because I haven't created a file system from a pool mount point), I choose the path with the tree button, I see the folder already created from the Openmediavault that crashed and I select it. And I put a label on it.

    Then I go to the corresponding service and select the shared folder I've just created which uses the correct folder in the pool containing the data used by the same service in the previous Openmediavault.


    And then the problem arises - it's as if there's nothing in the shared folder.

    The service has no data from the shared folder.

    Yet the data was in the pool folder at least just before the shared folder was created.


    Does the system overwrite the data in the pool folder when the shared folder is created? Does it not see them or something? If so, why?


    Forgive me for my insistence.

    • Official Post

    My pool is mounted at the root without any particular mount point.

    If the pool is mounted it has to be on some route. You should be able to see that route in the GUI, there is a field which is Mountpoint. If you cannot see that field, press the top right Show/Hide columns icon to activate that field.

    Looking at the images I would say that that mount point is /POOL1


    The most direct way to know if the files are there is to connect via SSH and explore that folder to see what is inside.

    Does the system overwrite the data in the pool folder when the shared folder is created?

    No

  • The first photo shows POOL1 and its contents. These are the folders created for the shared folders when they were running with the first openmediavault, which is no longer operational and which I had to reinstall.

    The second photo shows one of the folders in /POOL1 (/POOL1/PHOTOPRISMIMAGES) and its subfolders.

    The third photo shows the files in one of the sub-folders of /POOL1/PHOTOPRISMIMAGES.


    When I assign these folders to the new shared folders for running the same services as before on the newly installed Openmediavault it's as if they were empty.

    The services work as if the shared folders were empty.

    As if there was no data inside.

    I would like the Openmediavault services that I have reinstalled to use the data contained in these folders.

    Because putting the data back into the zpool would take a very long time.

    • Official Post

    Are you just trying to get plugin type services to work? Have you tried using samba on those shared folders to see if you can see the content?

  • alflo2024 Your pool layout as show in #3 above is far from optimal, in fact it makes little sense to me. What is the purpose of combining a raidz1 vdev and a 4-way mirror vdev in one pool? Do you really need a separate log vdev (which is a stripe and should be a mirror)? Is your workload generating a lot of sync writes? The type of SSDs you used as a SLOG are not really suitable for that task. Do you really need an L2ARC device? Have you tested that your read work loads ever make use of L2ARC?

  • chente :


    I had 8 containers on the previous Openmediavault.

    After reallocating the corresponding folders from the old system to the new shared folder and after allocating the new shared folder to Docker Compose, nothing, no more containers (see screenshots).

    All I care about is getting Photoprism to work - there are over 1TB of photos and videos.

    I don't have any data on the other plugins, so I can't test with Samba.

    After seeing what happened with Docker Compose, I'm very hesitant to do it for Photoprism for fear of losing more than 1 TB of photos.

    I have snapshots of the old system and I can make new ones.

    If I try with Photoprism could I go back?


    Krisbee:


    You're certainly right it's not optimal.

    But that's not my question.

    I have no intention of destroying this pool, which contains over a TB of data. And since we can't delete vdevs.

    I could detach the log and cache and allocate 2 of the three disks to the mirror. Or create a new vdev and put them in.

    Or just create a new pool?

    But for what gain?

    Knowing that the vdev, log and cache disks are not the same size.

    As for the cached disk, I don't know if it's used.

    I easily have 23GB/24GB of ram and a 70% processor. It's a 2 x xeon 6 cores (12 cores 24 threads) t 2.8 Ghz if I remember correctly.

    My system may be oversized but it worked perfectly and for me that's what counts.


    My aim is simply to reuse my zpool and its data for the services of the newly installed Openmediavault.

  • alflo2024 If you cannot show that both your LOG and CACHE vdevs are used , then you 'r wasting resources. As the redundancy of your pool depends on the redundancy of individual data vdevs, then currently two disk failures in the raidz1 vdev means loosing the entire pool. The performance of your pool is determined by the worst performing vdev if you mix mirrors and raidz1. So, you gain nothing from using a 4-way mirror alongside a raidz1 vdev: no gain in performance or redundancy level and your wasting resources in a useless 4-way mirror that only has 25% capacity efficiency. Performance in raidz1 is better with odd numbers of disk rather even numbers, due to the way that zfs stripes data & parity across the drives in raidz1. Using devices without PLP in a SLOG means no protection in the case of power loss. Turn the machine back on and the uncommitted writes in the SLOG will have been lost.


    It's not that your system is oversized, it's just the pool design is poor and you're failing to make the best use of the resources deployed within the limits of the collection drives you have.


    If you're talking about a total storage of a couple of TB's, then you would be far better off copying the data off this pool to an external hdd and deleting the pool and designing a better zfs pool layout and make proper use of filesystem datasets to segregate your data.


    If it were me and all your seven HDDS are of the same size then I'd put my bulk data on a single 6 disk raidz2 keeping one as spare. From the collection of ssds, maybe two could be used for docker & containers in a separate single vdev mirror pool, or just use them with ext4.

    • Official Post

    for fear of losing more than 1 TB of photos.

    Regardless of everything else, my first step would be to backup that data.

  • Thank you for all your explanations. It's a configuration that's not optimised because I have virtually no computer training. I've been struggling on my own for many years and can't count the sleepless nights. I make do with docs, forums (maybe not enough!) and tutorials.

    The PC is a Z800, there's a 3.5" bay with 4 x 1TB 3.5" hard drives in raidz1. Another 2.5" bay with four mirror ssd, two 120GB (recovery) and two 240GB. Two 2.5" 120 GB ssd in log mode. And a 500GB m2 cache.

    As for the performance problem between raidz and mirror, I suppose that the vdev raidz isn't slowed down too much by the vdev mirror since ssd's are much more powerful.

    I recognise that the redundancy is not there.

    I was aware of this, all it takes is for two raidz disks to fail or three mirror disks and the pool is dead.

    Following your advice, the best thing would be to buy four 1TB 2.5" hard disks and replace the raidz and mirror vdevs with a single 8-disk raidz vdev, one of which would be a hot spare.

    This would leave two slots for a docker pool.

    As for the ZLOG, I didn't know that ssd's had to be power loss protected.

    It wouldn't have cost much to add three poor 1 cent capacitors to all ssd's !!!


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

    Personal comment:

    Fed up with the technology race, this Z800 is over 15 years old and yet it still runs! Isn't today's technology enough? and then we talk about ecology! Whether it's computers or cars, everything you buy will end up in the bin within 5 years...

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


    As for the cache disk, I can't see where to put it, it's an M2 ssd and it's mounted on a Pcie card. I don't think I can boot on it because the Z800 motherboard doesn't allow it, so it's not usable for the system.


    Accessory question: I have a sas lsi card integrated into the motherboard and I've changed its ROM to ITmode passthrough. Does it do anything?


    Normally at least 97% of the photos are already on an external hard drive, just the ones I recently added to the server. They're also on a commercial cloud.

    I had used this external drive to inject the photos into the Photoprism import folder (/POOL1/PHOTOPRISMIMPORTFOLDER).

    It took an extremely long time to load the photos into Photoprism. You have to transfer them to this folder while photoprism loads them and indexes the photos.

    All this had to be done dozens of times because I'd repartitioned the photos into dozens of folders so that it wouldn't crash.

    It was a real pain, which is why I don't want to do it again.

    • Official Post

    From the beginning of this thread I thought the problem was the relative paths because you were not seeing the files. Now I realize that the problem is not that you don't see the files, or that the shared folders are configured incorrectly. The problem is that the photoprism plugin is not working.

    Therefore I can only withdraw from this thread since I have never used photoprism. I hope someone who knows photoprism can help you with that, good luck.

  • alflo2024 OK, let's park the issues over your use of zfs for the moment. From what you've previously posted and by looking at the existing folders on you imported zfs pool you had some docker containers working together with using the "PhotoPrism" plugin.


    The good news is you appear not to have lost any data from your pool after the machine crash required OMV to be reinstalled. Have you checked the zfs pool status to make your it's healthy and/or performed a zfs scrub on the pool?


    Winding the clock back two days, you said this:


    When I assign these folders to the new shared folders for running the same services as before on the newly installed Openmediavault it's as if they were empty.

    The services work as if the shared folders were empty.

    As if there was no data inside.

    I would like the Openmediavault services that I have reinstalled to use the data contained in these folders.


    This sounds like you may have permission problems when picking existing folders to use as "shared folders" . The quickest way is to use the CLI to check all the "shared folder" permissions are as required. especially for group access. As the text of the photoprism states: "

    Make sure the user photoprism or group users can access the files." for both the "images" and "import" folders you've used.


    For the docker and any containers you expect to run, the same applies about checking permission after configuring the compose settings. together with checking docker is actually running. Check your containers can access the data paths used in the compose files.

  • Hello,

    Sorry for the late reply.

    The problem has finally been solved. I must have misspoken or perhaps the Deepl translation isn't very good.


    I had reallocated the folders corresponding to the Docker Compose data in the old installation to the shared folder in the new installation and then finally allocated them to Docker Compose in the new installation.


    Result: nothing, no containers, no images, no volumes, etc...


    That's why I was very worried about doing the same thing with the Photoprism shared folders.

    I was very worried that the system would overwrite the data in the old shared folders when creating the Photoprism shared folders in the new installation.


    I finally decided to do it late last night.


    But chente was right, it doesn't overwrite the data in the old folders !!!


    Photoprism works !


    When the data disappeared from Docker Compose, I installed new containers that did not work, I just checked the access rights it seems good read / write / execute for root and users.

    I'm going to delete all the old folders and the new shared folders and put everything back to new.

    But it doesn't matter at the moment, I'm not doing much with these containers. The most important thing is that Photoprism works.


    In any case thank you both !!!


    I would have learnt a lot of things, datasheets with chente and optimising a zpool with Krisbee.

    For the moment I'm staying as I am, it's taken me a long time to set all this up...

    But I'll take note of your advice and implement it in the future.


    Thanks again for your responsiveness, your efficiency and the time you've given me!


    Have a great weekend!

Participate now!

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