From owner-freebsd-current@FreeBSD.ORG Tue Dec 6 07:36:55 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56C1A106564A for ; Tue, 6 Dec 2011 07:36:55 +0000 (UTC) (envelope-from peter.maloney@brockmann-consult.de) Received: from mo-p05-ob6.rzone.de (mo-p05-ob6.rzone.de [IPv6:2a01:238:20a:202:53f5::1]) by mx1.freebsd.org (Postfix) with ESMTP id 9EE1A8FC13 for ; Tue, 6 Dec 2011 07:36:54 +0000 (UTC) X-RZG-AUTH: :LWIKdA2leu0bPbLmhzXgqn0MTG6qiKEwQRWfNxSw4HzYIwjsnvdDt2oX8drk2nmtZ6Ei2mfD X-RZG-CLASS-ID: mo05 Received: from [192.168.179.42] (hmbg-5f77cf11.pool.mediaWays.net [95.119.207.17]) by smtp.strato.de (cohen mo41) (RZmta 26.10 AUTH) with (DHE-RSA-AES256-SHA encrypted) ESMTPA id i053aenB673MU8 for ; Tue, 6 Dec 2011 08:36:48 +0100 (MET) Message-ID: <4EDDC60E.9060106@brockmann-consult.de> Date: Tue, 06 Dec 2011 08:36:46 +0100 From: Peter Maloney User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: freebsd-current@freebsd.org References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Re: ZFS: i/o error all block copies unavailable Invalid format X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2011 07:36:55 -0000 Am 06.12.2011 07:14, schrieb KOT MATPOCKuH: > Hello all! > > On 24 nov I updated sources via csup to RELENG_9 (9.0-PRERELEASE). > After make installboot I successfully booted to single user. > But after make installworld system was fail to boot with message: > ZFS: i/o error all block copies unavailable > Invalid format > > status command shows status of all polls properly. > root filesystem is not compressed. > > # zfsboottest /dev/gpt/rootdisk /dev/gpt/rootmirr > pool: sunway > config: > > NAME STATE > sunway ONLINE > mirror ONLINE > gpt/rootdisk ONLINE > gpt/rootmirr ONLINE > > Restore of old /boot/zfsloader was solved issue. > Before I successfully updated 4 another systems with same sources > level without any problems. > > My sys/boot/zfs/zfsimpl.c's version: 1.17.2.2 2011/11/19 10:49:03 > > Where may a root cause of problem? And how I can debug this problem? > "Invalid format" sounds like the software doesn't understand the disks. Check your pool (software) version with: # zpool upgrade -v Check your pool (on disk) version with (I forget the exact command): # zpool get version sunway My guess is that you installed the latest zfs on the pool, but left the old version of the bootloader. ------------- To fix an unbootable zfs root where the disks are working fine or degrade, this is the general procedure. I don't know if it applies to your particular problem, but I am optimistic. In this example, I copied a usb disk called zrootusb to one called zrootusbcopy. Import the pool using altroot and cachefile. # zpool import -o altroot=/z -o cachefile=/tmp/zpool.cache zrootusbcopy Set mount points (/ is fine, don't need legacy... legacy is a hassle, needing to set it to / and back after umount every time you repair things) Since altroot is /z, the root will be at /z/; do not prepend /z in mountpoint. # zfs list | grep zrootusbcopy # zfs set mountpoint=/ zrootusbcopy (if you were copying a disk and wanted it to be bootable, this is the point when you would snapshot and zfs send, where the above is the newly created bootable copy) Make sure bootfs is set. zfs get bootfs zrootusbcopy zfs set bootfs=zrootusbcopy zrootusbcopy **Copy the cache file to the new pool's /boot/zfs cp /tmp/zpool.cache /z/boot/zfs/zpool.cache Verify that the /boot/loader.conf is correct (pool name), and zfs_load is there. vfs.root.mountfrom="zfs:zrootusbcopy" zfs_load="YES" If this is your only zfs: # zfs umount -a otherwise one at a time: # zfs umount zrootusbcopy/var/empty # zfs umount zrootusbcopy/usr/ ... or a script (bash, untested): #begin script for name in $(zfs list -H -o name | grep -E "^zrootusbcopy/"); do zfs umount $name done zfs umount zrootusbcopy #end script install bootloader (possibly the only step you actually needed). 1. Figure out what disks and partition number to put it on... I use: gpart show 2. Install. If it is a mirror, do 2 of these commands with different devices. gpart bootcode -b /z/boot/pmbr -p /z/boot/gptzfsboot -i Then do not export. Then reboot; try to boot your previously unbootable zfs root system. Here is a thread where I suggested this method to someone and it worked for him, although his error message was different. http://forums.freebsd.org/showthread.php?t=26789