You can also manipulate your hard drive partitions from the command line (or within scripts) using the sfdisk command. As an example to list all the partitions on your system, type the following:
# sfdisk -l
The resulting output displays onscreen:
/dev/sda1 0+ 15 16- 128488+ 82 Linux swap /dev/sda2 * 16 260 245 1967962+ 83 Linux native /dev/sda3 0 - 0 0 0 Empty /dev/sda4 0 - 0 0 0 Empty
If you ever need the size of a partition you can use sfdisk with the -s option followed by the partition. If you don't give it a partition name, it will tell you the size of all the partitions.
# sfdisk -s /dev/hda: 6342840 total: 6342840 blocks
sfdisk can also be used to make changes to the partition table ...