Mailing List Archive

Re: [RESOLVED] zfs repair needed (due to fingers being faster than brain)
To all who replied to my distress signal,

The repair turned out to be pretty painless. In two ways:

First, getting quality advice from all of you sans the roasting I deserved
;), and

Second, gdisk fixed the gpt header and partition table easily (details
below). After that, I rebooted, zfs recognized the disk, and then it
started a resilver automatically. It was done a few minutes later, and now
everything’s back to normal.

Gdisk noted that both the main gpt header and main partition table were
damaged, but the backups were ok. I bypassed gdisk’s offer to use either
the current gpt or to create a blank gpt, because I didn’t understand
exactly what “current” or “blank” meant.

Instead, I invoked the recovery & transformation menu with “r”. Then I
used “b” to rebuild the damaged main gpt header with the good backup,
followed by “c” to restore the partition table from the good backup. I
then printed the partition table. It looked exactly like the partition
tables on the other disks of the same make and model in the zfs pool
(modulo what looked like a unique zfs partition name). That made me
comfortable, so I wrote the changes to disk, rebooted, and found everything
back to normal after the resilver.

Appreciate all the help. Thanks!

John
Re: [RESOLVED] zfs repair needed (due to fingers being faster than brain) [ In reply to ]
John Blinka wrote:
> To all who replied to my distress signal,
>
> The repair turned out to be pretty painless.  In two ways:
>
> First, getting quality advice from all of you sans the roasting I
> deserved ;), and
>
> Second, gdisk fixed the gpt header and partition table easily (details
> below).  After that, I rebooted, zfs recognized the disk, and then it
> started a resilver automatically.  It was done a few minutes later,
> and now everything’s back to normal.
>
> Gdisk noted that both the main gpt header and main partition table
> were damaged, but the backups were ok.  I bypassed gdisk’s offer to
> use either the current gpt or to create a blank gpt, because I didn’t
> understand exactly what “current” or “blank” meant.
>
> Instead, I invoked the recovery & transformation menu with “r”.  Then
> I used “b” to rebuild the damaged main gpt header with the good
> backup, followed by “c” to restore the partition table from the good
> backup.  I then printed the partition table.  It looked exactly like
> the partition tables on the other disks of the same make and model in
> the zfs pool (modulo what looked like a unique zfs partition name). 
> That made me comfortable, so I wrote the changes to disk, rebooted,
> and found everything back to normal after the resilver.
>
> Appreciate all the help.  Thanks!
>
> John


I think we all do things we need "roasting" for at some point.  I once
did a rm -rfv and missed a few keys and tab completion didn't beep,
likely it shouldn't have either.  Anyway, luckily I had enough left to
do a emerge -ek world and get it all back and it didn't reach /home.  I
also cleaned my keyboard with my portable air tank after that.  ;-)

I followed this thread in the hopes I might learn something.  I think I
did.  It seems that the normal routine stuff is done in the main menu
for Gdisk but recovery is done in another menu that is less obvious. 
This is a good thing to know.  While we hope none of us ever run into
this sort of thing, it is good to know just in case. 

It's amazing how well some of the newer file systems can recover from
such things.  Between the awesome file systems and Raid and maybe other
tools, most data losses can be avoided. 

Neat thread.  I don't use ZFS at this point but I learned something
about Gdisk. 

Dale

:-)  :-)