SOLVED While installing an OS, a zpool drive got formatted.

Status
Not open for further replies.

TremorAcePV

Explorer
Joined
Jun 20, 2013
Messages
88
Hi,

Title basically. At some point, one of my zpool drives got a fresh/clean and empty GPT. I was using the system to install Windows. Never again.

When I try to import the pool now, it fails to find any (pools).

I don't know what ZFS does to a drive in terms of having a Partition Table, but I am hoping there's a way to fix the drive such that it will be a part of the zpool again. I feel the chances are slim, but yeah.

I'm tempted to dd /dev/zero the first and last bytes of the drive and just erase the GPT entirely, but I have doubts that would be productive.

At worst, if I can get the zpool to import, or force it's addition in another way, I'd expect a file or two to be corrupt (due to the GPT being written), but then I have every other file which I'd be fine with.

Any help is appreciated on what route to take going forward.

Thanks,
Tremor.
 

HoneyBadger

actually does care
Administrator
Moderator
iXsystems
Joined
Feb 6, 2014
Messages
5,112
The only way you should be losing data here would be if you had a pure stripe setup. Any mirror or RAIDZ should be able to tolerate a single drive failure, at which point you can "replace" the old damaged/cleaned drive with itself and let it (hopefully) resilver.

Have you tried booting the system with the formatted drive detached? The pool should be importable in DEGRADED state with one device showing as UNAVAIL.
 
Last edited:

TremorAcePV

Explorer
Joined
Jun 20, 2013
Messages
88
What was the pool configuration before this happened?
Pool config was four SSDs striped together.

The only way you should be losing data here would be if you had a pure stripe setup. Any mirror or RAIDZ should be able to tolerate a single drive failure, at which point you can "replace" the old damaged/cleaned drive with itself and let it (hopefully) resilver.
It was a pure stripe setup. As mentioned above.

I realize I should've backed up the drive/pool. Live and Learn.

My question would be simply "Is it salvageable?"
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504

TremorAcePV

Explorer
Joined
Jun 20, 2013
Messages
88
In that case, I don't believe this will be recoverable.
Ah. Well joy.

Interesting thing: using v in gdisk states the issue with the Primary GPT is that it's GUUID is different from the Backup GPT. I'd imagine if something formatted the drive, it would do both. I guess that's not so.
 

HoneyBadger

actually does care
Administrator
Moderator
iXsystems
Joined
Feb 6, 2014
Messages
5,112
It was a pure stripe setup.

You may be able to force-import the pool and attempt some recovery, but with your configuration at least a portion of each file will probably be on the missing SSD, so in short,

PhHIslN.png


At this point you might as well try hail-mary fixes though, like dd'ing the GPT from a good disk over to your formatted one, but since that was an SSD, if it had any power applied to it after the reformat and was used in a TRIM-aware OS, the data's probably been cleaned from NAND.
 

TremorAcePV

Explorer
Joined
Jun 20, 2013
Messages
88
At this point you might as well try hail-mary fixes though, like dd'ing the GPT from a good disk over to your formatted one, but since that was an SSD, if it had any power applied to it after the reformat and was used in a TRIM-aware OS, the data's probably been cleaned from NAND.

So, when a zpool is created, does ZFS format each drive with an identical GPT & GUUID? I mean. Unless that's the case, I don't see copying over a good GPT would help if the drives are different.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
There is a chance you can reproduce the exact same gpt geometry and get the zpool to mount. But, that's not necessarily going to come easily. Additionally, if you actually installed Windows on the drive, then the zpool is certainly smashed and even if you are able to mount it, it's very likely the second you try to mount it the system will panic and reboot.
 

TremorAcePV

Explorer
Joined
Jun 20, 2013
Messages
88
There is a chance you can reproduce the exact same gpt geometry and get the zpool to mount. But, that's not necessarily going to come easily. Additionally, if you actually installed Windows on the drive, then the zpool is certainly smashed and even if you are able to mount it, it's very likely the second you try to mount it the system will panic and reboot.
Cool.

I did not install Windows onto the drive. I installed it on a non-zpool drive. I just know that sometimes Windows messes with Drives you never touch in it's installation.

I did find this thread while searching: https://forums.freenas.org/index.php?threads/gpt-table-is-corrupt-or-invalid-error-on-bootup.12171/ And I imagine Windows' tendency to touch other drives while installing on an unrelated one is one reason people unplug them all while doing installs.

Unfortunately, I didn't do that, and even more so, if I had, I would've had other issues (TL;DR: NVRAM & UEFI is a pain).

Tried using the backup GPT since it wasn't corrupt. This did not fix the issue either.

I guess my data is dead. Oh well. Time to start over.
 
Status
Not open for further replies.
Top