Comment 39 for bug 46520

Revision history for this message
Tor (panda726) wrote : Re: [Bug 46520] Re: Grub installs to wrong drive's MBR in default install. No way to change in standard installer.

Ubfan wrote:
> This problem is present in Intrepid and easy to duplicate with a laptop and a USB disk.
> Installating Ubuntu to a USB disk is likely to be a common scenario.
>
Probably true.
> Set the laptop boot order to be: USB/CDROM/harddisk. Boot the standared live Ubuntu CD-ROM, plug
> in the USB disk, and install to the first USB partition. Select the default (not advanced)
> option and the result of the "successful" install will boot neither Linux nor Windows, with
> or without the USB disk attached.
>
Sounds like a special case of the original bug. Possibly worth a new
bug, as the original bug was (I thought) fixed (at least for all
internal drives) by complete use of UUIDs in GRUB.
> The Cause:
> The Grub files are put on the USB /boot/grub, but the Grub bootloader is put
> on the laptop harddisk master boot block. The menu.lst disk identifications are the USB UUID for
> the Linux roots and (hd0... for Windows! Without the USB drive attached, the Grub bootloader
> cannot find its files, so it fails. With the USB drive attached, the windows disk is wrong in
> the menu.lst (It is not hd0, as menu.lst identifies it). Not sure why the Ubuntu boots fail,
> unless since there is no bootloader on the USB disk, the disk is not even seen, and the UUID
> is not found.
>
Sounds rather like the original bug here. You may have already changed
this by changing boot order, but I suspect that if you go to the grub
command prompt and look at the disk config, it will match the boot
order, probably with your USB disk first. From within Ubuntu you will
find that the USB disk comes second ("sudo fdisk -l" will get you that
information).
> Workarounds:
> 1) Windows boot works (only with USB attached) when you change the boot order to hard-disk first, then
> the Grub "hd0" is accurate for the Windows sections. I thought I tried editing menu.lst, changing the hd0 to hd1
> for the windows sections, and even trying to map (hd0) (hd1) ... all failed (before fixing the USB boot, then just
> changing the hd0 to hd1 worked).
>
No good idea about this. To my knowledge the only truly reliable
information on which number it should be is from the /boot/ grub's
command prompt. Use "geometry (hdX)", replacing "X" with a drive number
to figure out which disk gets which number, and compare with what you
get from either "sudo fdisk -l" or by using the grub prompt through
terminal by "sudo grub". I can tell you from my own experience that the
two different grub prompts can give different results.
> 2) Linux boot may be fixed by booting the CD-ROM, and doing the Grub install again to the
> USB disk (needed the --recheck and the explicit root-directory flag to get beyond the "disk not
> supported by bios complaint"). Then replace the menu.lst file, which disappeared! (I had a backup called menu.lst~).
> 3) To use the laptop without the USB disk, either:
> a) Restore the MBR with the Windows Recovery Console's FIXMBR (good luck, finding the Recovery Console is the hard part!).
> b) Find a (Windows) fdisk on a bootable media, and fdisk /mbr
> c) Do a complete Grub install to a FAT partition (like the recovery partition found on many laptops these days). I
> finally did this, since I have messed up a system before looking for the Recovery Console on the
> vendor supplied recovery disks.
>
I tend to feel that option 3C is a good idea for anyone who has more
than one operating system installed. Once you get it set up, it
provides a very nice insulation from failure of any OS, which is within
possibility, or even just an OS reinstall that doesn't quite go
smoothly. Perhaps there should be an advanced option in manual
partitioning to either make or work with an existing GRUB partition.
> Other (hopefully) irrelevant details:
> * AMD cpu laptop, NTFS primary partition, FAT recovery partition
> * MAXTOR 200G USB disk, 9 partitions, first partition 50G for the Ubuntu install, preformatted ext2. No swap. No boot.
> * Before repair, Grub console found the /ntldr on (hd1,1), but nothing was found on hd0 (?).
> * Visible devices were fd1-fd7, hd0 and hd1. I thought the 7 floppy disks were probably the misidentified usb disk partitions.
> * kernel is whatever the 8.10 live cd installs
>
Do you know if you have an IDE HD or a SATA HD? It crosses my mind that
USB being a newer technology, and also now a likely way to run a
recovery disk may impact boot order. Same for mixed SATA and IDE
environments like I have - the SATA disk is boot (correct), but the IDE
disks show up first in gNewSense (essentially Hardy Heron with all
non-free bits removed, in case you aren't familiar with it) and all
Ubuntu versions I have tried.

Good luck, and hopefully this will get entirely solved soon.

Tor