[ZFS] Booting from zpool created on 4k-sector drive

Alexander Leidinger Alexander at Leidinger.net
Sun May 1 11:36:48 UTC 2011


On Tue, 21 Dec 2010 15:29:01 +0100 "Emil Smolenski" <am at raisa.eu.org>
wrote:

> Hello,
> 
> There is a hack to force zpool creation with minimum sector size
> equal to 4k:
> 
> # gnop create -S 4096 ${DEV0}
> # zpool create tank ${DEV0}.nop
> # zpool export tank
> # gnop destroy ${DEV0}.nop
> # zpool import tank
> 
> Zpool created this way is much faster on problematic 4k sector
> drives which lies about its sector size (like WD EARS). This hack
> works perfectly fine when system is running. Gnop layer is created
> only for "zpool create" command -- ZFS stores information about
> sector size in its metadata. After zpool creation one can export the
> pool, remove gnop layer and reimport the pool. Difference can be seen
> in the output from the zdb command:
> 
> - on 512 sector device (2**9 = 512):
> % zdb tank |grep ashift
> ashift=9
> 
> - on 4096 sector device (2**12 = 4096):
> % zdb tank |grep ashift
> ashift=12
> 
> This change is permanent. The only possibility to change the value
> of ashift is: zpool destroy/create and restoring pool from backup.
> 
> But there is one problem: I cannot boot from such pool. Error message:
> 
> ZFS: i/o error - all block copies unavailable
> ZFS: can't read MOS
> ZFS: unexpected object set type 0

FYI: I can boot successfully from a ZFS v28 pool which was created like
this in a GPT partition (tested with 9-current).

Bye,
Alexander.

-- 
http://www.Leidinger.net    Alexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org       netchild @ FreeBSD.org  : PGP ID = 72077137


More information about the freebsd-fs mailing list