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

Pawel Jakub Dawidek pjd at FreeBSD.org
Mon Jan 17 01:28:00 UTC 2011


On Tue, Dec 21, 2010 at 03:29:01PM +0100, Emil Smolenski 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.

That's a nice hack:)

> 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

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

-- 
Pawel Jakub Dawidek                       http://www.wheelsystems.com
pjd at FreeBSD.org                           http://www.FreeBSD.org
FreeBSD committer                         Am I Evil? Yes, I Am!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-fs/attachments/20110117/a7ebe47f/attachment.pgp


More information about the freebsd-fs mailing list