Gentoo Archives: gentoo-user

From: Dale <rdalek1967@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [RESOLVED] [gentoo-user] zfs repair needed (due to fingers being faster than brain)
Date: Tue, 02 Mar 2021 18:15:50
Message-Id: a81590f3-1e42-8723-c33e-83d201925038@gmail.com
In Reply to: Re: [RESOLVED] [gentoo-user] zfs repair needed (due to fingers being faster than brain) by John Blinka
1 John Blinka wrote:
2 > To all who replied to my distress signal,
3 >
4 > The repair turned out to be pretty painless.  In two ways:
5 >
6 > First, getting quality advice from all of you sans the roasting I
7 > deserved ;), and
8 >
9 > Second, gdisk fixed the gpt header and partition table easily (details
10 > below).  After that, I rebooted, zfs recognized the disk, and then it
11 > started a resilver automatically.  It was done a few minutes later,
12 > and now everything’s back to normal.
13 >
14 > Gdisk noted that both the main gpt header and main partition table
15 > were damaged, but the backups were ok.  I bypassed gdisk’s offer to
16 > use either the current gpt or to create a blank gpt, because I didn’t
17 > understand exactly what “current” or “blank” meant.
18 >
19 > Instead, I invoked the recovery & transformation menu with “r”.  Then
20 > I used “b” to rebuild the damaged main gpt header with the good
21 > backup, followed by “c” to restore the partition table from the good
22 > backup.  I then printed the partition table.  It looked exactly like
23 > the partition tables on the other disks of the same make and model in
24 > the zfs pool (modulo what looked like a unique zfs partition name). 
25 > That made me comfortable, so I wrote the changes to disk, rebooted,
26 > and found everything back to normal after the resilver.
27 >
28 > Appreciate all the help.  Thanks!
29 >
30 > John
31
32
33 I think we all do things we need "roasting" for at some point.  I once
34 did a rm -rfv and missed a few keys and tab completion didn't beep,
35 likely it shouldn't have either.  Anyway, luckily I had enough left to
36 do a emerge -ek world and get it all back and it didn't reach /home.  I
37 also cleaned my keyboard with my portable air tank after that.  ;-)
38
39 I followed this thread in the hopes I might learn something.  I think I
40 did.  It seems that the normal routine stuff is done in the main menu
41 for Gdisk but recovery is done in another menu that is less obvious. 
42 This is a good thing to know.  While we hope none of us ever run into
43 this sort of thing, it is good to know just in case. 
44
45 It's amazing how well some of the newer file systems can recover from
46 such things.  Between the awesome file systems and Raid and maybe other
47 tools, most data losses can be avoided. 
48
49 Neat thread.  I don't use ZFS at this point but I learned something
50 about Gdisk. 
51
52 Dale
53
54 :-)  :-)