[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: fdisk is limited to 8GB
Cindy <cindy@willowglen.com.my> writes:
> Hi,
>
> I have a 10GB IDE harddisk on I386, and installation CD(2.4)/floppy(2.5)
> only recognized the first 16450560 sectors, which equals to 1024*63*255.
>
> I had a look at the source code of fdisk, it is getting the disklabel from
> bios, so this number makes sense. However, while booting, the hardware
> detects the following about the hard disk:
>
> wd0: 9787MB, 16383 cyl, 16 head, 63 sec, 512 bytes/sec, 20044080 sec total
>
> 16383*16*63 == 16514064 != 20044080
> 19885*16*63 == 20044080
The short answer: ignore the cylinders, head, sec info. The total sectors
in the right number.
The long answer: IDE has two modes for addressing locations on disk:
CHS (Cylinder, heads, sectors) and LBA (logical block address). IDE
CHS mode is limited to 16383 cylinder, 16 heads, and 63/64 sectors -
thus only 8GB of an IDE drive are accessible via CHS. IDE drives still
return CHS info, though, so that older BIOSes and OSes can use them.
LBA numbers the sectors on the drive from 0 up to n-1. IDE LBA mode has
28 bits, which means that it can address up to 137GB of hard disk space.
> And 19885 is the cylinders number in the bios! If the hardware detecting
> cannot read cylinder correctly, it is weird that it can get total sectors
> correctly.
This is a fake number calculated by the BIOS; it is never returned by
the drive. I don't think this number is useful for anything.
The labelling process for large drive definitely needs to be
simplified. I'll take a look at it soon.
-Costa