How do I view my partitions if they are primary or secondary in Linux CentOS? I tried df -T
but it does not show if partitions are primary or secondary.
How do I view my partitions if they are primary or secondary in Linux CentOS? I tried df -T
but it does not show if partitions are primary or secondary.
Use this command:
sudo parted /dev/sda
followed byprint
. It outputs:You can check if the partition is primary or extended from this. Hope this helps!
Use the
cfdisk
command.Try
fdisk -l
anddf -T
and align the devices fdisk reports to the devices df reports. A standard MBR disk can contain only 4 primary partitions or 3 primary and 1 extended. If you have partitions numbered >= 5 they are logical partitions (with the extended partition hosting them being always number 4 i.e. /dev/sda4).Use "
fdisk -l
", but look at the "Start"/"End" sectors instead of sdan numbers. If there is any overlap between Devices, there are extended/logical partitions.Here is an abstraction for MBR scheme. Be aware the sda2 starts from 1001470 and ends at 1000214527, covering the following 4 partitions range. It's identified as Extended partition and sda5 ~ sda8 are logical partitions.
Here is an example of GPT partition scheme. There are all Primary partitions. No Extended partition.
These are from Ubuntu machines.
What are the names of the partitions? primary partitions are numbered 1 to 4, for example: sda1, hdb2, etc...
Whereas logical partitions are numbered 5 and above.
The primary extended partition is always numbered 4.
Check link for info
cat /proc/partitions
You'll get something like this:
minor
) is between 1 and 4, it is either primary or extended. The extended one will have1
in the#blocks
column (above, it'ssda2
).