From owner-freebsd-fs@FreeBSD.ORG Wed Jun 8 05:29:44 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 8B4E71065670 for ; Wed, 8 Jun 2011 05:29:44 +0000 (UTC) (envelope-from rsimmons0@gmail.com) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id 49A3B8FC18 for ; Wed, 8 Jun 2011 05:29:44 +0000 (UTC) Received: by gxk28 with SMTP id 28so82176gxk.13 for ; Tue, 07 Jun 2011 22:29:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=MRtx3KdjRRzNv/yMC2Le6H2vyZ8iNFuJb1Q//VJQjrw=; b=fHRspVnWI31Mip/qj3hRGPWOy5s4LCAnj4pRYAXUCSq2P44C2lhVrRRCUQy6cfLBYM WHANa1On9zeSFClQRGhuiEaaRJEka77kDsT280omshuv/LmS8a0QiItWAD4lkWZxpWt+ T5QjNoVAyU65kEi0L6r4xB02ddNhGPU1074zA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=NnT7UEOA65U3BGnwOxs4NFXEsIKwSY64Cv5rmKgDtRxNMPdF4ZCkj4FkNT7pdPZ3qe P4wWSLvEcosPD+teqtiYUJ1YJS916FVcb7ZIVhK6JtwrbxahcKULWPyhAkuqK6hJlczm v2O3L/HfwUMSCJD7f5ygWMKUtqljjGsht1EL8= MIME-Version: 1.0 Received: by 10.101.152.32 with SMTP id e32mr5676989ano.45.1307510983464; Tue, 07 Jun 2011 22:29:43 -0700 (PDT) Received: by 10.100.243.35 with HTTP; Tue, 7 Jun 2011 22:29:43 -0700 (PDT) In-Reply-To: References: Date: Wed, 8 Jun 2011 01:29:43 -0400 Message-ID: From: Robert Simmons To: freebsd-fs@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 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: Wed, 08 Jun 2011 05:29:44 -0000 On Wed, Jun 8, 2011 at 12:29 AM, Mark Felder wrote: > On Tue, 07 Jun 2011 22:27:24 -0500, Robert Simmons > wrote: >> Do all HDDs that have 4KB per LBA present themselves to the OS as >> having 512 bytes per LBA? > > No Ok, but can I assume that all HDDs of this type expand each of the 4K sectors so that physically they take up the same space as eight 512 byte LBAs? AFAIK, the new 4K LBA has a smaller ECC area than the sum of 8 ECC areas in 512 byte LBAs, so if the data area was _not_ expanded slightly, you would never really be aligned except every x LBAs as the shifting approaches an LBA boundary, right? For any HDDs, do I need to worry about cylinder boundaries at all? Has the reported "disk geometry" become divorced from the physical reality in modern disks? If I do still need to worry about cylinder boundaries, should I basically ignore every reported geometry (BIOS, OS) and use what is written on the sticker on the drive? >> What about SSDs that have 1024 bytes per LBA? > > Not sure, but I do know that not all flash media have the same bytes per LBA > internally. Some are 1K, some 4K, some even 8K. GPT is definitely the way to > go if you want to make sure you're aligned. Ok, is there some way to tell gpart(8) what the LBA size is, or do I have to calculate the offset of each partition manually? In Linux it would be "fdisk -b 1024" for the example of SSDs or "fdisk -b 4096" for 4K HDDs. Can I just ignore the idea of "cylinder boundaries" completely when dealing with SSDs and flash memory?