I am running several zpools side by side and this morning someone hit my setup with an intended power outage.
I restarted and re-imported all my pools, except the following:
pool: unsafebulk
state: FAULTED
status: The pool was last accessed by another system.
action: The pool cannot be imported due to damaged devices or data.
The pool may be active on another system, but can be imported using
the '-f' flag.
see: http://zfsonlinux.org/msg/ZFS-8000-EY
config:
unsafebulk FAULTED corrupted data
sdc ONLINE
zpool import -f unsafebulk
cannot import 'unsafebulk': I/O error
Destroy and re-create the pool from
a backup source.
As you can guess from the name, this is the only pool not being redundant, because I couldn't find a second 8TB drive for this purpose, yet. However, the HDD itself is fine and was working the whole time without any issue.
All pools got re-imported with a few commands, without scrubbing, re-silvering or whatever. Just re-imported. All fine. Just this one drive is "faulted". How is it faulted when I did not perform any administrative tasks? Why does it want to me destroy entire 8TB of data when only the pool's metadata is supposedly corrupted?
How can I restore the drive? Again, if the metadata is corrupted, then all files are still present on the drive. So they are theoretically usable.
I was obviously aware that this pool wasn't as safe as the other ones. I knew it would be unsafe, in case a bomb would be thrown here, which the pool maybe wouldn't survive. But it for f's sake ought to survive a simple power outage! This is just terrible. This is not some little small SD card that is vulnerable to power outages (btw. all my Raspberry Pis' SD cards survived the power outage perfectly without issues).
Now what is the best way to restore the files since only the metadata is supposedly corrupt?
Would `testdisk` work in this scenario?
There IS a way of restoring the files, but I could not find a source for that except all the lazy ones talking about "make a backup next time" when it clearly doesn't work and was not needed in this situation.
Update
I KNEW ZFS WAS LYING TO ME!!!! I KNEW IT!!!!
Thanks to a super helpful fellow user, u/Lucius_Martius on here, I used the command
zpool import -fFX unsafebulk
and this restored everything back, after about 24h of restoration!
Thank you so much, u/Lucius_Martius!
Never trust ZFS when it tells you to destroy the pool because supposedly everything is lost!