boot loader breaking MBR despite user selection

Bug #8288 reported by Ben
This bug report is a duplicate of:  Bug #8322: Parted corrupts the partition table. Edit Remove
8
Affects Status Importance Assigned to Milestone
grub (Ubuntu)
Invalid
Medium
Colin Watson

Bug Description

<empty comment>

Revision history for this message
Matt Zimmerman (mdz) wrote :

Not enough information

Revision history for this message
Ben (ben-ben-net) wrote :

It seems that the installation of grub or lilo during the Ubuntu installation
makes changes to the MBR regardless of what the user selects.

My problem. I have Windows XP installed on hda1. It's a 10GB partition. I
have installed Ubuntu a number of times and regardless of what I choose I loose
the ability to be able to boot into Windows XP. I have tried the following
combinations.

1. Installed lilo or grub into the MBR. Unable to boot Windows. It is unable
to find the NTLDR.
2. Installed lilo or grub into the linux partition and was planning to modify
the boot.ini (and use bootpart) to access the Linux parition. No success. I am
unable to load the NTLDR, it seems there were changes made to the MBR regardless
of what I selected during the installation.

Interesting things. Once I install Ubuntu and the MBR breaks, I am unable to
reinstall any Windows operating system. Even with a fresh install and after
formating the drives during the installation it is unable to boot. If I use the
recovery console in Windows 2000/XP to "fixboot" and "fixmbr" it still does not
correct it.

I've since created a Windows 98 boot disk with fdisk. Doing a plain "fdisk
/mbr" still does not fix the MBR, I have to manaully delete the non-dos
partitions in fdisk, save changes, reboot, then "fdisk /mbr", reboot, and then
reinstall for it to boot Windows normally.

axe9 on #ubuntu is having similar problems. I don't have access to my
configurations at the moment, but I'm going to upload them tonight. I've asked
axe9 to append notes to this bug.

Revision history for this message
ben (the-axe) wrote :
Download full text (3.3 KiB)

this is what my menu.lst file looks like:

# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
default 0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 3

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
hiddenmenu

# Pretty colours
#color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
title WinXP
map (hd1) (hd0)
map (hd0) (hd1)
rootnoverify (hd1,1)
chainloader +1
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default optons below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specifiv kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
# kopt=root=/dev/hda1 ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,0)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery mode) single
# altoptions=(recovery mode) single

## nonaltoption boot targets option
## This option contols options to pass to only the
## primary kernel menu item.
## You can have ONLY one nonaltoptions line
# nonaltoptions=quiet splash

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all

## ## End Default Options ##

title Ubuntu, kernel 2.6.8.1-2-386
root (hd0,0)
kernel /boot/vmlinuz-2.6.8.1-2-386 root=/dev/hda1 ro quiet splash
initrd /boot/initrd.img-2.6.8.1-2-386
savedefault
boot

title Ubuntu, kernel 2.6.8.1-2-386 (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.8.1-2-386 root=/dev/hda1 ro single
init...

Read more...

Revision history for this message
Jan Schmidt (thaytan) wrote :

This sounds like the exact problem I had tonight on a machine, and the same as
reported widely on FC2 and 3. There's a supposed fix here that I haven't tried
yet: http://lwn.net/Articles/86835/ and the FC bug thread here:
http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=115980

Revision history for this message
Alex Hudson (bugs-alexhudson) wrote :

I had precisely this issue also on a friend's machine this evening; I followed
the useful guide at http://lwn.net/Articles/86835/. In short, it worked.

I tried all sorts of combinations in order to get both to go on. It didn't work,
I suffered the same symptoms: can't boot to W32, the W32 recovery commands
(FIXMBR, FIXBOOT, etc.) didn't help the situation, re-installing didn't do the
usual W32 of replacing the MBR/etc.

'sfdisk -d /dev/hda | sfdisk --no-reread -H255 /dev/hda --force' was basically
what worked for me - and yes, I did need the extra --force :(.

Apart from that, the detection of the W32 partition and the grub config was all
fine.

Revision history for this message
Matt Zimmerman (mdz) wrote :

Did you resize any partitions during the installation process? This sounds a bit
like #1566, in which case it is unrelated to grub

Revision history for this message
Jan Schmidt (thaytan) wrote :

#1566 does sound like the same trouble I had.

Revision history for this message
Matt Zimmerman (mdz) wrote :

This bug has been marked as a duplicate of bug 8322.

Revision history for this message
ben (the-axe) wrote :

Well, Except it's not :P
No, I did not resize any partitions when I installed. As I thought I said, it
was in a totally sepparate drive. The drive I installed to was already formatted.
I got my harddrives back thanks to the people at #ubuntu. However, windows is
still dead.
I'm gonna try out that link Jan Posted, and if that doesn't fix it, I'm
reinstalling windows.......

Revision history for this message
Matt Zimmerman (mdz) wrote :

Please attach the following files from your Ubuntu system:

/var/log/debian-installer/syslog
/var/log/debian-installer/messages

Revision history for this message
Ben (ben-ben-net) wrote :

Created an attachment (id=439)
Debian Installer syslog

See general notes from Ben Lisle (<email address hidden>)

Revision history for this message
Ben (ben-ben-net) wrote :

Created an attachment (id=440)
Debian Installer messages

My /var/log/debian-installer/messages (<email address hidden>), see my main note for
details..

Revision history for this message
Ben (ben-ben-net) wrote :

I've just done another install without success. Stil can't access my Windows
partition which is sitting in /dev/hda1 - I've attached my syslog|messages from
/var/log/debian-installer/

I've about to try the fix that is mentioned below - will update if it is a
success or not.

Revision history for this message
Matt Zimmerman (mdz) wrote :

Seems fairly complete; Colin, what do you think the problem could be?

Revision history for this message
ben (the-axe) wrote :

Well, mine has yet to work... I'm gonna wipe linux from the old drive of mine,
and then install windows on it, and install linux on the other drive.
and, if that doesn't work (which I don't think is possible) I'm totally screwed...

Revision history for this message
Matt Zimmerman (mdz) wrote :

I just noticed that Ben Lisle, who reported this bug, stated in bug #8322 that
the solution implemented there corrected the problem for him. Therefore, this
bug seems to be a duplicate of bug #8322.

This bug has been marked as a duplicate of bug 8322.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.