On Fri, Aug 14, 2020 at 10:31:36AM +0200, Thomas Lange wrote: > >>>>> On Fri, 14 Aug 2020 09:45:43 +0200, Bastian Blank <[email protected]> > >>>>> said: > > > Yes. GPT got a copy of it's header at the beginning and the end. You > > can expand the whole thing and the tools will relocate the header on the > > end correctly, but you can't shorten it. > After shorten the image or partition, you can recover the backup of > the GPT table from the main GPT for e.g. using gparted or gdisk. > > https://wiki.archlinux.org/index.php/GPT_fdisk#Recover_GPT_header
Thanks - didn't know about gdisk before. This will load the primary GPT header, recreate the secondary at the end of the disk, and fix the PMBR: /sbin/gdisk disk.raw <<EOF r d x e w y EOF The filesystem is still broken - somehow the partition ends up too short. I don't follow the calculations though. Ross
