Check partition information in Linux

To show currently mounted partition in human readable format, use:

df -h

df -h sample output screenshot

Another way to check partition information using parted.

sudo parted /dev/sda print

parted sample output screenshot

Here, we can see that the disk size is 120GB along with the partition information.

To view the list of partitions using fdisk, use:

fdisk -l

To view the list of block devices:


Hope this helps! Cheers 🙂

How to check if a partition is primary in CentOS+Screenshots

This is a guide on how to check if a partition is primary in centos or not? Use the following command:

# parted /dev/sda print

parted /dev/sda print centos


# cfdisk /dev/sda

centos cfdisk sample output

As shown above, the field under “Part Type” would suggest if that partition is Primary/Secondary.

To exit out of the cfdisk menu, use your arrow keys and move the selection to “Quit” and hit Enter in your keyboard.

Source: Link

As always stay Happy! Happy Blogging! 🙂