From owner-freebsd-stable@FreeBSD.ORG Wed Apr 1 04:30:55 2015 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0CB82311 for ; Wed, 1 Apr 2015 04:30:55 +0000 (UTC) Received: from mail.netplex.net (mail.netplex.net [204.213.176.9]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "*.netplex.net", Issuer "RapidSSL SHA256 CA - G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D6F079 for ; Wed, 1 Apr 2015 04:30:54 +0000 (UTC) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.netplex.net (8.15.1/8.15.1/NETPLEX) with ESMTP id t314UkOc024212 for ; Wed, 1 Apr 2015 00:30:46 -0400 X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.netplex.net) X-Greylist: Message whitelisted by DRAC access database, not delayed by milter-greylist-4.4.3 (mail.netplex.net [204.213.176.9]); Wed, 01 Apr 2015 00:30:46 -0400 (EDT) Date: Wed, 1 Apr 2015 00:30:46 -0400 (EDT) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net Reply-To: Daniel Eischen To: freebsd-stable@freebsd.org Subject: Trying to clone a ZFS drive, can't get ashift=12 Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2015 04:30:55 -0000 I have an Oracle (nee Sun) X4-2 server with identical 300GB SAS drives. I did an MBR ZFS install from FreeBSD 10.1-RELEASE CD and have it updated to p6: $ uname -a FreeBSD foo 10.1-RELEASE-p6 FreeBSD 10.1-RELEASE-p6 #0: Tue Feb 24 19:00:21 UTC 2015 root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64 $ freebsd-version 10.1-RELEASE-p6 The current ZFS setup is: $ zdb | grep ashift ashift: 12 ashift: 12 $ zpool status pool: bootpool state: ONLINE scan: resilvered 486M in 0h0m with 0 errors on Thu Mar 26 09:16:45 2015 config: NAME STATE READ WRITE CKSUM bootpool ONLINE 0 0 0 diskid/DISK-001442CBEEKF%20%20%20%20%20%20%20%20KFHBEEKFs1a ONLINE 0 0 0 pool: zroot state: ONLINE scan: resilvered 200K in 0h0m with 0 errors on Wed Mar 25 10:51:36 2015 config: NAME STATE READ WRITE CKSUM zroot ONLINE 0 0 0 diskid/DISK-001442CBEEKF%20%20%20%20%20%20%20%20KFHBEEKFs1d ONLINE 0 0 0 $ gpart show diskid/DISK-001442CBEEKF%20%20%20%20%20%20%20%20KFHBEEKF => 63 585937437 diskid/DISK-001442CBEEKF%20%20%20%20%20%20%20%20KFHBEEKF MBR (279G) 63 585937422 1 freebsd [active] (279G) 585937485 15 - free - (7.5K) $ gpart show diskid/DISK-001442CBEEKF%20%20%20%20%20%20%20%20KFHBEEKFs1 => 0 585937422 diskid/DISK-001442CBEEKF%20%20%20%20%20%20%20%20KFHBEEKFs1 BSD (279G) 0 4194304 1 freebsd-zfs (2.0G) 4194304 8388608 2 freebsd-swap (4.0G) 12582912 573354510 4 freebsd-zfs (273G) [Why are the disk ids blank %20 filled?] Now I want to create another (sorta) matching setup, but this time want to use labels and 4G (instead of 2G) for bootpool. # gpart create -s MBR da1 # gpart add -t freebsd da1 # gpart create -s BSD da1s1 # gpart add -s 4G -t freebsd-zfs da1s1 # gpart add -s 4G -t freebsd-swap da1s1 # gpart add -t freebsd-zfs da1s1 # gpart show da1 => 63 585937437 da1 MBR (279G) 63 585937422 1 freebsd (279G) 585937485 15 - free - (7.5K) # gpart show da1s1 => 0 585937422 da1s1 BSD (279G) 0 8388608 1 freebsd-zfs (4.0G) 8388608 8388608 2 freebsd-swap (4.0G) 16777216 569160206 4 freebsd-zfs (271G) Except for da1s1a being 4G instead of 2G, everything matches the ZFS setup above. Make the labels. # glabel label boot0 da1s1a # glabel label swap0 da1s1b # glabel label root0 da1s1d Create the ZFS bootpool. # zpool create -o cachefile=/tmp/newpool.cache bootpoolNew label/boot0 # zdb -U /tmp/newpool.cache | grep ashift ashift: 9 The geometry matches, but ashift is 9 not 12. If I try to use 4K, the disk geometry doesn't match the original and ashift is still 9 instead of 12. # gpart create -s MBR da1 # gpart add -a 4k -t freebsd da1 # gpart create -s BSD da1s1 # gpart add -a 4k -s 4G -t freebsd-zfs da1s1 # gpart add -a 4k -s 4G -t freebsd-swap da1s1 # gpart add -a 4k -t freebsd-zfs da1s1 # gpart show da1 => 63 585937437 da1 MBR (279G) 63 63 - free - (32K) 126 585937359 1 freebsd [active] (279G) 585937485 15 - free - (7.5K) # gpart show da1s1 => 0 585937359 da1s1 BSD (279G) 0 2 - free - (1.0K) 2 8388608 1 freebsd-zfs (4.0G) 8388610 8388608 2 freebsd-swap (4.0G) 16777218 569160136 4 freebsd-zfs (271G) 585937354 5 - free - (2.5K) # zpool create -o cachefile=/tmp/newpool.cache bootpoolNew label/boot0 # zdb -U /tmp/newpool.cache | grep ashift ashift: 9 What gives? How do I get it to use 4k? -- DE