Re: [opensuse] fdisk calculations
- From: Greg Freemyer <greg.freemyer@xxxxxxxxx>
- Date: Mon, 16 Mar 2009 10:22:26 -0400
On Mon, Mar 16, 2009 at 4:11 AM, jdd <jdd@xxxxxxxxx> wrote:
Hello :-)
I'm revising the partition HOWTO, using openSUSE 11.1 as example.
I try to understand fdisk output. namely this one from an USB key:
..........................
Disk /dev/sdb: 2012 MB, 2012217344 bytes
47 heads, 46 sectors/track, 1817 cylinders
Units = cylinders of 2162 * 512 = 1106944 bytes
Disk identifier: 0x04030201
Device Boot Start End Blocks Id System
/dev/sdb1 1 1818 1964932 6 FAT16
.......................
I can't understand the underlying calculus. How is the byte number found?
47 heads * 46 s/t = 2162, ok
2162 * 512 = 1106944, ok
but
1817 cyl * 1106944 bytes = 2011317248, not 2012217344 as shown
any idea?
thanks
jdd
jdd,
I would simply have th how-to say something like:
==
The Cylinder / Head / Sector concept is an anachronism from the 1980's
and early 1990's. The CHS concept can only describe disks with a max
capacity of approximately 4 GB. (ie. (2^16-1)*(2^8 -1)*(2^5-1)*512
bytes).
(You need to verify the number of bits available per field, I'm
working from memory.)
Thus the vast majority of currently shipping disks simply use the
maximum allowed value for the number of cylinders, heads, and sectors
in an effort to allow low-level legacy code to access as much of the
disk drive as possible.
Boot loaders were some of the last generally used programs to only
support disk access via CHS. For this reason even into the early 21st
century the boot partition had to be in this early portion of the
disk.
One specific legacy remnant of this design you may need to be
concerned with is that during the 1980s and 1990's, the first
partition was typically located at cylinder 0, head 1, sector 0 to
ensure the partition alignment was consistent with the physical disk.
With most disk drives today, that is sector 63. This location for the
start of the first partition continues to be a common starting point,
but when Microsoft introduced Vista they started placing the first
partition at the 1MiB point. Thus sector 2048 is now a common
starting sector for the first partition.
This has caused a conundrum that is being faced by hard drive
manufacturers in the early 2009 timeframe. They are working on disk
drives that continue to support a 512 byte sector size on the
interface side, but use 4K sectors on the actual platter. This means
that all physical reads and writes to the platters will take place
with 4K of data at a time.
This 4K size works well with most modern OS'es because they use a 4K
page size internally (or a multiple thereof). The issue is alignment,
when a page is written by the OS to the hard drive it will be
important from a performance perspective that the page not overlap two
separate physical 4K sectors.
Unfortunately hard drive manufacturers have two common, but
contradictory alignment needs. They can either have the 4K physical
sectors be aligned with sector 63 that has historically been used for
the start of the first partition, or they can be aligned with
partitions that start on sector 2048 that Vista uses.
At present it appears that manufacturers are leaning toward having the
hard drives configured in the factory to have one alignment or the
other. And the user will have no ability to change it.
Thus if you are attempting to partition a new generation hard drive
that has 4K physical sectors, you should pay special attention to
where your partitions start. The specific desire is that all
partitions be aligned with the 4K physical sectors of the drive. To
the best of my knowledge, as of Mar. 2009 none of the Linux Userspace
partitioning tools have been updated to address this issue because
shipping disk drives are not yet available to test with.
===
Hope that makes sense
Greg
--
Greg Freemyer
Head of EDD Tape Extraction and Processing team
Litigation Triage Solutions Specialist
http://www.linkedin.com/in/gregfreemyer
First 99 Days Litigation White Paper -
http://www.norcrossgroup.com/forms/whitepapers/99%20Days%20whitepaper.pdf
The Norcross Group
The Intersection of Evidence & Technology
http://www.norcrossgroup.com
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx
- Follow-Ups:
- Re: [opensuse] fdisk calculations
- From: David Haller
- Re: [opensuse] fdisk calculations
- References:
- [opensuse] fdisk calculations
- From: jdd
- [opensuse] fdisk calculations
- Prev by Date: Re: [opensuse] OT: GO! Linux!
- Next by Date: Re: [opensuse] OT: GO! Linux!
- Previous by thread: Re: [opensuse] Re: fdisk calculations
- Next by thread: Re: [opensuse] fdisk calculations
- Index(es):
Relevant Pages
|