30

Linux gives error "GPT PMBR size mismatch will be corrected by w(rite)."

The error message is far from self-explanatory. Does this mean that Linux will (attempt to) resize the GPT partition boundaries if I mount and try to write to the disk? If so... how does it try to do this? Does it know about the issue with 512e / 4k sector size emulation?

Other users experiencing this issue have rewritten the partition table manually with success:

logical sector size changes depending on whether it is attached via USB or direct SATA

but if Linux does it automatically, that would be better (and not prone to user input error). I am on Debian Stretch with the back port 4.17 Linux kernel.

The context, if it matters:

I have an external hard drive that I removed (disk shucking) and connected to an internal SATA motherboard port. However, it is formatted and has data on it from the previous SATA disk controller.

Apparently this has something to do with 512e 4k sector size emulation. The disk reports logical sector size 512 / physical size 4096 bytes.

My data is backed up, of course. I just don't want to have to reformat and then re-write 7TB as that will take quite a while.

Thank you.

2 Answers 2

22

An answer on the Ubuntu Forums helped me:

https://ubuntuforums.org/showthread.php?t=2277232&p=13280872#post13280872

Fdisk used to not work at all on gpt partitioned drives, it just reported that drive was gpt partitioned. Better to use parted, gparted or gdisk. Gdisk has been the command line tool for gpt drives.

Post these:

sudo parted -l

or

sudo parted /dev/sda unit s print

or

sudo gdisk -l /dev/sda
10

I had a similar problem when I moved my SATA disk to a USB adapter. Upon starting fdisk:

GPT PMBR size mismatch (1953525167 != 1953525166) will be corrected by write.
The backup GPT table is corrupt, but the primary appears OK, so that will be used.

Using the w(rite) command does not fix this problem, it only complains there is no space left on device.

I fixed the problem by re-creating my gpt disklabel:

  1. start fdisk
  2. p to display current partitions
  3. g to create a new gpt disklabel
  4. n to add each partition that was previously on this disk. For First sector and Last sector, enter the values outputted by the earlier p command. Do not remove partition signatures.
  5. w

If you keep all the start and end sectors the same, you won't lose data doing this.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .