Hard drive geometry

from Wikipedia, the free encyclopedia

The geometry of a hard disk is the division of the hard disk into cylinders, tracks and sectors.

principle

Cylinder, head, sector and track in relation to the data disks on a hard disk
Magneto-optical recording of the magnetizations of individual bits on a section of a hard disk.

The data on hard disks (and also floppy disks ) is divided into small sections - so-called data blocks or sectors  - that have a constant size (usually 512 bytes or a multiple, around 4,096 bytes). To do this, the sides of all disks on a hard disk are numbered consecutively. While floppy disks have a maximum of two sides, a front and a back, hard disks almost always have more than one disk with two sides each (→ disk stack, see physical structure of a hard disk ). Each side has its own read / write head, which is why we speak of the number of heads . The surfaces are in turn divided into concentric circular tracks and these are divided into the number of sectors per track . The respective individual tracks (of a respective circle diameter) of all plate surfaces of the plate stack are combined as so-called cylinders .

This creates a coordinate system with the help of which each data block can be identified by its head, cylinder and sector number. The head number corresponds to the height, the cylinder number to the radius and the sector number to the angle of an object in a cylinder coordinate system . The motivation for this definition comes from the fact that all heads are fixed at the same radial distance on the actuator and all tracks of a cylinder (across all plates) are under the heads at a certain point in time and can therefore be addressed at the same time.

Since the tracks get longer with increasing radius, they are divided into more blocks if necessary. (This adjusts the recording density of the tracks - and thus avoids “wasted” space on the outer tracks.) This method is usually not common with floppy disks.

In order not to make the management of the data blocks too complex, several adjacent tracks are usually combined into zones . Each zone is divided into a certain number of sectors that fall from zone to zone. (Usually you start counting the cylinders or zones at the outer edge.)

The concrete distribution of the blocks on the surfaces, zones, cylinders and sectors is called the geometry of the hard disk (or diskette).

Cylinder, Head, Sector

To address now a physical block of data in this way, it takes three values, even CHS called values: C ylinder , H ead (head) and S ector . With the first hard disks around 1970, the individual disks were interchangeable, had a simple geometry and a low data density by later standards . The firmware of the computer or the operating system had to take care of the management of the available storage space and should optimize the access according to this geometry. But hard drives became more and more compact, the data density increased and the geometry more complex.

In the mid-1980s, a new interface for hard drives was developed: On behalf of Compaq , Western Digital developed an interface called Integrated Drive Electronics (IDE for short) from 1984 , which provided an internal controller for communication between the operating system and hard drive. This interface became the industry standard in 1989 with the ATA specification "ATA-1" . From then on, the firmware of the hard disk controller took care of the optimization of read and write access as internal logic.

The geometry communicated by the controller to the PC was no longer necessarily identical to the real geometry of the disks, but it was still compatible with the firmware of the computer (the BIOS on the IBM PC ) and the operating systems. The CHS addressing used with IDE (or ATA) provides for a maximum of 65,536 cylinders (0–65535), 16 heads (0–15) and 255 sectors per track (1–255). The resulting maximum storage capacity of 136,902,082,560 bytes or 137 GB (decimal, as SI unit always as a multiple of 1,000 or 10 n , which corresponds to the previously common binary information of 128 GiB as an IEC unit in powers of two, 2 n ) was broken in 2001 with storage capacities of 160 GiB and more for hard drives.

Logical block addressing

As early as 1996, with the specification “ATA-2”, a new addressing method was introduced, the data blocks consecutively numbered and addressed using their block numbers: the Logical Block Addressing method (LBA for short). This means that the operating system no longer has to worry about the physical organization of the blocks on the data carrier, which in any case no longer corresponded to reality and was fraught with too many problems.

Initially, LBA was limited to 28 bits (“LBA-28”; 2 28 results in 268,435,456 blocks) but also to 137 GB (128 GiB, with 512 bytes per block that was usual at the time). It was only with ATA / ATAPI-6 from the year 2000 that the logical block address was increased to 48 bits (“LBA-48”; 2 48 allowed with 512 bytes per block 128 PiB, that is 134 million GiB) and thus made additional blocks addressable and therefore also fully usable larger hard drives. Without LBA-48, only the first 128 GiB can be used.

The advantage of the ATA specification turned out to be the use of a controller that not only conceals the physical structure and thereby e.g. B. makes modern solid-state disks (SSDs) usable for electronic devices that can actually only handle hard disks - it also enables performance improvements that would not be possible without a controller: e.g. B. the internal management of defective blocks (defect management), SMART , wear leveling for flash memory , garbage collection and over-provisioning for SSDs and acoustic management for hard drives. The algorithms used are, however, the trade secret of the individual manufacturers.

compatibility

As a rule, CHS addressing is no longer used today. However, for reasons of compatibility, hard disks still support both addressing methods. In order to achieve compatibility with existing systems (devices, operating systems), a logical 512-byte block size is often simulated, which the controller (the firmware) of the hard disk converts to the physical block size of 4,096 bytes (4 kB, "4k" for short) "Fits". If the system does not align itself to the "4k block size", which is always the case when a system does not know the 4k system, there will inevitably be a loss of performance. For older devices and operating systems but can by manual formatting a memory alignment (in English "4K block size alignment" hereinafter) are obtained. Modern operating systems (since 2010) automatically align partitions and file systems to multiples of 4,096 bytes, even on hard drives with 512-byte blocks. Hard disk manufacturers also refer to 4k block sizes as Advanced Format because the increased block size also increases the data density, which in turn enables larger hard disk capacities.

The mapping of the CHS address to the corresponding LBA address is standardized so that changing the addressing method does not necessarily mean reformatting and new hard disks remain compatible with old computers and operating systems. With CHS addressing, however, a maximum of the first 128 GiB (137 GB) can be accessed and problems arise if a partition is defined beyond this "limit".

When changing from LBA-48 (2 48 ) to LBA-28 (only 2 28 ), however, there is a risk of unintentionally overwriting data if a partition extends beyond the 128 GiB limit and is addressed using LBA-28. The reason for this is that each block is addressed with its number. The next block has the block number of the block before +1. In the case of a partition that exceeds the 28-bit limit (which is always the case, for example, when a> 137 GB hard disk was partitioned on a device with LBA-48 support), the block after block number 268435455 (the largest possible 28-bit block number) does not block number 268,435,456, but block number 0. This effect is integer overflow (or english wrapping ) mentioned. If a file is then currently being read, incorrect data is read and, in the best case scenario, a simple error occurs in the application reading the data, which generates an error message. If, however, a file is currently being written, the system erroneously overwrites the first blocks of the hard disk (usually the boot sector is affected as block 0) and thus irretrievably destroys important data.

Web links

Individual evidence

  1. ^ Andries Brouwer: History of BIOS and IDE limits . In: Large Disk HOWTO . November 1, 2004, accessed February 26, 2013 .
  2. Hard Drive Size Limitations and Barriers . ( page 2 ) The Basics . DEW Associates Corporation, 2003, accessed February 26, 2013 .
  3. SSD over-provisioning with hdparm. In: Thomas Krenn Wiki. Retrieved February 27, 2013 .
  4. Windows 137GB Capacity Barrier . (PDF; 389.5 KiB) 48-bit Logical Block Addressing Support for ATA, Serial ATA or ATAPI Disc Drives, Version 1.0 . Seagate Technology LLC., March 7, 2003, p. 6 , accessed on February 27, 2013 (English): " There is a HIGH RISK OF DATA LOSS if a partition on an ATA drive is greater than 137GB and 48-bit addressing support is not installed. "