I am a big fan of fdisk, and since the output of fdisk is the block size of each partition I had to find a way to know how much each partition’s size in GB.

Do the regular fdisk command, and note the block size:

# fdisk -l /dev/sda output omitted Device Boot Start End Blocks Id System /dev/xvdc1 * 1 2871 23061276 83 Linux output omitted

Then using bc (An arbitrary precision calculator language) do:

# echo “23061276/(2^20)” | bc 21

Which will output the partition size in GB