From owner-freebsd-fs@FreeBSD.ORG Tue Jan 10 18:18:31 2012 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9029106564A for ; Tue, 10 Jan 2012 18:18:29 +0000 (UTC) (envelope-from knarf@knarf.de) Received: from mail.server-king.de (mail.server-king.de [IPv6:2a01:4f8:100:41a2::25]) by mx1.freebsd.org (Postfix) with ESMTP id 2F4948FC13 for ; Tue, 10 Jan 2012 18:18:28 +0000 (UTC) Received: from cheese.server-king.de (localhost [127.0.0.1]) by mail.server-king.de (8.14.5/8.14.5) with ESMTP id q0AIIRfS054282 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 10 Jan 2012 19:18:27 +0100 (CET) (envelope-from knarf@knarf.de) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=knarf.de; s=mail.server-king.de; t=1326219508; bh=q1d0yjbzTDwWIhASQ56u8WrtijCJXmbJpbxxPNPVpdg=; h=Date:From:To:Subject:Message-ID:MIME-Version:Content-Type; b=ZoyLp3WMOtE8Bh1C72FS4xkN9HtmwNljAfKT9zXvTSP7G3h2sJyz5dfoeg0/6xYXl sAK3DuHl7aEPeTb4mCaSZ4fdjGIGwV9J3oBhLicQa1XR7QqcTu5s3CK7x8Qp1ZR8jW RB4d3pqea3ubJIYnf5aRQmsEjkLEODW3DjwsLhMk= Received: (from knarf@localhost) by cheese.server-king.de (8.14.5/8.14.5/Submit) id q0AIIRSm054281 for freebsd-fs@freebsd.org; Tue, 10 Jan 2012 19:18:27 +0100 (CET) (envelope-from knarf@knarf.de) X-Authentication-Warning: cheese.server-king.de: knarf set sender to knarf@knarf.de using -f Date: Tue, 10 Jan 2012 19:18:27 +0100 From: Frank Bartels To: freebsd-fs@freebsd.org Message-ID: <20120110181827.GA7601@server-king.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.7 (mail.server-king.de [127.0.0.1]); Tue, 10 Jan 2012 19:18:28 +0100 (CET) Subject: Mounting from zfs:zroot failed with error 6. X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 18:18:31 -0000 Hi, I use FreeBSD 9.0-RELEASE. I boot from USB stick (16 GB) using gptzfsboot. Everything works fine. In the past weeks I've read a lot about the 4 KB alignment and ashift=12. But at the time I've created the stick the first time I had no idea about all these problems. I still have no clue what the physical sector size of my USB stick is (more than 4 KB for sure, maybe 128 KB or 256 KB?) and why gnop does not allow more than 8 KB, but that's another story. This is my old stick, created the wrong way: bkool:/root# gpart show da1 => 34 30883773 da1 GPT (14G) 34 128 1 freebsd-boot (64k) 162 8019968 2 freebsd-swap (3.8G) 8020130 22863677 3 freebsd-zfs (10G) And this is the new one, created the right way: bkool:/root# gpart show da0 => 34 30871485 da0 GPT (14G) 34 6 - free - (3.0k) 40 128 1 freebsd-boot (64k) 168 1880 - free - (940k) 2048 8388608 2 freebsd-swap (4.0G) 8390656 22480863 3 freebsd-zfs (10G) So my plan is to create a new zpool with altroot= and cachefile=, rsync the old stick to the new one, copy over the cachefile, double check loader.conf vfs.root.mountfrom= and zfs bootfs=. This worked several times before in other environments. But here it does not. If I try to boot, the new stick runs gptzfsboot, loads the kernel and fails with "Mounting from zfs:bkool9 failed with error 6.". In the past (maybe it was with 8.2-RELEASE) I had the same problem. The solution was to type "zfs:zroot" (*same* value from loader.conf) at the prompt and it worked. But this time this "trick" does not help. I've seen this error message several times now. I tried to create the new zpool with ashift=12 (gnop -S 4K) and ashift=9. I double checked gpart bootcode. kernel is GENERIC with DDB enabled, no other changes. But it won't mount root. The interesting part is, if I boot from the old stick and inspect the new one, I see this: bkool:/root# zpool import pool: bkool9 id: 2362879880167335458 state: FAULTED status: One or more devices contains corrupted data. action: The pool cannot be imported due to damaged devices or data. The pool may be active on another system, but can be imported using the '-f' flag. see: http://www.sun.com/msg/ZFS-8000-5E config: bkool9 FAULTED corrupted data 5856161150314576551 UNAVAIL corrupted data But, if I tell zpool to look for devices in /dev, I get this: bkool:/root# zpool import -d /dev pool: bkool9 id: 2362879880167335458 state: ONLINE action: The pool can be imported using its name or numeric identifier. config: bkool9 ONLINE gpt/bkool9-disk0 ONLINE What's going on here? Why is the kernel not able to find the zpool during boot (after loading the loader and kernel from it!) even if "/dev/gpt/bkool9-disk0" is part of zpool.cache? And why is looking for devices in /dev or /dev/gpt not default if I use zpool import? The manual page says "/dev/dsk" is default, but does this not only make sense under Solaris? And what does "5856161150314576551" mean? Where does the information about the pool bkool9 come from if the only vdev is UNAVAIL and there are no hints in /boot/zfs/zpool.cache? Thanks, Frank