[arch-general] Single Drive Fresh Install (mbr/grub2) Fails to boot (can boot existing from .iso??)

David C. Rankin drankinatty at suddenlinkmail.com
Sat Dec 31 09:14:32 UTC 2016


On 11/07/2016 11:34 AM, David C. Rankin wrote:
> Simon,
> 
>   Thanks, but no, I eliminated that by choosing the boot options menu
> (e.g. F9) on boot which allowed 30 seconds or so as I pondered the
> options for the drives to spin up, no it is something quirky with this
> laptop that I have to figure out, but I'm totally stuck.
> 
>   I prepared a fresh summary of my ordeal in hopes of getting some
> wisdom to help with this mystery. Here is the summary to date:
> 
>   I need a miracle (or just some good help) to find out why I can boot
> from the .iso and "Choose existing OS" just fine, but cannot get this
> laptop to find and boot grub otherwise. (UEFI is *completely* disabled
> in the BIOS and it boots win10 in Legacy mode fine) I have now exhausted
> all that I can figure out based on my decade and a half of Linux use and
> based on the wikis:
> 
> https://wiki.archlinux.org/index.php/GRUB
> https://wiki.archlinux.org/index.php/EFI_System_Partition
> https://wiki.archlinux.org/index.php/HP_EliteBook_840_G1  (uses EFI mode)
> 
>   I have configured and tried simple MBR boot with the following setup:
> 
>  # fdisk -l /dev/sda
> Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
> Units: sectors of 1 * 512 = 512 bytes
> Sector size (logical/physical): 512 bytes / 4096 bytes
> I/O size (minimum/optimal): 4096 bytes / 4096 bytes
> Disklabel type: dos
> Disk identifier: 0xff7d45aa
> 
> Device     Boot      Start        End    Sectors   Size Id Type
> /dev/sda1             2048 1953525167 1953523120 931.5G  5 Extended
> /dev/sda5  *          4096    1028095    1024000   500M 83 Linux
> /dev/sda6          1030144  105887743  104857600    50G 83 Linux
> /dev/sda7        105889792 1951383551 1845493760   880G 83 Linux
> /dev/sda8       1951385600 1953525167    2139568     1G 82 Linux swap /
> Solaris
> 
>   grub isn't seen on boot, but popping the .iso on USB in, choosing
> "Boot existing OS", hitting 'tab' and changing 'hd0 0' to 'hd1 0' boots
> Arch fine.
> 
>   I next tried with GPT and a 'bios_boot' partition:
> 
>  # fdisk -l /dev/sda
> Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
> Units: sectors of 1 * 512 = 512 bytes
> Sector size (logical/physical): 512 bytes / 4096 bytes
> I/O size (minimum/optimal): 4096 bytes / 4096 bytes
> Disklabel type: gpt
> Disk identifier: 00B6A48C-CBDB-4071-A1EC-97FA828A6C26
> 
> Device          Start        End    Sectors  Size Type
> /dev/sda1        2048       4095       2048    1M BIOS boot
> /dev/sda2        4096    1028095    1024000  500M Linux filesystem
> /dev/sda3     1028096  105885695  104857600   50G Linux filesystem
> /dev/sda4   105885696 1949282303 1843396608  879G Linux filesystem
> /dev/sda5  1949282304 1951379455    2097152    1G Linux swap
> 
>   same result, grub not found on its own, but booting from USB works fine.
> 
>   Next, stranger things being possible, I decided to try a full UEFI
> setup thinking maybe the Legacy mode for this laptop uses some contrived
> boot scheme that requires the esp partition to be present. so I
> re-partitioned the drive and went though the UEFI setup:
> 
>  # fdisk -l /dev/sda
> Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
> Units: sectors of 1 * 512 = 512 bytes
> Sector size (logical/physical): 512 bytes / 4096 bytes
> I/O size (minimum/optimal): 4096 bytes / 4096 bytes
> Disklabel type: gpt
> Disk identifier: 00B6A48C-CBDB-4071-A1EC-97FA828A6C26
> 
> Device          Start        End    Sectors  Size Type
> /dev/sda1        2048       4095       2048    1M BIOS boot
> /dev/sda2        4096    1028095    1024000  500M EFI System
> /dev/sda3     1028096  105885695  104857600   50G Linux filesystem
> /dev/sda4   105885696 1949282303 1843396608  879G Linux filesystem
> /dev/sda5  1949282304 1951379455    2097152    1G Linux swap
> 
>   Still, grub isn't seen on boot, but now "Choose existing OS" starts
> grub, but then throws the error of "unrecognized partition type" (I
> presume is due to the UEFI setup while UEFI is disabled in the BIOS)
> 
>   So I'm stuck. This box boots from the iso perfectly. After "Choose
> existing OS", I pull the USB drive, and the machine works flawlessly.
> (I've got a full plasma/KDE5 setup installed with wpa_supplicant WPA
> wifi, bluetooth, synaptics touchpad, ieee-1394, all working just fine,
> etc.., e.g. I drafted this on kwrite and sent it via thunderbird from
> this same darn box) I just can't get this box to find grub to save my life.
> 
>   I need help figuring out how the .iso is booting in Legacy mode just
> fine, while I can't do the same thing from the hard drive. If this box
> can see and boot the .iso just fine, what could possibly explain it not
> seeing grub on the hard drive? Anybody have any more ideas?

Sorry to bump this old thread, but I've done a bit of additional testing and I
need help to understand why Arch did not install required information
beginning at byte 3 of the NEWLDR MBR. A subsequent install of openSuSE (Leap
42.2) on the same box disclosed the differences in the MBR content for regions
of NEWLDR signature, LOADER physical drive and boot flag, CHS address of
LOADER, etc... throughout the initial 64 bytes of the MBR. This is what left
the laptop unable to boot Arch.

Specifically, the mbr installed by Arch using:

 # grub-install --target=i386-pc /dev/sda
 # grub-mkconfig -o /boot/grub/grub.cfg

is:

00000000  eb 63 90 00 00 00 00 00  00 00 00 00 00 00 00 00  |.c..............|
00000010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000020  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000030  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000040  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000050  00 00 00 00 00 00 00 00  00 00 00 80 01 00 00 00  |................|
00000060  00 00 00 00 ff fa 90 90  f6 c2 80 74 05 f6 c2 70  |...........t...p|
00000070  74 02 b2 80 ea 79 7c 00  00 31 c0 8e d8 8e d0 bc  |t....y|..1......|
00000080  00 20 fb a0 64 7c 3c ff  74 02 88 c2 52 be 80 7d  |. ..d|<.t...R..}|
00000090  e8 17 01 be 05 7c b4 41  bb aa 55 cd 13 5a 52 72  |.....|.A..U..ZRr|
000000a0  3d 81 fb 55 aa 75 37 83  e1 01 74 32 31 c0 89 44  |=..U.u7...t21..D|
000000b0  04 40 88 44 ff 89 44 02  c7 04 10 00 66 8b 1e 5c  |. at .D..D.....f..\|
000000c0  7c 66 89 5c 08 66 8b 1e  60 7c 66 89 5c 0c c7 44  ||f.\.f..`|f.\..D|
000000d0  06 00 70 b4 42 cd 13 72  05 bb 00 70 eb 76 b4 08  |..p.B..r...p.v..|
000000e0  cd 13 73 0d 5a 84 d2 0f  83 d8 00 be 8b 7d e9 82  |..s.Z........}..|
000000f0  00 66 0f b6 c6 88 64 ff  40 66 89 44 04 0f b6 d1  |.f....d. at f.D....|
00000100  c1 e2 02 88 e8 88 f4 40  89 44 08 0f b6 c2 c0 e8  |....... at .D......|
00000110  02 66 89 04 66 a1 60 7c  66 09 c0 75 4e 66 a1 5c  |.f..f.`|f..uNf.\|
00000120  7c 66 31 d2 66 f7 34 88  d1 31 d2 66 f7 74 04 3b  ||f1.f.4..1.f.t.;|
00000130  44 08 7d 37 fe c1 88 c5  30 c0 c1 e8 02 08 c1 88  |D.}7....0.......|
00000140  d0 5a 88 c6 bb 00 70 8e  c3 31 db b8 01 02 cd 13  |.Z....p..1......|
00000150  72 1e 8c c3 60 1e b9 00  01 8e db 31 f6 bf 00 80  |r...`......1....|
00000160  8e c6 fc f3 a5 1f 61 ff  26 5a 7c be 86 7d eb 03  |......a.&Z|..}..|
00000170  be 95 7d e8 34 00 be 9a  7d e8 2e 00 cd 18 eb fe  |..}.4...}.......|
00000180  47 52 55 42 20 00 47 65  6f 6d 00 48 61 72 64 20  |GRUB .Geom.Hard |
00000190  44 69 73 6b 00 52 65 61  64 00 20 45 72 72 6f 72  |Disk.Read. Error|
000001a0  0d 0a 00 bb 01 00 b4 0e  cd 10 ac 3c 00 75 f4 c3  |...........<.u..|
000001b0  00 00 00 00 00 00 00 00  aa 45 7d ff 00 00        |.........E}...|
000001be

  The one installed by openSuSE using the same commands is virtually identical
in all aspects, except for bytes 3 - 63 (zero-based). For some reason when
used with Arch, the grub-install failed to include bytes 3-63 in the mbr. Why?

00000000  eb 63 90 10 8e d0 bc 00  b0 b8 00 00 8e d8 8e c0  |.c..............|
00000010  fb be 00 7c bf 00 06 b9  00 02 f3 a4 ea 21 06 00  |...|.........!..|
00000020  00 be be 07 38 04 75 0b  83 c6 10 81 fe fe 07 75  |....8.u........u|
00000030  f3 eb 16 b4 02 b0 01 bb  00 7c b2 80 8a 74 01 8b  |.........|...t..|
00000040  4c 02 cd 13 ea 00 7c 00  00 eb fe 00 00 00 00 00  |L.....|.........|
00000050  00 00 00 00 00 00 00 00  00 00 00 80 01 00 00 00  |................|
00000060  00 00 00 00 ff fa 90 90  f6 c2 80 74 05 f6 c2 70  |...........t...p|
00000070  74 02 b2 80 ea 79 7c 00  00 31 c0 8e d8 8e d0 bc  |t....y|..1......|
00000080  00 20 fb a0 64 7c 3c ff  74 02 88 c2 52 be 80 7d  |. ..d|<.t...R..}|
00000090  e8 17 01 be 05 7c b4 41  bb aa 55 cd 13 5a 52 72  |.....|.A..U..ZRr|
000000a0  3d 81 fb 55 aa 75 37 83  e1 01 74 32 31 c0 89 44  |=..U.u7...t21..D|
000000b0  04 40 88 44 ff 89 44 02  c7 04 10 00 66 8b 1e 5c  |. at .D..D.....f..\|
000000c0  7c 66 89 5c 08 66 8b 1e  60 7c 66 89 5c 0c c7 44  ||f.\.f..`|f.\..D|
000000d0  06 00 70 b4 42 cd 13 72  05 bb 00 70 eb 76 b4 08  |..p.B..r...p.v..|
000000e0  cd 13 73 0d 5a 84 d2 0f  83 d8 00 be 8b 7d e9 82  |..s.Z........}..|
000000f0  00 66 0f b6 c6 88 64 ff  40 66 89 44 04 0f b6 d1  |.f....d. at f.D....|
00000100  c1 e2 02 88 e8 88 f4 40  89 44 08 0f b6 c2 c0 e8  |....... at .D......|
00000110  02 66 89 04 66 a1 60 7c  66 09 c0 75 4e 66 a1 5c  |.f..f.`|f..uNf.\|
00000120  7c 66 31 d2 66 f7 34 88  d1 31 d2 66 f7 74 04 3b  ||f1.f.4..1.f.t.;|
00000130  44 08 7d 37 fe c1 88 c5  30 c0 c1 e8 02 08 c1 88  |D.}7....0.......|
00000140  d0 5a 88 c6 bb 00 70 8e  c3 31 db b8 01 02 cd 13  |.Z....p..1......|
00000150  72 1e 8c c3 60 1e b9 00  01 8e db 31 f6 bf 00 80  |r...`......1....|
00000160  8e c6 fc f3 a5 1f 61 ff  26 5a 7c be 86 7d eb 03  |......a.&Z|..}..|
00000170  be 95 7d e8 34 00 be 9a  7d e8 2e 00 cd 18 eb fe  |..}.4...}.......|
00000180  47 52 55 42 20 00 47 65  6f 6d 00 48 61 72 64 20  |GRUB .Geom.Hard |
00000190  44 69 73 6b 00 52 65 61  64 00 20 45 72 72 6f 72  |Disk.Read. Error|
000001a0  0d 0a 00 bb 01 00 b4 0e  cd 10 ac 3c 00 75 f4 c3  |...........<.u..|
000001b0  00 00 00 00 00 00 00 00  e3 15 05 00 00 00        |..............|
000001be

  Does anybody have any idea why on this HP laptop, Arch would not write those
61 bytes to the mbr while using the same approach on suse would? Granted Leap
42.2 on suse is running the 4.4.36 kernel but also runs grub2-2.02~beta2 while
Arch has 2.02.beta3. I can't find anything there that points to a difference,
but after installing the boot loader to mbr multiple times with Arch, I can
confirm that it is zeroing the needed bytes 3-63 in the mbr. What/where else
to check?

-- 
David C. Rankin, J.D.,P.E.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP digital signature
URL: <https://lists.archlinux.org/pipermail/arch-general/attachments/20161231/bde5125d/attachment-0001.asc>


More information about the arch-general mailing list