1

sfdisk (version 2.23.2) on CentOS 7.6 is not showing the correct partition information about a disk:

Disk /dev/sdb: 15566 cylinders, 255 heads, 63 sectors/track
Units: cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

Device Boot Start     End   #cyls    #blocks   Id  System
/dev/sdb1   *      0+  15566-  15567- 125034839+  ee  GPT .
sfdisk:         start: (c,h,s) expected (0,0,2) found (0,0,1)

/dev/sdb2          0       -       0          0    0  Empty
/dev/sdb3          0       -       0          0    0  Empty
/dev/sdb4          0       -       0          0    0  Empty

When I run fdisk it returns the correct (but different information):

Disk /dev/sdb: 128.0 GB, 128035676160 bytes, 250069680 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: gpt
#         Start          End    Size  Type            Name
 1         2048         4095      1M  BIOS boot       
 2         4096      1028095    500M  Linux RAID      
 3      1028096      1437695    200M  Linux RAID      
 4      1437696    250068991  118.6G  Linux RAID 

Anyone know what the cause (and hopefully solution) of this is?

  • 1
    For GPT-labelled disks, sfdisk needs to be 2.26 or newer. unix.stackexchange.com/questions/12986/… – Mark Plotnick Aug 2 at 3:07
  • 1
    maybe you can try sgdisk. – Skaperen Aug 2 at 4:34
  • I call it a quality defect that the latest version of CentOS in 2019 ships a version of fdisk that doesn't support GPT disks. – Johan Myréen Aug 2 at 5:52
  • It isn't so much that it fails - but that it lies. If it just bombed out it would be easier to understand. – dwagon Aug 2 at 8:40
  • GPT is the one that's lying. GPT here is providing a Protective MBR. It has a single partition of type ee and a range that spans the entire disk. It's there just to indicate the disk isn't empty. sfdisk is reporting what it sees in the MBR as accurately as it can. – Mark Plotnick Aug 3 at 1:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.