[TriLUG] how big and where is the GPT

Joseph Mack NA3T jmack at wm7d.net
Sun Jul 27 21:46:52 EDT 2014


On Sat, 26 Jul 2014, Gregory Woodbury wrote:

> To answer the original question: GPT keeps a backup of the tables at the end 
> of the disk as well as at the front.

it would appear so. It must be in the last 8G. I just dd'ed a bunch of zeroes 
onto the disk, every now and then checking if it still had a GPT. With 8G to go, 
it still had a GPT, but when I came back and the dd had finished, the GPT was 
gone.

> When looking at a disk the (U)EFI code looks at the back of the disk first

this is not obvious from the wikipedia page

> and presumes that something has corrupted the front copy if it finds a valid 
> GPT table at the end. There is also a "protective" MBR entry on GPT disks with 
> more GPT stuff along the way.

The GPT is spread throughout the disk, like superblocks?

> Using gptfdisk on the device is the easiest way to wipe the GPT tables.

I don't mind using a tool if I know what it's doing. I had assumed the GPT was 
just a longer version of the MBR and would be overwritten by dd'ing an (MBR 
style) image onto the disk. When it still had the GPT, I saw that my method of 
restoring an image didn't work anymore and that I didn't understand GPT.

> Tell the gdisk program to install a new MBR style disklabel. Then write it. 
> After that, the GPT tables are gone, and our old way of doing things works as 
> expected.

I was hoping just to do a scripted dd. I didn't want to have to go in there by 
hand.

> You can try writing 4Gb at the end of the disk as well, that might get all the 
> cruft gone.

I don't know why the image didn't write over the end of the disk. I will have to 
think about this.

Thanks for the help. I have my immediate problem handled. I can remove the GPT 
by dd'ing zeroes onto the disk.

Joe

-- 
Joseph Mack NA3T EME(B,D), FM05lw North Carolina
jmack (at) wm7d (dot) net - azimuthal equidistant map
generator at http://www.wm7d.net/azproj.shtml
Homepage http://www.austintek.com/ It's GNU/Linux!


More information about the TriLUG mailing list