[ltp] True size of a hard disk?
Vivek
linux-thinkpad@linux-thinkpad.org
Thu, 6 Feb 2003 14:34:30 +0000 (GMT)
On Thu, 6 Feb 2003, Angel de Vicente wrote:
> Does anybody know how can I find the true size of my HD irrespective of how
> many partitions / operating systems / etc. I have?
check /var/log/dmesg (or the output of dmesg just after booting),
you may well have lines like this:
hda: QUANTUM FIREBALLlct15 07, ATA DISK drive
hdc: TOSHIBA CD-ROM XM-6702B, ATAPI CD/DVD-ROM drive
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
ide1 at 0x170-0x177,0x376 on irq 15
hda: 14668290 sectors (7510 MB) w/418KiB Cache, CHS=913/255/63, UDMA(66)
hdc: ATAPI 48X CD-ROM drive, 128kB Cache, UDMA(33)
which will tell you want to know. Also, fdisk -l will give the info you
want (remember not to count any partitions with a number higher than the
'Extended partition'), eg:
vivek@arachne:~$ sudo fdisk -l
Disk /dev/hda: 255 heads, 63 sectors, 913 cylinders
Units = cylinders of 16065 * 512 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 16 128488+ 83 Linux
/dev/hda2 17 47 249007+ 83 Linux
/dev/hda3 48 296 2000092+ 83 Linux
/dev/hda4 297 913 4956052+ 5 Extended
/dev/hda5 297 545 2000061 83 Linux
/dev/hda6 546 577 257008+ 82 Linux swap
/dev/hda7 578 609 257008+ 83 Linux
/dev/hda8 610 913 2441848+ 83 Linux
The size is 128488 + 249007 + 2000092 + 4956052 = 7333639 Kb
= 7161 Mb.
[ Note that the two size numbers don't match up precisely:
This is pretty normal, and not something to worry about ]