Howto Find Out or Learn Harddisk Size in Linux or UNIX

byVivek GiteonAugust 8, 2006

How do I find out my installed hard disk size in Linux or UNIX like operating systems? Under Linux and UNIX operating systems you can use the df command. The df command displays the amount of disk space available on the file system containing each file name argument. If no file name is given, the space available on all currently mounted file systems is shown.

Task: Display Hard Disk Partition Size in Mega bytes or GB or TB

Task: Display TOTAL Hard Disk Size

The fdisk command is partition table manipulator for Linux. But it can be used to display total hard disk size. You must type the following command as the root user:# fdisk -l | grep Disk Sample outputs:

Our vendor has finished installing redhat OS on our servers & has submitted an installation report. When I verify the file system using df -h , the sum of the size of the file systems as shown in the output is greater than the actual HDD size allocated to that virtual machine. But when I use fdisk -l|grep Disk, the size shown in output matches with the hdd size. Can you please help me out as to how do I verify the file system ??

My aim is to match the HDD size allocated to particular Virtual machine with the total size all file systems on that VM.