How to fix GPT PMBR size mismatch?

Learn the basics of GPT and MBR:

  • Back up every partition (XFS => xfsdump).
  • Enable UEFI Secure Boot in BIOS and disable MBR protection in BIOS. Disable CSM and hybrid mode (UEFI + CSM) in BIOS.
  • Wipe every MBR partition table and create a fresh new GPT partition table.
# cfdisk --zero /dev/sda
=> gpt
  • Fill the new GPT partition table with partitions.
    I recommend cfdisk for all partition table work.
# cfdisk /dev/sda
  • Restore backup (XFS => xfsrestore). Fill the new partitions with data from backup.

Thanks, that makes sense.
Throughout my life, I’ve been inserting disks into computers, connecting them, creating partitions, formatting, and using them.
As you can see, one is never too old to learn :wink:
When I have some free time, I’ll have to reconfigure the drives and we’ll see what happens."

I have an Asrock B250M-HDV motherboard.
I don’t have (can’t find) MBR protection settings in BIOS.

If I enable UEFI Secue Boot - the system doesn’t boot.
If I disable CSM - the computer enters BIOS after starting.

Show the full output. Copy and paste the whole command line including the shell prompt, the full ouput and the subsequent shell prompt.

homeserver:~ # fdisk -l
Disk /dev/sda: 1,82 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: ST2000DM001-1CH1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x0002721a

Device     Boot Start        End    Sectors  Size Id Type
/dev/sda1        2048 3907028991 3907026944  1,8T 83 Linux


Disk /dev/sdb: 7,28 TiB, 8001563222016 bytes, 15628053168 sectors
Disk model: ST8000VN004-3CP1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: B34F9681-10F2-46B2-B967-4F40E335F2F8

Device     Start         End     Sectors  Size Type
/dev/sdb1   2048 15628053134 15628051087  7,3T Linux filesystem


Disk /dev/sde: 111,79 GiB, 120034123776 bytes, 234441648 sectors
Disk model: Crucial_CT120M50
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: C0C2E1D0-737D-4B18-A7DF-10028A29729A

Device         Start       End   Sectors  Size Type
/dev/sde1       2048      6143      4096    2M BIOS boot
/dev/sde2       6144     47103     40960   20M EFI System
/dev/sde3      47104  97753087  97705984 46,6G Linux filesystem
/dev/sde4   97753088 230246399 132493312 63,2G Linux filesystem
/dev/sde5  230246400 234441614   4195215    2G Linux swap


Disk /dev/sdd: 931,51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: TOSHIBA MQ01ABD1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
GPT PMBR size mismatch (3907050239 != 1953525167) will be corrected by write.


Disk /dev/sdc: 931,51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: ST1000LX015-1U71
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x00000000

Device     Boot Start        End    Sectors   Size Id Type
/dev/sdc1           1 1953525167 1953525167 931,5G ee GPT

Partition 1 does not start on physical sector boundary.


Disk /dev/md0: 1,82 TiB, 2000409722880 bytes, 3907050240 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 65536 bytes / 131072 bytes
Disklabel type: gpt
Disk identifier: D222117F-6A70-4A67-A124-8F176BAB11BE

Device     Start        End    Sectors  Size Type
/dev/md0p1  2048 3902708138 3902706091  1,8T Linux filesystem


Disk /dev/nvme0n1: 476,94 GiB, 512110190592 bytes, 1000215216 sectors
Disk model: SPCC M.2 PCIe SSD                       
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 2653C7E2-488F-4F50-B188-7BEF0F45DA40

Device         Start   End Sectors Size Type
/dev/nvme0n1p1    34 32767   32734  16M Microsoft reserved
homeserver:~ # 

I do not see any changes in your disk configuration, so I am not sure why you expected any improvement. Educated guess is that fdisk prints partition table(s) to stdout and error message(s) to stderr and they become interleaved. So, the error is still triggred by the same disk currently enumerated as /dev/sdc which happens to be the first disk of /dev/md0. And partition table of /dev/md0 is also found in the beginning of /dev/sdc.

I configured RAID from scratch (/dev/sdc1 and/ /dev/sdd1).
The problem disappeared. Even on the /dev/sdb drive.

homeserver:/ # fdisk -l 
Disk /dev/sda: 1,82 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: ST2000DM001-1CH1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x0002721a

Device     Boot Start        End    Sectors  Size Id Type
/dev/sda1        2048 3907028991 3907026944  1,8T 83 Linux


Disk /dev/sdb: 7,28 TiB, 8001563222016 bytes, 15628053168 sectors
Disk model: ST8000VN004-3CP1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: B34F9681-10F2-46B2-B967-4F40E335F2F8

Device     Start         End     Sectors  Size Type
/dev/sdb1   2048 15628053134 15628051087  7,3T Linux filesystem


Disk /dev/sdc: 931,51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: ST1000LX015-1U71
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 66D590D9-C3FD-4FA7-9C03-6DBE56437240

Device     Start        End    Sectors   Size Type
/dev/sdc1   2048 1953523711 1953521664 931,5G Linux RAID


Disk /dev/sdd: 931,51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: TOSHIBA MQ01ABD1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 6B2B7B25-8B44-4C5D-A997-21BAB08FA10E

Device     Start        End    Sectors   Size Type
/dev/sdd1   2048 1953523711 1953521664 931,5G Linux RAID


Disk /dev/sde: 111,79 GiB, 120034123776 bytes, 234441648 sectors
Disk model: Crucial_CT120M50
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: C0C2E1D0-737D-4B18-A7DF-10028A29729A

Device         Start       End   Sectors  Size Type
/dev/sde1       2048      6143      4096    2M BIOS boot
/dev/sde2       6144     47103     40960   20M EFI System
/dev/sde3      47104  97753087  97705984 46,6G Linux filesystem
/dev/sde4   97753088 230246399 132493312 63,2G Linux filesystem
/dev/sde5  230246400 234441614   4195215    2G Linux swap


Disk /dev/nvme0n1: 476,94 GiB, 512110190592 bytes, 1000215216 sectors
Disk model: SPCC M.2 PCIe SSD                       
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 2653C7E2-488F-4F50-B188-7BEF0F45DA40

Device         Start   End Sectors Size Type
/dev/nvme0n1p1    34 32767   32734  16M Microsoft reserved


Disk /dev/md0: 1,82 TiB, 2000406052864 bytes, 3907043072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 65536 bytes / 131072 bytes
homeserver:/ # 

homeserver:/ # gdisk -l /dev/sdb
GPT fdisk (gdisk) version 1.0.8

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/sdb: 15628053168 sectors, 7.3 TiB
Model: ST8000VN004-3CP1
Sector size (logical/physical): 512/4096 bytes
Disk identifier (GUID): B34F9681-10F2-46B2-B967-4F40E335F2F8
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 15628053134
Partitions will be aligned on 2048-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048     15628053134   7.3 TiB     8300  
homeserver:/ # gdisk -l /dev/sdc
GPT fdisk (gdisk) version 1.0.8

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/sdc: 1953525168 sectors, 931.5 GiB
Model: ST1000LX015-1U71
Sector size (logical/physical): 512/4096 bytes
Disk identifier (GUID): 66D590D9-C3FD-4FA7-9C03-6DBE56437240
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 2048, last usable sector is 1953525134
Partitions will be aligned on 2048-sector boundaries
Total free space is 1423 sectors (711.5 KiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048      1953523711   931.5 GiB   FD00  
homeserver:/ # gdisk -l /dev/sdd
GPT fdisk (gdisk) version 1.0.8

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/sdd: 1953525168 sectors, 931.5 GiB
Model: TOSHIBA MQ01ABD1
Sector size (logical/physical): 512/4096 bytes
Disk identifier (GUID): 6B2B7B25-8B44-4C5D-A997-21BAB08FA10E
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 2048, last usable sector is 1953525134
Partitions will be aligned on 2048-sector boundaries
Total free space is 1423 sectors (711.5 KiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048      1953523711   931.5 GiB   FD00  
homeserver:/ # 

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.