Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

Thanks.

share|improve this question
up vote 2 down vote accepted

Use the cfdisk command.

cfdisk /dev/sda
share|improve this answer

Try fdisk -l and df -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).

share|improve this answer
    
Your information is wrong, the extended partition is always numbered less than 5, but it doesn't have to be 4. You can also have primary partitions after extended partition. – Jimmy Mar 2 '14 at 15:31

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

share|improve this answer
    
Your information is wrong, the extended partition is always numbered less than 5, but it doesn't have to be 4. You can also have primary partitions after extended partition. – Jimmy Mar 2 '14 at 15:31

cat /proc/partitions

You'll get something like this:

major minor  #blocks  name

   8     0  488386584 sda
   8     1   52436128 sda1
   8     2          1 sda2
   8     5    2104483 sda5
   8     6   20972826 sda6
   8     7   52436128 sda7
   8     8  360434308 sda8
 179     0    3979776 mmcblk0
 179     1    3975680 mmcblk0p1
  • If the partition number (minor) is between 1 and 4, it is either primary or extended. The extended one will have 1 in the #blocks column (above, it's sda2).
  • If the partition number is 5 or higher, it is logical.
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.