Bug 143725

Summary: grub-install fails to install stage1 on MBR
Product: [Fedora] Fedora Reporter: Kazuyuki Maejima <maejima>
Component: grubAssignee: Peter Jones <pjones>
Status: CLOSED RAWHIDE QA Contact: Mike McLean <mikem>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhide   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: 0.95-6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-01-03 22:12:15 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Kazuyuki Maejima 2004-12-25 15:43:57 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; rv:1.7.3) Gecko/20041020
Firefox/0.10.1

Description of problem:
grub-install of grub-0.95-5 won't install the stage1 program
on the MBR of the IDE disk (/dev/hda) of my laptop.

After several attempts in vain, I extracted another grub-install
from grub-0.95-3 RPM in FC3 distribution set and found
it successfully installed stage1 code on the MBR.

I compared the two versions of grub-install scripts and found a
difference in the 'setup' command lines given to grub.

(0.95-3) setup $force_lba --stage2=$grubdir/stage2
--prefix=$grub_prefix $install_drive

(0.95-5) setup $force_lba --stage2=$grubdir/stage2
--prefix=$grub_prefix $root_drive

I think $root_drive should not come in place of a install device.
(But I don't know how to correct this as the script is being
complicated to support RAID1.)


Version-Release number of selected component (if applicable):
grub-0.95-5

How reproducible:
Didn't try

Steps to Reproduce:
Assume that
 - /dev/hda is the only HDD of a PC.
 - Fedora Core is already installed in /dev/hda2 (/boot) and
   /dev/hda3 (/).
 - grub is installed on /dev/hda.
 - grub RPM is updated to 0.95-5.

1. Install Windows XP in /dev/hda1, and let the Windows installer
   overwrite the MBR of /dev/hda.
   (on which the first stage of grub was previously installed.)
2. Boot with FC3 CD disc 1 in rescue mode. (boot: linux rescue)
3. Mount the Fedora Core partitions under /mnt/sysimage as
   the Fedora Core installer suggests.
4. chroot to /mnt/sysimage. (# /usr/sbin/chroot /mnt/sysimage)
5. Run grub-install. (# /sbin/grub-install /dev/hda)


Actual Results:  stage1 boot loader was installed on /dev/hda2
instead of the MBR of /dev/hda.  (The MBR was left intact.)


Expected Results:  stage1 boot loader should be installed on
the MBR of /dev/hda.

Comment 1 Peter Jones 2005-01-03 22:12:15 UTC
I think I've fixed this in in -6.
I don't have a windows box but I simulated the failure with 2 linux installs.