Written by jktorn:
>Have you tried build 128 which includes pool recovery support?
>
>This is because FreeBSD hostname (and hostid?) is recorded in the
>labels along with active pool state.
>
>It does not work that way at the moment, though readonly import is
>quite useful option that can be tried.

Yes, I tried 128a and 129.  Neither worked and all of them failed just like the 
127 version.  Specifically, they all reported the pool was used by another and 
ignored the -f option to import anyway.

Things I had tried before I programmed myself a solution include:
With or without pool name ("zpool import tank" "zpool import")
With or without -f option
With or without -V (undocumented "do anyway" option)
With or without -F (lose data option)
With or without -FX (lose massive data option)

I finally decided to install an Opensolaris machine and compile a fixed version 
of logfix.c, which I detailed here:
http://opensolaris.org/jive/thread.jspa?threadID=62831&tstart=0

Short summary of the problems preventing me from mounting this forged pool:
1) The pool had been accidentally exported on the host FreeBSD system.

2) The pool had 10 drives, and logfix was written to assume only one vdev for 
data and one for the log.  The guid needed to be changed and the generic 
sequential "id" also needed to be set to a unique value.  This is why my 
da4/da5 mirror disks disappeared whenever I used logfix to mark up the log 
device (it was the same "id", for example in my case "1".)

3) The marked up log device had 1 label matching my pool "tank" and the other 3 
labels matching a scratch pool named junkpool.  These labels had to be removed  
to prevent it from reporting this error:
Assertion failed: rn->rn_nozpool == B_FALSE, file ../common/libzfs_import.c, 
line 1078, function zpool_open_func

4) The pool was last used on FreeBSD and the FreeBSD device names differed from 
OpenSolaris, for some reason they could not be properly detected.  So I had to 
make a directory and use "-d /tmp/fbsd" to point zpool to the directory to find 
the original device names.

5) The pool had lost 84 seconds of data on the log disk that can not be 
recovered (which required me to use -F to lose and mount.)

6) Since I made the log device to repair this pool a file, I need to use 
lofiadm to make a block/character device for it.

Happy!
# pfexec zpool import -d /tmp/fbsd/ -f -F tank
Pool tank returned to its state as of November 13, 2009 10:50:11 AM PST.
Discarded approximately 25 seconds of transactions.
-- 
This message posted from opensolaris.org
_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to