[zfs-discuss] zpool import problem

Gregor Kopka (@zfs-discuss) zfs-discuss at kopka.net
Wed Feb 7 04:47:29 EST 2018

Am 06.02.2018 um 21:08 schrieb Fco. Javier Martinez Llanes via zfs-discuss:
>  Hello,
> I have a tricky situation and I really would appreciate your expertise and point of view. My platform is CentOS7.4   ZFS 0.75.
> 1. We had a functional zpool, let's say 4 disks in mirror and strippep (a a', b b'). This pool was full of data and working.
> 2. By mistake we add a disk to the stripped pool (a a',b b',c)
> 3. We stopped the pool immediately so disk "c" was not really used/written.
How did you stop the pool and what is the exact definition of 'immediately'?

> Now
>  zpool import command says data corruption on disk c (we don't know why 
> disk c became corrupted, but this is it), so the pool is not available 
> and cannot be imported because a strip member is corrupted. Regardless 
> has no "real" data, just the metadata that identifies zfs fisk 
> properties.
> We know we have all data in the "right disks" with no
>  corruption (a a',b b' are AVAILABLE and ONLINE) but it is impossible to
>  mount.
> We have tried all kinds of parameters, read-only mount, 
> exhaustive googling, even praying to any god/power of the universe and 
> whatever, but the zpool (obviously) cannot still be imported.
> We 
> are NOT afraid to modify/change/create/adapt any code in zfs in order to
>  bypass data integrity checks in order to access data. But we don't know
>  where should be patched. We will copy the files into another machine 
> and we will destroy the pool.
In case you care about the data enough:
1) Get some spare drives that are big enough and make block based copies
(dd or dd_rescue) of a and b, afterwards shutdown and disconnect _all_
original pool members and put them aside
2) Move aside the //etc/zpool.cache/ file
3) Use /
> /zdb --hh -e //<path_to_device_nodes> <pool>/
 /to get the history of the pool, you might need -A, -AA or -AAA as
devices are missing and/or -F to make zdb look at older transactions
4) look for the entry at (or near) the end of the outpot that has the
accidental /zpool add//,/ then go back _one entry_ and copy the number
listed as 'history txg'.
5) Execute
> /zpool import -N -o readonly=on -f -R /pool -d
> //<path_to_device_nodes> -F -T <history txg> <pool>/
 which could take a while
6) Should that have worked, export the pool - now you should be able to
import it normally with
> /zpool import -d <path_to_device_nodes> <pool>/
7) Feel relief.
8) Either restore redundancy ('attach' additional drives or 'replace'
the offline ones) or shutdown, disconnect the spare drives used (and set
them aside, as they contain a working pool with your data = a valid
backup), reconnect a, a', b b' and repeat the process.
/Good Luck,


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.zfsonlinux.org/pipermail/zfs-discuss/attachments/20180207/24dd6cf2/attachment-0001.html>

More information about the zfs-discuss mailing list