# 20200918_bug1879690-investigation
##### ON FRESH RHCOS INSTALL TO CLEAN DISK ####
$ sudo sfdisk -d /dev/sda
GPT PMBR size mismatch (7049215 != 41943039) will be corrected by write.
The backup GPT table is not on the end of the device. This problem will be corrected by write.
label: gpt
label-id: 00000000-0000-4000-A000-000000000001
device: /dev/sda
unit: sectors
first-lba: 34
last-lba: 41943006
/dev/sda1 : start= 2048, size= 786432, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=5672C5F1-9E20-4106-9A65-CBC20E0EB1D8, name="boot"
/dev/sda2 : start= 788480, size= 260096, type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B, uuid=8351D246-CC68-4900-A125-4F73750990BB, name="EFI-SYSTEM"
/dev/sda3 : start= 1048576, size= 2048, type=21686148-6449-6E6F-744E-656564454649, uuid=B829BFE2-2ED0-40DC-BEEA-8D32FB568130, name="BIOS-BOOT"
/dev/sda4 : start= 1050624, size= 5998559, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=708F2A5F-79E4-47AA-AD9F-B97EBFE771C6, name="luks_root"
##### ON RHEL 7.7 ######
[root@localhost ~]# sfdisk -d /dev/sda
# partition table of /dev/sda
unit: sectors
/dev/sda1 : start= 1, size=629145599, Id=ee, bootable
/dev/sda2 : start= 0, size= 0, Id= 0
/dev/sda3 : start= 0, size= 0, Id= 0
/dev/sda4 : start= 0, size= 0, Id= 0
[root@localhost ~]# blkid
/dev/sda4: LABEL="root" UUID="e79d1df9-1322-408a-a3ec-f259eb1b984d" TYPE="xfs" PARTUUID="353ee42d-152c-4a45-b0ed-5244d0c5041a"
/dev/sda1: SEC_TYPE="msdos" UUID="2A17-C566" TYPE="vfat" PARTUUID="539f5f13-0064-4e6a-bbed-ef01703fc60b"
/dev/sda2: UUID="5493381c-7d6b-4156-87e4-0ed087adde09" TYPE="ext3" PARTUUID="44628fa7-ad85-4598-8885-833e13341b6e"
/dev/sda3: PARTUUID="5af26910-de85-48b7-bbcd-dd8f49b05f9e"
/dev/sda5: LABEL="datastore" UUID="3c7c7b47-3ebf-4e7c-961b-bf0466a910e1" TYPE="xfs" PARTUUID="2a7fffd1-21d5-4490-98c5-2f220bc9695f"
##### ON RAW RHCOS METAL DISK FILE #####
$ sgdisk -p rhcos-4.6.0-0.nightly-2020-09-10-195619-x86_64-metal.x86_64.raw
Disk rhcos-4.6.0-0.nightly-2020-09-10-195619-x86_64-metal.x86_64.raw: 7049216 sectors, 3.4 GiB
Sector size (logical): 512 bytes
Disk identifier (GUID): 00000000-0000-4000-A000-000000000001
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 7049182
Partitions will be aligned on 2048-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)
Number Start (sector) End (sector) Size Code Name
1 2048 788479 384.0 MiB 8300 boot
2 788480 1048575 127.0 MiB EF00 EFI-SYSTEM
3 1048576 1050623 1024.0 KiB EF02 BIOS-BOOT
4 1050624 7049182 2.9 GiB 8300 luks_root
$ sfdisk -d rhcos-4.6.0-0.nightly-2020-09-10-195619-x86_64-metal.x86_64.raw
label: gpt
label-id: 00000000-0000-4000-A000-000000000001
device: rhcos-4.6.0-0.nightly-2020-09-10-195619-x86_64-metal.x86_64.raw
unit: sectors
first-lba: 34
last-lba: 7049182
sector-size: 512
rhcos-4.6.0-0.nightly-2020-09-10-195619-x86_64-metal.x86_64.raw1 : start= 2048, size= 786432, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=5672C5F1-9E20-4106-9A65-CBC20E0EB1D8, name="boot"
rhcos-4.6.0-0.nightly-2020-09-10-195619-x86_64-metal.x86_64.raw2 : start= 788480, size= 260096, type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B, uuid=8351D246-CC68-4900-A125-4F73750990BB, name="EFI-SYSTEM"
rhcos-4.6.0-0.nightly-2020-09-10-195619-x86_64-metal.x86_64.raw3 : start= 1048576, size= 2048, type=21686148-6449-6E6F-744E-656564454649, uuid=B829BFE2-2ED0-40DC-BEEA-8D32FB568130, name="BIOS-BOOT"
rhcos-4.6.0-0.nightly-2020-09-10-195619-x86_64-metal.x86_64.raw4 : start= 1050624, size= 5998559, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=708F2A5F-79E4-47AA-AD9F-B97EBFE771C6, name="luks_root"
##### ON RHCOS BEFORE INSTALL #####
[core@localhost ~]$ sudo sfdisk -d /dev/sda
label: gpt
label-id: 3144BD5C-9337-41E5-9151-F20BA0DE9096
device: /dev/sda
unit: sectors
first-lba: 34
last-lba: 629145566
/dev/sda1 : start= 2048, size= 1048576, type=EBD0A0A2-B9E5-4433-87C0-68B6B72699C7, uuid=4CD40E7F-DFCB-4D31-B486-7D3E72EBB2BE
/dev/sda2 : start= 1050624, size= 1048576, type=EBD0A0A2-B9E5-4433-87C0-68B6B72699C7, uuid=C43217E6-B94A-4579-8F14-5B9BF083DD4D
/dev/sda3 : start= 2099200, size= 4096, type=21686148-6449-6E6F-744E-656564454649, uuid=9ED30A12-190E-4AE6-9CB0-AFFF1F84C970
/dev/sda4 : start= 2103296, size= 246169600, type=EBD0A0A2-B9E5-4433-87C0-68B6B72699C7, uuid=C3B43C87-9C64-457F-91A9-ABB52292AE06
/dev/sda5 : start= 248272896, size= 380872671, type=EBD0A0A2-B9E5-4433-87C0-68B6B72699C7, uuid=650D91F0-1D56-46E8-87A0-025522D15502
[core@localhost ~]$ sudo sgdisk -p /dev/sda
Disk /dev/sda: 629145600 sectors, 300.0 GiB
Model: QEMU HARDDISK
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): 3144BD5C-9337-41E5-9151-F20BA0DE9096
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 629145566
Partitions will be aligned on 2048-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)
Number Start (sector) End (sector) Size Code Name
1 2048 1050623 512.0 MiB 0700
2 1050624 2099199 512.0 MiB 0700
3 2099200 2103295 2.0 MiB EF02
4 2103296 248272895 117.4 GiB 0700
5 248272896 629145566 181.6 GiB 0700
##### ON RHCOS AFTER INSTALL BEFORE BOOT ####
[core@localhost ~]$ sudo sfdisk -d /dev/sda
label: gpt
label-id: 00000000-0000-4000-A000-000000000001
device: /dev/sda
unit: sectors
first-lba: 34
last-lba: 629145566
/dev/sda1 : start= 2048, size= 786432, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=5672C5F1-9E20-4106-9A65-CBC20E0EB1D8, name="boot"
/dev/sda2 : start= 788480, size= 260096, type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B, uuid=8351D246-CC68-4900-A125-4F73750990BB, name="EFI-SYSTEM"
/dev/sda3 : start= 1048576, size= 2048, type=21686148-6449-6E6F-744E-656564454649, uuid=B829BFE2-2ED0-40DC-BEEA-8D32FB568130, name="BIOS-BOOT"
/dev/sda4 : start= 1050624, size= 5998559, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=708F2A5F-79E4-47AA-AD9F-B97EBFE771C6, name="luks_root"
/dev/sda5 : start= 248272896, size= 380872671, type=EBD0A0A2-B9E5-4433-87C0-68B6B72699C7, uuid=650D91F0-1D56-46E8-87A0-025522D15502
[core@localhost ~]$
[core@localhost ~]$
[core@localhost ~]$ sudo sgdisk -p /dev/sda
Disk /dev/sda: 629145600 sectors, 300.0 GiB
Model: QEMU HARDDISK
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): 00000000-0000-4000-A000-000000000001
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 629145566
Partitions will be aligned on 2048-sector boundaries
Total free space is 241225727 sectors (115.0 GiB)
Number Start (sector) End (sector) Size Code Name
1 2048 788479 384.0 MiB 8300 boot
2 788480 1048575 127.0 MiB EF00 EFI-SYSTEM
3 1048576 1050623 1024.0 KiB EF02 BIOS-BOOT
4 1050624 7049182 2.9 GiB 8300 luks_root
5 248272896 629145566 181.6 GiB 0700
#### ON RHCOS AFTER INSTALL AFTER BOOT #####
Doesn't boot (that's the bug)
If you run this command to rewrite the first 512 then it works:
```
zcat ./rhcos-4.6.0-0.nightly-2020-09-10-195619-x86_64-metal.x86_64.raw.gz | dd bs=512 count=1 of=/dev/sda status=progress
```