Bug 1564225

Summary: Grub fails to include Stage2 during setup
Product: Red Hat Enterprise Linux 6 Reporter: James Vess <jvess>
Component: grubAssignee: Lukáš Nykrýn <lnykryn>
Status: CLOSED WONTFIX QA Contact: Release Test Team <release-test-team-automation>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.9CC: curtis.wilson, toneata
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-07-03 12:29:15 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Full Test / Uninstall / Reversion / Test none

Description James Vess 2018-04-05 17:55:19 UTC
Created attachment 1417863 [details]
Full Test / Uninstall / Reversion / Test

Description of problem:
When attempting to use grub setup to install a bootblock on a system which is configured without a boot partition any calls to setup within grub fail to find the stage2 file. This may or may not be related to large disk size or usage of GPT with BIOS.

!! This issue has been leaving boxes unable to boot after updates !!

This problem is not present within grub-0.97-94.el6.x86_64.rpm, however exists in both of the listed packages below.

Version-Release number of selected component (if applicable):
grub-0.97-94.el6_7.1.x86_64.rpm
grub-0.97-99.el6.x86_64.rpm

How reproducible:
50+ boxes have shown this problem, I was able to reproduce on these systems by reverting the affected packages back to a prior version and then back again.

Steps to Reproduce:
1. Configure a disk layout similar to the additional information below ( although possibly not necessary )
2. Install grub-0.97-99.el6.x86_64.rpm
3. Run grub-install /dev/sda --debug

Actual results:

>
>     GNU GRUB  version 0.97  (640K lower / 3072K upper memory)
> 
>  [ Minimal BASH-like line editing is supported.  For the first word, TAB
>    lists possible command completions.  Anywhere else TAB lists the possible
>    completions of a device/filename.]
> grub> root (hd0,0)
>  Filesystem type is ext2fs, partition type 0x83
> grub> setup  --stage2=/boot/grub/stage2 --prefix=/boot/grub (hd0)
>  Checking if "/boot/grub/stage1" exists... yes
>  Checking if "/boot/grub/stage2" exists... no
> 
> Error 16r: Inconsistent filesystem structure

Expected results:

> 
>     GNU GRUB  version 0.97  (640K lower / 3072K upper memory)
> 
>  [ Minimal BASH-like line editing is supported.  For the first word, TAB
>    lists possible command completions.  Anywhere else TAB lists the possible
>    completions of a device/filename.]
> grub> root (hd0,0)
>  Filesystem type is ext2fs, partition type 0x83
> grub> setup  --stage2=/boot/grub/stage2 --prefix=/boot/grub (hd0)
>  Checking if "/boot/grub/stage1" exists... yes
>  Checking if "/boot/grub/stage2" exists... yes
>  Checking if "/boot/grub/e2fs_stage1_5" exists... yes
>  Running "embed /boot/grub/e2fs_stage1_5 (hd0)"... failed (this is not fatal)
>  Running "embed /boot/grub/e2fs_stage1_5 (hd0,0)"... failed (this is not fatal)
>  Running "install --stage2=/boot/grub/stage2 /boot/grub/stage1 (hd0) /boot/grub/stage2 > p /boot/grub/grub.conf "... succeeded
> Done.
> grub> quit

Additional info:

I've attached an end to end log showing the running, removal, package install, and re-run where you can see the issue occurring and being resolved by removing the affected package and installing an older version.

Reviewing the package content differences I'm showing that 0017-Fix-ext4-loading-ineffectiveness.patch was added prior to this issue showing up, however I don't see any reason why it would cause this.

== Disk and partition setup ==

parted for GPT Table:
Model: LSI MR9266-4i (scsi)
Disk /dev/sda: 4000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End     Size    File system     Name   Flags
 1      1049kB  50.0GB  50.0GB  ext4            slash  boot
 2      50.0GB  58.0GB  7999MB  linux-swap(v1)  swap
 3      58.0GB  58.0GB  1049kB                  boot   bios_grub
 4      58.0GB  4000GB  3942GB  ext4            vz

fdisk for Protected:
Disk /dev/sda: 3999.7 GB, 3999688294400 bytes
256 heads, 63 sectors/track, 484368 cylinders
Units = cylinders of 16128 * 512 = 8257536 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1      266306  2147483647+  ee  GPT

Mounts:
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1              46G   31G   14G  70% /
tmpfs                  63G     0   63G   0% /dev/shm
/dev/sda4             3.6T  1.9T  1.6T  56% /vz

!! NOTE !! There are sdb/sdc devices in place of matching size to sda which contain a single partition formated to ext4 and are mounted at /vz2 and /backup as well, however I omitted these in the output for brevity.