Wed Apr 24 11:49:43 EDT 2013

Fixing Ubuntu triple boot after upgrade

Computer has a convoluted boot setup:
- sda1  VFAT compaq rescue partition with DOS grub installed
- sda2  NTFS XP
- sda5  Ubuntu
- sda6  Debian

Reason?  PC has trouble Ubuntu / Debian GRUB directly from USB

The point is to boot from the VFAT and chainload into the debian
bootloader, which can boot Ubuntu.  However, Ubuntu will override the
MBR, so to fix, boot from GRUB 0.97 on USB disk into Debian (or
Ubuntu) and fix the MBR.

- make a bootable grub 0.97 USB disk
cp stage1 stage2 to  /boot/grub/
use a device map file "(hd0) /dev/sdk" with grub --device-map=<file>
at grub> do
root (hd0,0)
setup (hd0)

- boot the USB disk (BIOS: ESC = boot menu)

- then start Debian manually at grub>
root (hd1,5)
chainloader +1

or use "root (hd1,6)" to boot Ubuntu.

- VFAT grub boot from MBR

  mount the VFAT and copy /boot/grub.elf to /tmp, chmod it and execute
  it.  then do the same thing as for preparing the USB drive.
  with device-map "(hd0) /dev/sda", at grub> do
  root (hd0,0)
  setup (hd0)