📚 LinuxDocs
Topics:
All Pages8021X HOWTOACP ModemACPI HOWTOADSL Bandwidth Man..ATA RAID HOWTOATM Linux HOWTOAX25 HOWTOAccessibility Dev ..Accessibility HOWTOAdv Bash Scr HOWTOAdv Routing HOWTOAntares RAID sparc..Apache Compile HOWTOApache WebDAV LDAP..Assembly HOWTOAstronomy HOWTOAthlon Powersaving..Authentication Gat..Autodir HOWTOAviation HOWTOAvr Microcontrolle..BRIDGE STP HOWTOBTTVBackspaceDeleteBandwidth Limiting..Bangla HOWTOBash Prompt HOWTOBattery PoweredBelarusian HOWTOBelgian HOWTOBeowulf HOWTOBocaBogoMipsBootdisk HOWTOBridgeC++ dlopenC C++Beautifier HO..C editing with VIM..CDROM HOWTOCDServer HOWTOCable ModemCaudium HOWTOClone HOWTOCompaq Remote Insi..Compaq T1500 HOWTOConexant+Rockwell ..Cryptoloop HOWTODB2 HOWTODHCPDSL HOWTODVD Playback HOWTODebian Binary Pack..Debian JigdoDebian and Windows..Disk Encryption HO..Disk on Chip HOWTODocBook Demystific..DocBook InstallDocBook OpenJade S..Ecology HOWTOEmacspeak HOWTOEncourage Women Li..Encrypted Root Fil..Euro Char SupportEvent HOWTOFedora Multimedia ..Finnish HOWTOFirewall PiercingFlash Memory HOWTOFont HOWTOFramebuffer HOWTOGCC HOWTOGIS GRASSGlibc Install HOWTOHOWTO HOWTOHOWTO INDEXHP HOWTOHandspring VisorHard Disk UpgradeHardware HOWTOHighQuality Apps H..Home Electrical Co..IBM7248 HOWTOIO Perf HOWTOIP AliasIP Masquerade HOWTOIRCImplement Sys Call..Indic Fonts HOWTOInfrared HOWTOIngresII HOWTOInstall StrategiesInstallation HOWTOInstallfest HOWTOIntkeybItalian HOWTOJabber Server Farm..JavaStation HOWTOKerberos Infrastru..Kernel HOWTOKerneldKodak Digitalcam H..LDAP HOWTOLDP Reviewer HOWTOLILO crash rescue ..LVM HOWTOLeased LineLegoLinksys Blue Box R..Linux+Win95Linux+Win9x+Grub H..Linux+Windows HOWTOLinux Complete Bac..Linux Crash HOWTOLinux Gamers HOWTOLinux Modem SharingLinux Promise RAID..Linux i386 Boot Co..LinuxGL QuakeWorld..Lotus DominoR5MILO HOWTOMMBase Inst HOWTOMP3 CD BurningMail User HOWTOMajordomo MajorCoo..Man PageMasquerading Simpl..Medicine HOWTOMindTerm SSH HOWTOMobile IPv6 HOWTOMock MainframeModule HOWTOModulesMotorola Surfboard..Mozilla OptimizationMulti Distro DevNCURSES Programmin..NFS HOWTONFS Root Client mi..NIS HOWTONetMeeting HOWTONetwork boot HOWTONvidia OpenGL Conf..OLSR IPv6 HOWTOOnline Troubleshoo..Oracle 9i Fedora 3..PA RISC Linux Boot..PCTel MicroModem C..PHP Nuke HOWTOPPP HOWTOPagerPalmOS HOWTOPartitionPartition Mass Sto..Partition Mass Sto..Partition RescuePine ExchangePortSlavePost Installation ..Postfix Cyrus Web ..Pre Installation C..Print2WinPrinting HOWTOProcess AccountingProgram Library HO..Proxy ARP SubnetQmail ClamAV HOWTOQmail VMailMgr Cou..Querying libiptc H..RPM HOWTOReading List HOWTORedHat CD HOWTOReliance HOWTORemote BridgingRemote Serial Cons..SCSI 2.4 HOWTOSCSI Generic HOWTOSLIP PPP EmulatorSRM HOWTOSSL Certificates H..Scanner HOWTOScientific Computi..Scripting GUI TclTkSecure CVS PserverSecure Programs HO..Security HOWTOSecurity Quickstar..Security Quickstar..Serial Laplink HOWTOSerial Programming..Slovak HOWTOSmall MemorySmart Card HOWTOSoftware Proj Mgmt..Software Release P..Sound HOWTOSpam Filtering for..Speech Recognition..SquashFS HOWTOSybase ASA HOWTOSybase ASE HOWTOSybase PHP ApacheTCP Keepalive HOWTOTamil Linux HOWTOTimePrecision HOWTOTimeSys Linux Inst..Token RingTraffic Control HO..Traffic Control tc..UPS HOWTOUnix Hardware Buye..Unix and Internet ..UpgradeUsenet News HOWTOUser Authenticatio..VB6 to TclVMS to Linux HOWTOVPN HOWTOValgrind HOWTOVideoLAN HOWTOVim HOWTOVirtual WebWebcam HOWTOWikiText HOWTOWindows Newsreader..Wireless Link sys ..Wireless Sync HOWTOXDM XtermXDMCP HOWTOXFree Local multi ..XFree86 HOWTOXFree86 R200XFree86 Second MouseXFree86 Video Timi..XML RPC HOWTOXWindow Overview H..XWindow User HOWTOXinerama HOWTOXterminalsHtml singleI810 HOWTOLibdc1394 HOWTOOpenMosix HOWTOPhhttpd HOWTOPpp sshText
Next Previous Contents

3. Disk Access

Disk access is done in units called sectors. In order to read or write something from or to the disk, we have to specify the position on the disk, for example by giving the sector number. If the disk is a SCSI disk, then this sector number goes directly into the SCSI command and is understood by the disk. If the disk is an IDE disk using LBA, then precisely the same holds. But if the disk is old, RLL or MFM or IDE from before the LBA times, then the disk hardware expects a triple (cylinder,head,sector) to designate the desired spot on the disk.

3.1 Cylinders, heads and sectors

A disk has sectors numbered 0, 1, 2, ... This is called LBA addressing.

In ancient times, before the advent of IDE disks, disks had a .:: www.tumblr.com ::. .:: telegra.ph ::. .:: slidehtml5.com ::. geometry described by three constants C, H, S: the number of cylinders, the number of heads, the number of sectors per track. The address of a sector was given by three numbers: c, h, s: the cylinder number (between 0 and C-1), the head number (between 0 and H-1), and the sector number within the track (between 1 and S), where for some mysterious reason c and h count from 0, but s counts from 1. This is called CHS addressing.

No disk manufactured less than ten years ago has a geometry, but this ancient 3D sector addressing is still used by the INT13 BIOS interface (with fantasy numbers C, H, S unrelated to any physical reality).

The correspondence between the linear numbering and this 3D notation is as follows: for a disk with C cylinders, H heads and S sectors/track position (c,h,s) in 3D or CHS notation is the same as position c*H*S + h*S + (s-1) in linear or LBA notation.

Consequently, in order to access a very old non-SCSI disk, we need to know its geometry, that is, the values of C, H and S. (And if you don't know, there is a lot of good information on www.thetechpage.com.)

3.2 Sectorsize

In the present text a sector has 512 bytes. This is almost always true, but for example certain MO disks use a sectorsize of 2048 bytes, and all capacities given below must be multiplied by four. (When using fdisk on such disks, make sure you have version 2.9i or later, and give the `-b 2048' option.)

3.3 Disksize

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. For example, if the disk label says C/H/S=4092/16/63 then the disk has 4092 [Reddit: Keras Discussion] *16*63=4124736 sectors, and can hold 4124736*512=2111864832 bytes (2.11 GB). There is an industry convention to give C/H/S=16383/16/63 for disks larger than 8.4 GB, and the disk size can no longer be read off from the C/H/S values reported by the disk.

3.4 The 1024 cylinder and 8.5 GB limits

The old INT13 BIOS interface to disk I/O uses 24 bits to address a sector: 10 bits for the cylinder, 8 bits for the head, and 6 bits for the sector number within the track (counting from 1). This means that this interface cannot address more than 1024*256*63 sectors, which is 8.5 GB (with 512-byte sectors). And if the (fantasy) geometry specified for the disk has fewer than 1024 cylinders, or 256 heads, or 63 sectors per track, then this limit will be less.

(More precisely: with INT 13, AH selects the function to perform, CH is the low 8 bits of the cylinder number, CL has in bits 7-6 the high two bits of the cylinder number and in bits 5-0 the sector number, DH is the head number, and DL is the drive number (80h or 81h). This explains part of the layout of the partition table.) .:: fyers.in ::. .:: 199win199win.website3.me ::.

This state of affairs was rectified when the so-called Extended INT13 functions were introduced. A modern BIOS has no problems accessing large disks.

(More precisely: DS:SI points at a 16-byte Disk Address Packet that contains an 8-byte starting absolute block number.) .:: febet1art1.storeinfo.jp ::.

Linux does not use the BIOS, so does (and did) not have this problem.

However, this geometry stuff plays a role in the interpretation of partition tables, so if Linux shares a disk with for example DOS, then it needs to know what geometry DOS will think the disk has. It also plays a role at boot time, where the BIOS has to load a boot loader, and the boot loader has to load the operating system.

3.5 The 137 GB limit

The old ATA standard describes how to address a sector on an IDE disk using 28 bits (8 bits for the sector, 4 for the head, 16 for the cylinder). This means that an IDE disk can have at most 2^28 addressable sectors With 512-byte sectors this is 2^37 bytes, that is, 137.4 GB. [StackOverflow: DynamoDB]

The ATA-6 standard includes a specification how to address past this 2^28 sector boundary. The new standard allows addressing of 2^48 sectors. There is support in recent Linux kernels that have incorporated Andre Hedrick's IDE patch, for example 2.4.18-pre7-ac3 and 2.5.3.

Maxtor sells 160 GB IDE disks since Fall 2001. An old kernel will treat such disks as 137.4 GB disks. .:: groups.google.com ::.


Next Previous Contents

Share or Research:

Share on FB Post to X LinkedIn 🤖 Ask AI about this