From owner-freebsd-fs@FreeBSD.ORG Mon Jan 17 01:28:00 2011 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 09813106564A for ; Mon, 17 Jan 2011 01:28:00 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id A7D9D8FC08 for ; Mon, 17 Jan 2011 01:27:59 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 93C5E45E49; Mon, 17 Jan 2011 02:27:57 +0100 (CET) Received: from localhost (89-73-192-49.dynamic.chello.pl [89.73.192.49]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 5BFCB45C9C; Mon, 17 Jan 2011 02:27:52 +0100 (CET) Date: Mon, 17 Jan 2011 02:27:39 +0100 From: Pawel Jakub Dawidek To: Emil Smolenski Message-ID: <20110117012739.GF82886@garage.freebsd.pl> References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ncSAzJYg3Aa9+CRW" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: freebsd-fs@freebsd.org Subject: Re: [ZFS] Booting from zpool created on 4k-sector drive 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: Mon, 17 Jan 2011 01:28:00 -0000 --ncSAzJYg3Aa9+CRW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Dec 21, 2010 at 03:29:01PM +0100, Emil Smolenski wrote: > Hello, >=20 > There is a hack to force zpool creation with minimum sector size equal to= =20 > 4k: >=20 > # gnop create -S 4096 ${DEV0} > # zpool create tank ${DEV0}.nop > # zpool export tank > # gnop destroy ${DEV0}.nop > # zpool import tank >=20 > Zpool created this way is much faster on problematic 4k sector drives =20 > which lies about its sector size (like WD EARS). This hack works perfectl= y =20 > fine when system is running. Gnop layer is created only for "zpool create= " =20 > command -- ZFS stores information about sector size in its metadata. Afte= r =20 > zpool creation one can export the pool, remove gnop layer and reimport th= e =20 > pool. Difference can be seen in the output from the zdb command: >=20 > - on 512 sector device (2**9 =3D 512): > % zdb tank |grep ashift > ashift=3D9 >=20 > - on 4096 sector device (2**12 =3D 4096): > % zdb tank |grep ashift > ashift=3D12 >=20 > This change is permanent. The only possibility to change the value of =20 > ashift is: zpool destroy/create and restoring pool from backup. That's a nice hack:) > But there is one problem: I cannot boot from such pool. Error message: >=20 > ZFS: i/o error - all block copies unavailable > ZFS: can't read MOS > ZFS: unexpected object set type 0 Tracking it down and fixing took all my free time during this weekend, eh. I fixed this in ZFSv28 and I'm afraid I'm not going to backport the fix to ZFSv15, as I also did many other changes while working on this (booting off of RAIDZ3 is now supported, for example). Here is the patch if someone would like to try it: http://people.freebsd.org/~pjd/patches/zfs_boot_fixes.patch --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --ncSAzJYg3Aa9+CRW Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk0zmwoACgkQForvXbEpPzQLQwCgqb8zMFwJm7mTmwzk1nI3yqkb Vm8AoJuRxDdvk+b9PNbotrSiNiIwm+xT =9ECW -----END PGP SIGNATURE----- --ncSAzJYg3Aa9+CRW--