Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Jan 2011 02:27:39 +0100
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        Emil Smolenski <am@raisa.eu.org>
Cc:        freebsd-fs@freebsd.org
Subject:   Re: [ZFS] Booting from zpool created on 4k-sector drive
Message-ID:  <20110117012739.GF82886@garage.freebsd.pl>
In-Reply-To: <op.vn2iid1qk84lxj@arrow>
References:  <op.vn2iid1qk84lxj@arrow>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110117012739.GF82886>