This service will be undergoing maintenance at 00:00 UTC, 2016-09-28. It is expected to last about 1 hours
Bug 72583 - grub does not get installed on updated images
grub does not get installed on updated images
Status: CLOSED CURRENTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: anaconda (Show other bugs)
7.3
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jeremy Katz
Brock Organ
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-08-25 16:17 EDT by Need Real Name
Modified: 2007-04-18 12:46 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-10-02 16:16:27 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Need Real Name 2002-08-25 16:17:07 EDT
The standard redhat 7.3 images are isntalled OK.
An nfs/http system image updated with packages from updates (in a proper way)
also works OK, EXCEPT when the kernel packages are updated.

When kernel is updated and images re-generated 
this causes a strange bug - grub either do not get installed,
or just doe not work.
The messages on Atl-Ctl-F3 console are the same:

* self.hostname=linuxserver
* GRUB command root (hd0,0)
install /grub/stage1 d (hd0) /grub/stage2 p (hd0,0)/grub/grub.conf
* Writing X configuration
No error messages printed (is it possible that error messages got somehow lost?)

but grub does not get installed.
All anaconda generated files are correct (they are the same as with 
original installation).

Booting from in a rescue mode and then running

/sbin/grub-install

fixes the problem with non-installed grub..


P.S.RedHat images are regenerated as:
idir="/home/redhat-7.3/cdrom/"
export PYTHONPATH=/usr/lib/anaconda
export PATH="$PATH:/usr/lib/anaconda-runtime"
genhdlist $idir
pkgorder $idir i386 >./pkgorder.txt
buildinstall --pkgorder ./pkgorder.txt --comp dist-7.3 --version 7.3 $idir
Comment 1 Need Real Name 2002-08-25 16:28:14 EDT
In addition:
the described problem with non-installed grub happens during kickstart installation.
Comment 2 Need Real Name 2002-08-25 16:35:42 EDT
The /sbin/grub-install
uses these command to install grub:

root (hd0,0)
setup  --stage2=/boot/grub/stage2 --prefix=/grub (hd0)
quit
Comment 3 Jeremy Katz 2002-08-25 18:08:21 EDT
Note that this is a very unsupported configuration;  unfortunately, the kernel
tends to change in ways that can't be predicted in advance by the installer...

If you look at tty5, do you see anything in the grub shell output along the
lines of "file does not exist" or similar?  If so, then you need to add some
sync()'s in bootloader.py before grub-install is run.
Comment 4 Need Real Name 2002-08-26 03:52:16 EDT
It gives this error on tty5:
-------------------------------------------------------
grub> root (hd0,0)
  Filesystem type is ext2fs, partition type 0x83
grub>  install /grub/stage1 d (hd0) /grub/stage2 p (hd0,0)/grub/grub.conf
Error 2:Bad file or directory type
-------------------------------------------------------

If I add in %post anaconda script this:

/sbin/grub --batch --device-map=/boot/grub/device.map <<EOF
root (hd0,0)
setup  --stage2=/boot/grub/stage2 --prefix=/grub (hd0)
quit
EOF


which is translated to 
-----------------------------------------------
grub> root (hd0,0)
 Filesystem type is ext2fs, partition type 0x83

grub> setup  --stage2=/boot/grub/stage2 --prefix=/grub (hd0)
 Checking if "/grub/stage1" exists... yes
 Checking if "/grub/stage2" exists... yes
 Checking if "/grub/e2fs_stage1_5" exists... yes
 Running "embed /grub/e2fs_stage1_5 (hd0)"...  22 sectors are embedded.
succeeded
 Running "install --stage2=/boot/grub/stage2 /grub/stage1 d (hd0) (hd0)1+22 p (
hd0,0)/grub/stage2 /grub/grub.conf"... succeeded
Done.
------------------------------------------

Everything works OK and grub gets sucessfully installed.
Comment 5 Need Real Name 2002-08-26 04:08:07 EDT
And with the original Redhat 7.3 image the command 

install /grub/stage1 d (hd0) /grub/stage2 p (hd0,0)/grub/grub.conf

installs grub just fine.
No that "Error 2:Bad file or directory type"
error message.
Comment 6 Need Real Name 2002-08-26 04:45:10 EDT
In addition: I would also recommend to modify anaconda
to print an error message if grub installation failed.
Currently - even if it failed - the screen looks as everything is OK
and computer just does not boot.
Comment 7 Need Real Name 2002-08-28 05:05:27 EDT
I also tested on SCSI computer.
Same poblem. The grub command

install /grub/stage1 d (hd0) /grub/stage2 p (hd0,0)/grub/grub.conf

command does not work on image with updated kernel and 
adding the code below to %post section is required to make a booting system.

/sbin/grub --batch --device-map=/boot/grub/device.map <<EOF
root (hd0,0)
setup  --stage2=/boot/grub/stage2 --prefix=/grub (hd0)
quit
EOF

I have a question: is it possible that 
grub has some hidden/undocumented 
dependance on kernel version?
Comment 8 Jeremy Katz 2002-10-02 18:00:08 EDT
The newer kernel is less aggressive about actually writing blocks to disk so you
have to be more aggressive about syncing to get the blocks written to disk
before grub runs.

This is done in our current release but is not a problem with Red Hat Linux 7.3
as shipped; changing the kernel used for the installer is not really a supported
configuration due to the multitude of things which can change over an errata
cycle for a release.
Comment 9 Michael Fulbright 2002-12-20 12:38:25 EST
Time tracking values updated

Note You need to log in before you can comment on or make changes to this bug.