Skip to content
This repository has been archived by the owner on Dec 4, 2020. It is now read-only.

Dual boot: TrueOS (and Trident) both corrupt the GPT header at boot time (versions 17.12, 18.03, 18.12+) #1541

Open
allentiak opened this issue Mar 21, 2018 · 16 comments

Comments

@allentiak
Copy link

allentiak commented Mar 21, 2018

Hi,
Possible duplicate of #15...

Below there is a copy of my comment on that bug.
#15 (comment)


I am having similar symptoms on a Dell Precision M3800 when trying to reboot with Debian testing...
The partition table (GPT+UEFI) "disappears", somehow.

This happens either:

  1. after (successfully) finishing the installation (see https://www.trueos.org/handbook/install.html#installation-finished).
  2. (if I restore the partitions afterwards), after each time I boot into TrueOS.

Affected TrueOS versions: 17.12 (stable), 2017.12.30 (unstable).
The computer already has Debian testing installed.

BTW: Once I restore the partitions, rEFInd works fine.

This problem only happens after booting into TrueOS. As long as I don't access it, I can use Debian normally.

@kmoore134 (or someone else) Could you please elaborate on how could I open a terminal during install, or on how to log the install process, so I could provide with proper logs, please? I haven't found the relevant info in the TrueOS handbook, and [Alt+{F1-F4}] does not work...

@digitalist
Copy link

I once managed to ctrl+c out of installer, but it seems it was pure luck or very fast fingers - it didn't reboot

Maybe we should add a patch to allow quit to console without autoreboot?

@allentiak
Copy link
Author

allentiak commented Apr 8, 2018

I found a workaround to the problem: to restore the GPT partition table backup.

I have just discovered what was wrong: the installer somehow corrupts the GPT table.
After the installer reboots the machine for the first time, it renders the disk unbootable.

After restoring the GPT partition table backup, I can boot normally into Debian (not into TrueOS, though; each time I do it triggers the bug again).

As this bug happens on every reboot, it renders TrueOS unusable.
Present in both TrueOS 17.12 and 18.03.

Below is the log of what I did.

Partition List:
p1: EFI
p2: ext4 (root)
p3: Linux-swap
p4: ext4 (home)
p5: ZFS
p6: ZFS-swap

root@sysresccd /root % gdisk 
GPT fdisk (gdisk) version 1.0.1

Type device filename, or press <Enter> to exit: 
root@sysresccd /root % gdisk /dev/sda
GPT fdisk (gdisk) version 1.0.1

Caution: invalid main GPT header, but valid backup; regenerating main header
from backup!

Caution! After loading partitions, the CRC doesn't check out!
Warning! Main partition table CRC mismatch! Loaded backup partition table
instead of main partition table!

Warning! One or more CRCs don't match. You should repair the disk!

Partition table scan:
  MBR: not present
  BSD: not present
  APM: not present
  GPT: damaged

Found invalid MBR and corrupt GPT. What do you want to do? (Using the
GPT MAY permit recovery of GPT data.)
 1 - Use current GPT
 2 - Create blank GPT

Your answer: 1

Command (? for help): p
Disk /dev/sda: 1000215216 sectors, 476.9 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): BAF22793-BCD9-8349-A200-0C0773CF380B
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 1000215182
Partitions will be aligned on 2048-sector boundaries
Total free space is 238189 sectors (116.3 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048         1026047   500.0 MiB   EF00  
   2         1026048        98682879   46.6 GiB    8301  
   3        98682880       161183743   29.8 GiB    8200  
   4       161183744       897814527   351.3 GiB   8301  
   5       897814528       966187007   32.6 GiB    A504  
   6       966187008       999979007   16.1 GiB    A502  

Command (? for help): w

Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!

Do you want to proceed? (Y/N): Y
OK; writing new GUID partition table (GPT) to /dev/sda.
The operation has completed successfully.
root@sysresccd /root % gdisk /dev/sda
GPT fdisk (gdisk) version 1.0.1

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): p
Disk /dev/sda: 1000215216 sectors, 476.9 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): BAF22793-BCD9-8349-A200-0C0773CF380B
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 1000215182
Partitions will be aligned on 2048-sector boundaries
Total free space is 238189 sectors (116.3 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048         1026047   500.0 MiB   EF00  
   2         1026048        98682879   46.6 GiB    8301  
   3        98682880       161183743   29.8 GiB    8200  
   4       161183744       897814527   351.3 GiB   8301  
   5       897814528       966187007   32.6 GiB    A504  
   6       966187008       999979007   16.1 GiB    A502  

Command (? for help): q

@allentiak allentiak changed the title TrueOS not bootable after successful install on Dell Precision M3800 (versions 17.12 and 2017.12.30) TrueOS corrupts the GPT partition table (versions 17.12 and 18.3) Apr 8, 2018
@allentiak allentiak changed the title TrueOS corrupts the GPT partition table (versions 17.12 and 18.3) TrueOS Installer corrupts the GPT partition table (versions 17.12 and 18.3) Apr 8, 2018
@allentiak
Copy link
Author

@pkgdemon Could you take a look at this, please?

@pkgdemon
Copy link
Contributor

@allentiak I am not sure I can help here. I don't really have the cycles to test dual boot scenarios, and do not have much expertise in this area. This seems like something we should really look into however, and I will pass this along at the next TrueOS meeting. Have you by chance tried stock FreeBSD to see if the behavior is the same?

@allentiak
Copy link
Author

allentiak commented Jun 19, 2018 via email

@allentiak
Copy link
Author

I've just realized I opened this bug in "trueos-core", and not in "trueos"...
Should I move it there?

@pkgdemon
Copy link
Contributor

@allentiak Keeping the bug here for now is probably best.

@allentiak
Copy link
Author

allentiak commented Jun 22, 2018

On Mon, 18 Jun 2018 at 23:12, Joe Maloney notifications@github.com wrote:

Have you by chance tried stock FreeBSD to see if the behavior is the same?

Not really. But I could try to find the time to give it a try before that meeting, in order to provide the necessary feedback...

@pkgdemon: When is the next TrueOS meeting?

@pkgdemon
Copy link
Contributor

@allentiak We did not meet this week due to others out of office. I believe we will meet next this Friday on 06-29-18.

@allentiak
Copy link
Author

allentiak commented Jun 24, 2018 via email

@pkgdemon
Copy link
Contributor

@allentiak no problem I will keep an eye on this ticket.

@allentiak
Copy link
Author

@pkgdemon Could you please check #1554? I would like to test this with release 18.06...

@allentiak allentiak changed the title TrueOS Installer corrupts the GPT partition table (versions 17.12 and 18.3) TrueOS Installer corrupts the GPT partition table (versions 17.12 and 18.03) Jul 13, 2018
@allentiak
Copy link
Author

allentiak commented Sep 14, 2018

@pkgdemon As #1554 is still open, I only tried this again with Project Trident's Beta 2 (2018.09.06). I can confirm that this bug is still present there.

@ericbsd
Copy link
Member

ericbsd commented Mar 12, 2019

This ghostbsd/pc-sysinstall@ecd8fec was faulty and when I am confident it will not break TrueOS and other projects I will add the code to the TrueOS code.

@allentiak
Copy link
Author

allentiak commented Mar 12, 2019

Hi, Eric! (@ericbsd)

Thanks for your quick reply. Please remember to mention me when you add the code. I would really like to install GhostBSD on a dual boot with Debian.

Best,
Leandro

@allentiak allentiak changed the title TrueOS Installer corrupts the GPT partition table (versions 17.12 and 18.03) Dual boot: TrueOS Installer corrupts the GPT partition table (versions 17.12 and 18.03) May 5, 2019
@allentiak allentiak changed the title Dual boot: TrueOS Installer corrupts the GPT partition table (versions 17.12 and 18.03) Dual boot: TrueOS corrupts the GPT partition table on every boot (versions 17.12, 18.03, 18.12+) Jun 22, 2019
@allentiak
Copy link
Author

This also happens with Trident 19.05

@allentiak allentiak changed the title Dual boot: TrueOS corrupts the GPT partition table on every boot (versions 17.12, 18.03, 18.12+) Dual boot: TrueOS corrupts the GPT header at boot time (versions 17.12, 18.03, 18.12+) Jun 22, 2019
@allentiak allentiak changed the title Dual boot: TrueOS corrupts the GPT header at boot time (versions 17.12, 18.03, 18.12+) Dual boot: TrueOS (and Trident) both corrupt the GPT header at boot time (versions 17.12, 18.03, 18.12+) Jun 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants