linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Tomasz Palac <palac@uci.agh.edu.pl>
Cc: linux-ide@vger.kernel.org
Subject: Re: Comment on ATA 4 KiB sector issues
Date: Wed, 10 Mar 2010 17:33:32 +0900	[thread overview]
Message-ID: <4B97595C.7010104@kernel.org> (raw)
In-Reply-To: <Pine.GSO.4.63.1003100853360.21647@galaxy.agh.edu.pl>

Hello,

On 03/10/2010 05:15 PM, Tomasz Palac wrote:
>> Yes, the geometry is basically arbitrary values which can be queried
>> using a BIOS call and the reason why SCSI hosts can choose them is
>> they implement BIOS extensions themselves.
> 
> I mentioned SCSI host adapters to show that 64/32 geometry is no problem
> for Linux (and other OS-es). Really is 255/63 hardcoded in many places?

For starters, on some mobos I have, I can't change the reported
geometry.

>>> If not, then geometry can be read from partition table.
>>
>> From where?
> 
>> From the ending CHS values of partition if it ends at cylinder boundary.
> How do you calculate geometry from newer Windows partition tables (cases
> W-1, W-2 and W-3)?

By solving the equations matching CHSs and LBAs.  It only works if the
first partition ends before the CHS address limit (2 variables to
solve for so we need 2 different equations).

>> For modern OSes, geometry doesn't matter at all.  Older ones are the
>> ones having problems (I've been corrected: XP seems okay while 2000
>> depends on CHS).
> 
> You are proposing "doing what Windows is doing". This way:
> 
> 1. Partitions are aligned at 1 MiB (which is very good).
> 2. Geometry is "standard", i.e. 255/63 (which is good).
> 3. Partitions don't start and end at cylinder boundary (which is not so
>    good).
> 
> With 64/32 you can have:
> 
> 1. Partitions aligned at 1 MiB.
> 2. Geometry is not standard, but is widely used (SCSI disks, USB flash
>    disks).
> 3. Partitions start and end at cylinder boundary.

2 and 3 are meaningful iff the users agree on using that specific
geometry.  W/o any reliable way to communicate that custom geometry to
other users of the partition table, 2 and 3 virtually don't exist.
Partitioner partitions according to 64/32, BIOS reports 63/255.  It's
just broken.

We can feed 64/32 or whatever geometry to partitioners to trick them
into beliving certain geometry so that the end result is aligned in
certain way but that works only if the users of the partition table
don't care about CHS addresses in the partition table at all (most
modern ones don't).  The only reason we're talking about geometry is
for compatibility w/ older operating systems.  So, at this point,
diddling with geometry just doesn't make any sense at all.

Thanks.

-- 
tejun

  reply	other threads:[~2010-03-10  8:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Pine.GSO.4.63.1003080933100.4114@galaxy.agh.edu.pl>
     [not found] ` <4B95AEF6.8030906@kernel.org>
2010-03-09  9:22   ` Comment on ATA 4 KiB sector issues Tomasz Palac
2010-03-10  5:46     ` Tejun Heo
2010-03-10  8:15       ` Tomasz Palac
2010-03-10  8:33         ` Tejun Heo [this message]
2010-03-10  9:40           ` Tomasz Palac
2010-03-12  1:37             ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B97595C.7010104@kernel.org \
    --to=tj@kernel.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=palac@uci.agh.edu.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).