This was my first time using ZFS and I made a huge blunder.

I created my "server" zpool as per:

sudo zpool create -f server raidz2 /dev/sdb /dev/sdc /dev/sdd /dev/sde

Then, there was a directory under my root directory called /server.

So I changed the permission in the folder so I could write to it and created two folders in /server then dumped several portable HDD & SSDs into the folders then went to bed. I estimate about 300-600 GB worth.

The next day I went into /server and it was empty! I looked at the properties and it says usage 404.8 GiB of 437 GiB free. When I typed ls -l there is nothing in the folder (the pool was comprised of four 8 TB drives).

I think I needed to create a dataset to save the data under, rather than the top level of the zpool, big whoops!

I tried Testdisk on the effected portable hard drives and I think the data is still on them but the file structure is not restorable with Testdisk?

So now my big issue is I can't spend hundreds of hours sorting random files out, I have a fourth child imminent and no spare time. So I was really hoping to find a ZFS solution in restoring the misplaced data as I think it's my only practicable option. I'm hoping it's still on the ZFS drives somewhere. Without the file structure the data is almost useless. Otherwise I'd try and restore the data with Testdisk from the portable drives.

  • 4
    Define more precisely the EXACT action you took when you 'dumped several portable HDD & SSDs into the folders'. Hopefully you did not 'move' the data, but copied it. Also hopefully you did not use a gui file manager to do this, but used a command line. I'm not going to hope you used rsync to do it, which is what you should have done, and you already feel bad enough as it is, but do add very precise, exact, details, leave nothing out about what you exactly did when you transferred the data. ' 'dumped into' is not a technical term and does not help illuminate your issue.
    – Lizardx
    Sep 4, 2021 at 4:57
  • Just as a general observation, the actual error you made was not simply taking one file and copying to your zfs array and checking that it was all good before doing anything else. Not trying to rub salt in the wound, just noting that is a basic procedure you always do to test something like this before engaging in any large operation.
    – Lizardx
    Sep 4, 2021 at 5:01
  • It sounds like you did not create a zfs file system or mount it, but why that was showing in your file manager I don't exactly understand, I'm not fully up on zfs but what you explained doesn't quite make sense unless your file manager did something bad. I think it's probably relevant what operating system you are using too. Be precise, what file manager are you using, what OS, the lack of these details is worrying since they matter. A proper OS should not have allowed this event to occur, unless the file manager was trying to be too clever for your own good.
    – Lizardx
    Sep 4, 2021 at 5:06
  • 2
    You should create dataset(s) in your zpool (rather than just put data into the top-level of the pool directly), but you don't have to. The top level of a pool is a dataset. My guess as to what's happened is that you shutdown the machine and didn't import the pool or mount any filesystems (datasets) on it when you rebooted (maybe you didn't update your initramfs or startup scripts to do that). Try zpool import server or zpool import -d /dev/disk/by-id/. and/or maybe zfs mount server too.
    – cas
    Sep 4, 2021 at 5:28
  • @Lizardx, I did exactly all the things you hoped I didn't. The mistakes I made were: Using the file manager (Thunar), MOVING rather than copying, not using Rsync and not checking that things were okay. I am using MX Linux, which is based off Debian 10.
    – 1toneboy
    Sep 4, 2021 at 8:59


You must log in to answer this question.

Browse other questions tagged .