ZFS Get rid of zpool error

Hi there,

I have an error on a zpool.
That was related to a postgresql database file. I have no clue how this happened.
So, I dumped the base and restored it. All good so far.
Since this is a single device I understood that I cant correct the error with scrub even if it's no more related to any file.
The server is a vmware VM and it boots on the device.
So, now I want to create a mirror pool with 2 new devices (so corruption become correctable), transfer all the data on the new redondant device and make it bootable.
Where can I find a good guide to do that ?
 
Since this is a single device I understood that I cant correct the error with scrub even if it's no more related to any file.
Correct. You can only correct errors if you have redundancy of the data.

So, now I want to create a mirror pool with 2 new devices (so corruption become correctable)
The corruption is already there. You can't correct something if you don't have the redundant data. Copying corrupted data to a redundant filesytem doesn't "fix" the corruption, you'll just end up with a redundant copy of that corruption.

If you just want to copy the data to a new pool (with redundancy) to protect against future corruptions, then it would make sense. Probably the easiest is to use zfs send and zfs receive to copy all the data from the old pool to the new one.
 
So, zfs send and receive wont get rid of the error ...
Maybe I should rsync to new pool and then make it bootable ?
 
Maybe I should rsync to new pool and then make it bootable ?
That still isn't going to remove or fix the corruption. All you're doing is thinking up different ways of copying something that's already corrupt to begin with. Copying corrupted data, regardless of how you copy that data, isn't going to magically make the corruption correctable.

In your case, since this is a VM, is to set up a new VM next to it. Use a clean install, install and configure whatever packages you need. Check and verify your data as much as possible. Then copy the salvaged data from one node to the other. The new machine, with the redundant disks, will be able to handle corruptions in the future.
 
I dont understand why you think I still have the corruption -in my data-.
At first the corruption occured and a file was corrupted. In fact a DB file.
So zpool status -v was showing the corrupted file name.
So I dumped and restored the DB and the file was deleted so now zpool status -v shows :
zroot/ROOT/default:<0x61a94>
The corruption is now in any file as far I can understand.
So whatever way I transfer my data the corruption cant follow them.
Where am I wrong ?
But, as I have a problem upgrading one of my port to freebsd 12 I will surely do exactly as you adviced.
 
Back
Top