Hard Drives
Partitions
- Types of partitions: primary, extended, logical
- There can be up to four primary
partitions, or three primary and one extended partitions.
- Extended partitions can be divided into one or more logical partitions.
Bootable partition requirements
- DOS : Primary partition, first drive, first 2 GB of the drive
- Windows 95/98/2000 : Primary partition, first drive, first 8 GB of the drive
- Windows NT : Primary partition, first drive, first 2 GB of the drive
- Linux : Primary or logical partition, any drive, first 8 GB of the drive
Windows and DOS
- Only one primary partition on a drive can be active (visible) at a time; the rest must be hidden.
- Windows and DOS may not be able to run if there's more than one visible primary partition on a drive.
- Favor using Windows- or DOS-specific formatting tools for creating Windows and DOS partitions.
- mkfs.msdos (mkdosfs) cannot set a partition as bootable.
- fdisk by itself cannot adequately create DOS partitions.
- As a general rule, only create more than one primary partition if multiple operating systems need to be installed on that hard drive (multi-booting, with one OS installed per primary partition).
- Designate one of the primary partitions as active and the rest as hidden; the active partition will be used to boot the computer.
- For Windows 2000, disks larger than 137 Gbytes require service pack 3 and the following registry change:
- [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\atapi\Parameters]
- "EnableBigLba"=dword:00000001
- For Windows XP, disks larger than 137
Gbytes
require service pack 1.
Partition types
00 Free space
06 FAT16B (> 32 MB)
0B FAT32
0F Extended X (> 7.8 MB)
16 Hidden FAT16B
1B Hidden FAT32
82 Linux swap
83 Linux ext2
93 Hidden Linux ext2
A5 FreeBSD/386
A6 OpenBSD
A9 NetBSD
Cluster size
Fat32
Fat
- <= 8 GB 4 KB
- <= 16 GB 8 KB
- <= 32 GB 16 KB
- > 32 GB 32 KB
- < 16 MB 1 KB
- < 128 MB 2 KB
- < 256 MB 4 KB
- < 512 MB 8 KB 10%
- < 1024 MB 16 KB 25%
- < 2048 MB 32 KB 40%
Boot records
MBR (Master Boot Record)
- The first physical sector (512 bytes) of a hard drive is the MBR.
- The first 446 bytes of the MBR are an executable bootstrap program.
- The rest of the MBR is a partition table, consisting of a 2-byte header and four 16-byte table entries that define up to four partitions.
PBR (Partition Boot Record)
- When booting the computer, the BIOS runs the bootstrap program for the first hard drive.
- The bootstrap program determines the active primary partition, and then runs the operating system loader program for that partition (found in the first 512-byte sector of the partition).
EBR (Extended Boot Record)
- The first 512-byte sector of a primary partition.
- Contains a program to run the installed OS.
LEBR (Logical Extended Boot Record)
- The first sector of an extended partition.
- Contains a partition table which can have two entries.
- The first entry defines the location of a logical partition, and the second entry points to the next extended partition table.
- If there is no logical partition at the beginning of the extended partition, the first partition table will contain only the link to next extended partition table.
- The first sector of a logical partition
- Similar to a PBR.
Geometry
- Heads: The physical discs in the hard drive, counting each side of a disc separately.
- Cylinders: The circular track on each disc.
- Sectors: The atomic units of storage for each track.
- Cluster: A group of sectors that serve as a single storage unit.
- Sectors are 512 bytes.
- A disk with C cylinders, H heads and S sectors per track has C*H*S sectors in all, and can store C*H*S*512 bytes.
- LBA addressing (large block addressing) (linear notation): used on recent hard drives; 0-based sector number
- CHS addressing (3D notation): used on
very-old hard drives;
cylinder number (0-based), head number (0-based), sector number
(1-based).
Size limitations
- INT13 BIOS interface (old version): uses 24-bit CHS addresses, limited to 1024 cylinders * 256 heads * 63 sectors (8.5 Gbytes).
- Hard drives over 8.4 Gbytes report their geometry as 16383/16/63; the total disk size is found in the LBA capacity field returned by the IDENTIFY DRIVE command.
- Hard drives over 137.4 Gbytes report an
LBA capacity of 0xfffffff
sectors (137.4 Gbytes). the total disk size is found in the new 48-bit
capacity field.
Sources
- http://www.ahuka.com/other/partition.html
- http://pclt.cis.yale.edu/pclt/BOOT/PARTITIO.HTM
- http://programmerworld.net/articles/windows/osboot.php
- http://www.partitionsupport.com/partitionnotes.htm
Parent URL:
category/platform