Click to See Complete Forum and Search --> : How to Determine Hard Drive Size


3Wheels
02-26-2001, 06:08 PM
I've got a RH 7.0 system with two hard drives (hda and hdb), and need to determine their size. The numbers from df, fdisk, and printed on the drives in Cyls/Heads/Sectors don't seem to add up. What's the best way to determine hard drive capacity?
TIA

HedCheez
02-26-2001, 07:16 PM
On boot you should be able to access your bios (should say hit DEL, or F1 etc for setup). In your bios there will be an area for you HD's. Check there for the size. HDA will be the primary master and HDB will be the secondary master or the secondary master. Hope this helps.

HedCheez
02-26-2001, 07:17 PM
Opps. Made a typo. HDB will be the primary slave or the secondary master (most likely).

Ryeker
02-26-2001, 07:29 PM
The best way is to look on the hard drive itself. There is normally a label.

Why doesn't fdisk work?

HDB is primary slave. Also, the BIOS is not the best way to determine the size of a hard drive because some BIOSes don't see/interpret sizes correctly after the 1024th cylinder. The BIOS may only see 2GB, but Linux doesn't use the BIOS and can use up the entire drive.

bdg1983
02-26-2001, 08:32 PM
2gb??? i think youll find , my ill-informed friend, that 1024 cylinders is around the 8 gb mark, so back up this claim this claim about 2gb relating to 1024?

come on

3Wheels
02-27-2001, 09:29 AM
Let me add some detail that might clarify:

1) The size of /dev/hdb is known.
The size is printed on the drive itself as 2113MB.
Also on the drive is printed 4095 Cyl, 16 Head, 63 Sectors.
Note that this number is different from the bios numbers: 1023 Cyl, 64 Head, 63 Sectors.
Also, the bios has a slightly different size of 2111MB.
df -h shows /dev/hdb1 as 1.9G, not 2.1G.
fdisk /dev/hdb shows (same as the bios but different than stamped on the drive) 1023 Cyl, 64 Head, 63 Sectors. It also shows:
Units=Cylinders of 4032*512 bytes
/dev/hdb1 1 (start) 990 (end) 1995808+ (blocks) Linux (System).

Why doesn't the C/H/S info stamped on the drive match the bios and fdisk?
Why is Linux only showing 1.9GB instead of 2.1?
Why is the BIOS showing 2111MB instead of the 2113MB stamped on the drive?
Is there a formula to give you the size using the C/H/S information?

2) The size of the primary drive is not stamped on the drive itself (common with older non-name brand drives). I'd like to determine its size, but I'm not sure what numbers to use, given that the numbers in (1) above, don't match - for a drive where I do know the size.

Drive shows 2112C, 16H, 63S
BIOS shows 528C, 64H, 63S and size 1089
fdisk shows 528C,64H, 63S
/dev/hda1 1 (start) 9 (end) 18112+ (blocks) Linux (system)
/dev/hda2 10 182 348768 Extended
/dev/hda4 183 528 697536 "QnX4.x 3rd Part"
/dev/hda5 10 42 66496 Linux Swap
df -h shows /dev/hda1 17M

So the fifty thousand dollar question is, what's the capacity/size of /dev/hda?
TIA

bdg1983
02-27-2001, 10:39 AM
wel, remembering that there are 1024mb in a GB yes? then you have
2.06 gb

i suggest that the 200mb or so that linux is out from this might have something to do with the filesystem, and/or inode allocation

i dont really know too much about this stuff and this is just a guess.