Newbie mistake ZFS pool

tone2

New Member
Sep 3, 2021
1
0
1
Hi, This was my fist 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 folder in my root 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-600gb worth

The next day I went into /server and it was empty! I looked at the properties and it says usage 404.8GiB of 437 GiB free. When I ls -l there is nothing in the folder.
I think I needed to create a dataset to save the data under, rather than the top level of the zpool, big woops.

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 4th child imminent and no 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 its still on the drives somewhere. Without the file structure the data is almost useless. Otherwise I'd try and restore the data with testdisk.

Please help (if you can).
 
Last edited:

gea

Well-Known Member
Dec 31, 2010
2,730
946
113
DE
A ZFS pool itself is also a ZFS filesystem/dataset. No problem to copy files to the /server filesystem (pool), to regular folders below or to ZFS filesystems below that allows different ZFS properties.

Most disk tools only work with ntfs or ext filesystems not ZFS. Usually you do not need them with ZFS as ZFS is either working or irreparable damaged.

I would restart the copy and check for copy errors or problems.
 

ericloewe

Member
Apr 24, 2017
38
8
8
28
I think I needed to create a dataset to save the data under, rather than the top level of the zpool, big woops.
Not strictly speaking, but it's something you want to do 100% of the time.
I estimate about 300-600gb worth
I looked at the properties and it says usage 404.8GiB of 437 GiB free.
Clearly the data was not copied (fully) for whatever (probably extremely mundane and not ZFS-related) reason. Either that or it compresses incredibly well, which does not seem likely. 300-600 GB are very unlikely to turn into 30-odd GB.

I would restart the copy and check for copy errors or problems.
This is just about the only option.