[Bug 222425] GPT broken after "gpart backup ada0 | gpart restore -F ada1"

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Thu Sep 21 14:23:09 UTC 2017


--- Comment #1 from Andrey V. Elsukov <ae at FreeBSD.org> ---
(In reply to chris from comment #0)
> There is a problem with the MBR after running "gpart backup ada0 | gpart
> restore -F ada1" and because of this it's not possible to boot using this
> disk.
> This issue happens only with FreeBSD 11.1 and maybe 11.0. It doesn't happen
> with 10.3.

In the forum you told that you changed the hardware, so I'm not sure that this
statement is fully correct. You need to check that 10.3 works on the same
hardware, because this can be just  BIOS issue or something like.

> How to reproduce the issue:
> gpart backup ada0 | gpart restore -F ada1
> gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 ada1
> Then boot using ada1 I see:
> gptboot: invalid primary GPT header
> gptboot: invalid backup GPT header
> gptboot: unable to load GPT

There were no changes in the gpart(8), but boot code was changed.
Did you try to swap disks? I.e. connect ada0 that works to the place of ada1?
Does it still work? Does ada1 connected to the port of ada0 works?

> The only workaround is copying the MBR from ada0 to ada1:
> gpart backup ada0 | gpart restore -F ada1

This should create on the ada1 similar to ada0 partition table, what if you try
to do `true > ada1` after that? This command will invoke "GEOM retaste", and if
GPT is invalid at this time, this means that something wrong happens and table
was not written to the disk. If GPT is valid, this means that something wrong
happens after reboot. 

Also, if you reboot from ada0 and partition tables from both disks will be
detected correctly, this means that something wrong with bootcode/BIOS.

You are receiving this mail because:
You are the assignee for the bug.

More information about the freebsd-bugs mailing list