From owner-freebsd-fs@FreeBSD.ORG Tue Mar 1 01:07:22 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 BD6931065691 for ; Tue, 1 Mar 2011 01:07:22 +0000 (UTC) (envelope-from am@raisa.eu.org) Received: from raisa.eu.org (178-73-15-208.home.aster.pl [178.73.15.208]) by mx1.freebsd.org (Postfix) with ESMTP id 79E2C8FC15 for ; Tue, 1 Mar 2011 01:07:21 +0000 (UTC) Received: from bolt.zol (nereis.pl [62.121.98.25]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by raisa.eu.org (Postfix) with ESMTP id 93A171AF; Tue, 1 Mar 2011 02:07:42 +0100 (CET) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Freddie Cash" References: <4D6AAC9A.4000602@jrv.org> Date: Tue, 01 Mar 2011 02:07:14 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Emil Smolenski" Message-ID: In-Reply-To: User-Agent: Opera Mail/11.01 (FreeBSD) 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: Tue, 01 Mar 2011 01:07:22 -0000 On Tue, 01 Mar 2011 00:13:33 +0100, Freddie Cash wrote: > On Mon, Feb 28, 2011 at 12:08 PM, Emil Smolenski wrote: >> On Sun, 27 Feb 2011 20:57:14 +0100, James R. Van Artsdalen >> wrote: >>> Emil Smolenski wrote: >>>> 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 >>>> >>>> This change is permanent. The only possibility to change the value of >>>> ashift is: zpool destroy/create and restoring pool from backup. >>> >>> Is ashift a property of the pool or a property of the device? >> >> It is property of the ZFS pool. It is calculated when the pool is >> created >> based on the sector size advertised by devices. > > Can you point to where in the source this is set? And where it's used? > > I'd like to have this confirmed once and for all. :) > > I've seen conflicting reports around the web that it's a per-vdev > setting and that it's a per-pool setting. > > For example, this thread in the FreeBSD Forums shows it to be a > per-vdev setting: > https://forums.freebsd.org/showthread.php?t=21644 > > Yet many threads on the zfs-discuss mailing list say it's a per-pool > setting based on the first vdev added to the pool. It is property of vdev actually. I wrote ``it is property of ZFS pool'' in opposite to ``it is property of device''. Sorry for the confusion. There is no need to read sources to obtain this information -- zdb(1m) is sufficient. >>> I'm wonder about the disk replacement scenario, where the replacement >>> disk cannot be smaller than the disk it replaces. >> >> And the new disk must advertise sector size equal or smaller than >> 2**ashift of the existing pool. > > Why? What's the harm in running with ashift=12 (4 KB) on a drive that > uses 0.5 KB sectors? Wouldn't that be the best setup to use, to > future-proof the pool? Yes. That is exactly what I mean. See my first message in this thread for reference: http://lists.freebsd.org/pipermail/freebsd-fs/2010-December/010350.html James asks about disk replacement scenario. In this case you cannot use device with greater sector size than 2**ashift of the existing vdev as replacement: # diskinfo -v md0 |grep sectorsize 512 # sectorsize # zpool create test0 md0 # zdb test0 |grep ashift ashift=9 # diskinfo -v md1.nop |grep sectorsize 4096 # sectorsize # zpool replace test0 md0 md1.nop cannot replace md0 with md1.nop: devices have different sector alignment -- am