GPT PMBR size mismatch after dd clone

I am migrating my Ubuntu EFI boot system to a larger hdd. I used the command

dd if=/dev/sdb of=/dev/sda

I did not dismount the input file before copying and the output file was fresh unpartitioned space. I have successfully booted from the new larger hdd.

  • fdisk -l reports:

    GPT PMBR size mismatch

  • gdisk reports the old drive size (200GB) and

  • PMBR is reporting the new hard drive size (2TB).

The error states gdisk w (write) command will work, however gdisk help recommends command xe (relocate backup to end of disk).

My goal is to remove the old drive and use the new drive as a primary boot disk with my old grub install intact.

Shall I just go ahead an expand the partitions or should I use one of these commands?


Solution 1:

Do as the gdisk prompt suggests: Use the e option on the experts' (x) menu to relocate the data structures to the end of the disk. You can accomplish the same thing in parted or GParted if you prefer. IIRC, they do it semi-automatically, although they ask for confirmation.

Once you've moved the GPT backup data structures, you can resize your partition(s) using GParted.

Solution 2:

I want to post an expanded explanation of my trials and error for those trying the same since documentation is rather fragmented and points to several different techniques. I wound up using gparted from a live usb. I removed the partitions and rewrote the partition table on the new drive. Gparted has a step sequencer: it copied the partition structure of the old disk, and meanwhile also resized the partitions and copied data for the new disk. It did everything while I slept. Using dd also required a manual update of fstab file which I skipped. I then tried ddrescue (from the Universe package via Synaptic, not Software Center) from live usb which reported it did not work with gpt. It referred me to gparted.