From owner-freebsd-hackers@FreeBSD.ORG Fri Aug 19 12:17:55 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF37B1065670 for ; Fri, 19 Aug 2011 12:17:55 +0000 (UTC) (envelope-from pdegoeje@service2media.com) Received: from smtp.utwente.nl (smtp2.utsp.utwente.nl [130.89.2.9]) by mx1.freebsd.org (Postfix) with ESMTP id 30AD98FC08 for ; Fri, 19 Aug 2011 12:17:54 +0000 (UTC) Received: from pieter-dev.localnet (lux.student.utwente.nl [130.89.161.112]) by smtp.utwente.nl (8.12.10/SuSE Linux 0.7) with ESMTP id p7JBwnCY015547; Fri, 19 Aug 2011 13:58:49 +0200 From: Pieter de Goeje Organization: Service2Media To: freebsd-hackers@freebsd.org Date: Fri, 19 Aug 2011 13:58:49 +0200 User-Agent: KMail/1.13.7 (Linux/2.6.39-2-amd64; KDE/4.6.5; x86_64; ; ) References: <4E4D50CD.5080806@rawbw.com> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201108191358.49285.pdegoeje@service2media.com> X-UTwente-MailScanner-Information: Scanned by MailScanner. Contact icts.servicedesk@utwente.nl for more information. X-UTwente-MailScanner: Found to be clean X-UTwente-MailScanner-From: pdegoeje@service2media.com X-Spam-Status: No X-Mailman-Approved-At: Fri, 19 Aug 2011 12:28:09 +0000 Cc: Tom Evans , Yuri Subject: Re: ZFS installs on HD with 4k physical blocks without any warning as on 512 block size device X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Aug 2011 12:17:55 -0000 On Friday, August 19, 2011 12:15:30 PM Tom Evans wrote: > On Thu, Aug 18, 2011 at 6:50 PM, Yuri wrote: > > Some latest hard drives have logical sectors of 512 byte when they > > actually have 4k physical sectors. Here is the document describing what > > to do in such case: > > http://ivoras.net/blog/tree/2011-01-01.freebsd-on-4k-sector-drives.html . > > For UFS: newfs -U -f 4096 /dev/da0 > > For ZFS: gnop create -S 4096 /dev/da0 && zpool create data /dev/da0.nop > > > > I am sure most people just install such hard drive without doing this and > > potentially get suboptimal performance since they aren't aware about > > this. Shouldn't UFS and ZFS drivers be able to either read the right > > sector size from the underlying device or at least issue a warning? > > > > Yuri > > The device never reports the actual sector size, so unless FreeBSD > keeps a database of 4k sector hard drives that report as 512 byte > sector hard drives, there is nothing that can be done. > > Cheers > > Tom In -current at least there is a quirk table for these drives - the stripe size is set to 4K. Other tools use this size to align stuff on. Also, the default fragment size of UFS was increased to 4K. - Pieter