From owner-freebsd-fs@freebsd.org Fri Mar 2 21:36:09 2018 Return-Path: Delivered-To: freebsd-fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A709BF47AA2 for ; Fri, 2 Mar 2018 21:36:09 +0000 (UTC) (envelope-from anti_spam256@yahoo.ca) Received: from sonic306-22.consmr.mail.ne1.yahoo.com (sonic306-22.consmr.mail.ne1.yahoo.com [66.163.189.84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 44D0D7A037 for ; Fri, 2 Mar 2018 21:36:08 +0000 (UTC) (envelope-from anti_spam256@yahoo.ca) X-YMail-OSG: 3JQ84v0VM1kGXWPC.4ukhx50TmHlJUYgTOiwB_ZusF0Ig0hophJUwbP4Ja3MfYD pEpJzkirxfhOFMrUiEYeICbS0feAmi5C_L5uQGWW6mEypyaRiBMrJ2Lj4gVGoGbau1xDlwFzFaC0 b.hYvryP9Z1Hs1Sl7LMwUHrzqzy4E624IqvRMqk2iL4rppLquS2e86RSoZzrZ1EMz6fR39PPEWdu X5QW5b8JqjK_quqW1Xjzv23kU4BGdB6JDFfKOa9mnh69EV_7LhYQ3Yz5YA4SWdJ2LQL38Dt7SYEo Yhz5Vkr7rfi8K.QhUz3UqDj72QjHB96PGfJzXWDOH4I5z0ewl0e6BTwUlSNHHmrce.YCKm7cQQSy ZHmh1OQMkIdDQx_T6cz143YWaVXaKVXFHgGVFa1yMiNw0xwL9G_Uwl1JO0FMFBAAhybPN3Lexm1i Ik3p5TkFr6P6uVgUN7ArPb9FPSRGYa2UzS9_0MwSIYPvBpjOpYXzS4ivbSw-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.ne1.yahoo.com with HTTP; Fri, 2 Mar 2018 21:36:02 +0000 Date: Fri, 2 Mar 2018 21:25:54 +0000 (UTC) From: James Phillips Reply-To: James Phillips To: Message-ID: <104055907.2968604.1520025954207@mail.yahoo.com> Subject: Re: ZFS trashed by bad import [Update] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit References: <104055907.2968604.1520025954207.ref@mail.yahoo.com> X-Mailer: WebService/1.1.11480 YahooMailBasic Mozilla/5.0 (X11; Linux i686 (x86_64)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.78 Safari/537.36 X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Mar 2018 21:36:09 -0000 As Andry Gapon suggested (in an apparently private mail), the problem was mostly user error. The import did indeed overwrite the root directory structure. While I am aware that the zpool(8) man page is already on the long side: I would suggest a more explicit hint in the import section that you may need to specify an alternate root, I had expected the command: # zpool import -f 8255478166520290766 granny to mount my foreign filesystem under /granny instead of /zroot. It did not occur to me that files would mount above the mount point in the directory hierarchy. The man page *does* talk briefly about when you would want to use an "altroot" in the "Properties" section: altroot Alternate root directory. If set, this directory is prepended to any mount points within the pool. This can be used when examining an unknown pool where the mount points cannot be trusted, or in an alternate boot environment, where the typical paths are not valid. ... I mostly trust my own filesystem that was merely degraded. I was not in an alternate boot environment (like a live DVD); I was merely trying to import my files into a new FreeBSD installation. I guess the typical work-flow for a failed disk is simply to attach a new disk in place of the old one (and wait for re-silvering). Since my disk array was was about 5GB too small to ingest all the data I wanted: I wanted to upgrade anyway. While running ddrescue proved to be unnecessary, it was able to recover about 99.9% of the data from the failed disk. A second invocation was able to recover a further 5kB (mostly a waste of time). Not sure if it was FS related, but I have absolutely been unable to boot the machine with both pools in place. The new installation (GELI) reports: "failed to read pad2 area of primary vdev" (with granny removed -- successful boot). Granny would not even run the first stage loader. What I ended up doing is the following: 1. Load up live DVD (with degraded granny + an "archive" disk) 2. # zpool import -f -R /tmp granny 3. # zpool export granny Later: 1. Same live DVD setup # ls /dev -> ada2p1 looks like my "archive" disk 1a. # mount -t extfs /dev/ada2p1 /mnt 2. # zpool import -R /rescue granny 3. # zfs snapshot -r granny@2018-02-26 3b. forgot the -r the first time. To recover (scary command): # zfs destroy granny@2018-02-26 4a: Learned that sending a zfs to itself is a valid operation (yay snapshots!) cryptic error message (out of disk space): warning cannot send '...' : signal received 4b. # zfs send -R -D -v granny@2018-02-26 > /mnt/granny.2018-02-26.zfs 5. clean up # unmount /mnt # zpool export granny Incidentally, granny was able to boot after all that, so I am reasonably sure I have all my data back. Have not tried importing it into my new installation yet. The new machine took me 2 weeks to set up, not 1, but that is off-topic here. Regards, James Phillips