[GTALUG] MBR and GTP Drives

Scott Sullivan scott at ss.org
Tue Oct 10 23:41:01 EDT 2017


On 10/10/17 11:33 AM, Lennart Sorensen wrote:
> On Mon, Oct 09, 2017 at 10:53:13AM -0400, Scott Sullivan via talk wrote:
>> I've developed a habit of zeroing the area where the two partition tables
>> may live. Then letting my system boot normally, the install will offer to
>> partition the disk appropriately for the type of disk, and manner in which
>> we booted (UEFI vs MBR).
>>
>> dd bs=1M count=5 if=/dev/zero of=/dev/sdX
>> \  \     \       \            \- Your disk.
>>   \  \     \       \- A special device file that is infinite zeros
>>    \  \     \ 5 blocks worth from 'if', number is larger then needs to be
>>     \  \ Copy in block sizes of 1 megabyte
>>      \ 'Convert and Copy'
> 
> Remember the GPT is at the start AND end of the disk.  You have to wipe
> both or the second copy of the GPT may bite you later.
> 

Wat?! ((*runs to wikipedia*))... Okay then.

I wonder under what conditions that secondary table is used. I've never 
had a front wiped disk continue to report a table afterwards. I see it 
mentions CRC checks, so maybe only when there is corporation in first 
table? A question for source code reading on another day.

Anyways I haven't had to pull this sucker out in a few years...

dd if=/dev/zero of=$YOUR_DEV bs=512 seek=$(( $(blockdev --getsz 
$YOUR_DEV) - 34 )) count=34 #adjust bs=4K for advanced format disks.

Mostly only needed it for drives with dmraid, which stores it's config 
at the end of disks. Usually found on drives pulled from enterprise HP 
or DELL servers and/or the odd workstation.

Thankfully in most cases, I'm installing a new GPT partition tables, so 
it would be reasonable assumption the backup would be over written.

-- 
Scott Sullivan


More information about the talk mailing list