From owner-freebsd-fs@FreeBSD.ORG Thu Jun 9 09:44:46 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 768D81065670 for ; Thu, 9 Jun 2011 09:44:46 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward5.mail.yandex.net (forward5.mail.yandex.net [77.88.46.21]) by mx1.freebsd.org (Postfix) with ESMTP id 036A58FC1C for ; Thu, 9 Jun 2011 09:44:45 +0000 (UTC) Received: from smtp3.mail.yandex.net (smtp3.mail.yandex.net [77.88.46.103]) by forward5.mail.yandex.net (Yandex) with ESMTP id DDB7F1203BB2; Thu, 9 Jun 2011 13:29:04 +0400 (MSD) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1307611744; bh=LcXgw5G8YWQpUomfZLXyxVAkfxJZe0zcQ8400QAFuLI=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type; b=CT2h3grGJ9LC4FglGtyyMqOkuJs0RfQtTwKRvXB3w2c8oyrRwvqz5ilaPv7BgxK0O UEDhObtP4sucpeHeWVXHzKXXtat9QHXUTrd3xu5Vh+mDZvKoomt9ejm2cJ1uzxfALW I080VUw+Lk2ES9jqQn/s+x1nUfQ6lP1JZ/fx0YmY= Received: from [127.0.0.1] (ns.kirov.so-ups.ru [77.72.136.145]) by smtp3.mail.yandex.net (Yandex) with ESMTPSA id 9ACAF6980066; Thu, 9 Jun 2011 13:29:04 +0400 (MSD) Message-ID: <4DF0925C.5050705@yandex.ru> Date: Thu, 09 Jun 2011 13:29:00 +0400 From: "Andrey V. Elsukov" User-Agent: Mozilla Thunderbird 1.5 (FreeBSD/20051231) MIME-Version: 1.0 To: Robert Simmons References: In-Reply-To: X-Enigmail-Version: 1.1.1 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig5F660C16768F851386837BF5" X-Yandex-Spam: 1 Cc: freebsd-fs@freebsd.org Subject: Re: GPT and disk alignment 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: Thu, 09 Jun 2011 09:44:46 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig5F660C16768F851386837BF5 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable On 08.06.2011 7:27, Robert Simmons wrote: > Do all HDDs that have 4KB per LBA present themselves to the OS as > having 512 bytes per LBA? Recently I added automatic alignment feature to gpart(8) in head/. I plan to merge it to stable/8 in the next week. Also there were some changes in ada(4) driver and now you can add quirk for your drive to let system know about your 4k drive. The easiest way to know is your partition aligned or not - use diskinfo(8= ). Example: # diskinfo -v ada0p3 ada0p3 512 # sectorsize 75731098112 # mediasize in bytes (70G) 147912301 # mediasize in sectors 4096 # stripesize 1024 # stripeoffset 146738 # Cylinders according to firmware. 16 # Heads according to firmware. 63 # Sectors according to firmware. S0DEJ1NL817767 # Disk ident. If `echo $stripeoffset % 4096 | bc` is not zero - your partition is not aligned (where $stripeoffset is value from diskinfo(4) output). About gpart(8). The current implementation of some partitioning schemes d= oes not allow to use any offset values for partitions (MBR, EBR, VTOC8). But GPT = does allow. So examples for GPT, to align new partition you can use this command: # gpart add -t freebsd-zfs -s 10G -a 4k ada0 and gpart will try to align it to 4k boundaries. About ada(4) quirks. You can add to your loader.conf this line: kern.cam.ada.0.quirks=3D"1" After reboot your disk will report about 4k stripesize: # geom disk list ada0 Geom name: ada0 Providers: 1. Name: ada0 Mediasize: 80026361856 (74G) Sectorsize: 512 Stripesize: 4096 Stripeoffset: 0 Mode: r2w2e4 descr: SAMSUNG HD080HJ/P ident: S0DEJ1NL817767 fwsectors: 63 fwheads: 16 And gpart(8) will use this information for automatic alignment. But this will work only in 9.0-CURRENT. --=20 WBR, Andrey V. Elsukov --------------enig5F660C16768F851386837BF5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) iQEcBAEBAgAGBQJN8JJgAAoJEAHF6gQQyKF6rKwH/1MAkVlDgTXS+y+X3wzWZvGe OqCJKo7XKlgGsChoTNV/VOspyRWnCUv1nqRNIIj1NQCiHrE6oyadeJY7bqgrr+5F VsARnMtchTfqEh8uzSRZ19QRZjXKWUwx3wkuRUWRyRpenzIBqXmMeEgE7BKCzU/H 7zJXVdWZ/Fogjus1cXgTurkUnsXbTqPgWY7m9aiqB1sKrEgarbQg8jHU2REtmgpH Jn47TvdWwZpzl/vL50to+UxZ3p9BiThyz9ZbONNdmzz2oOSBg9+TZDBQK4ZZ5NDZ D7jIpzoW/Rvuay+fHoB+ZGy96+Ub65PzTrDPTRU4p+ssdjpRrJ+TmOVx/BJXpC0= =oz6p -----END PGP SIGNATURE----- --------------enig5F660C16768F851386837BF5--