Change BIOS settings to boot from USB

Q I have a Pentium 3, 866MHz laptop with a 20GB hard disk and Mandriva 2005LE booting with Grub. I wish to install Ubuntu 7.04 on an external USB hard disk, making the machine dual boot. I do realise that access to a USB2 enabled HD will be rather slow since the above machine has USB1.1 ports. My problem is that the laptop's BIOS cannot make a USB-HD the first booting device. How do I modify the bootloader to access above USB-HD or use a floppy to install a bootloader. I find it difficult to find appropriate info on this subject.

A You can use your existing bootloader to boot from the USB disk. It is best to use the Ubuntu alternate install CD for this purpose, as it gives more control over installation options. Install Ubuntu on the external disk in the usual way, but do not let it write the bootloader to the MBR as it usually does. Instead, have it install Grub to the root partition, which will probably be /dev/sdb1 with the internal disk being /dev/sda. Then boot into Mandriva as normal and mount your Ubuntu partition. Mandriva 2005 still uses /dev/hd* for IDE hard disks, so your USB drive will now be /dev/ sda. Open a root terminal and run

mkdir /mnt/tmp
mount /dev/sda1 /mnt/tmp
YourFavouriteEditor /boot/grub/menu.lst /mnt/tmp/boot/grub/menu.lst

to load both bootloader configurations into your favourite text editor. You now have two choices, the quick and easy method, or the slicker-looking but- slightly-more-fiddly-to-set-up method. For quick and easy, add this to the end of the Mandriva menu.lst file.

title Ubuntu menu
root (hd1,0)
chainloader +1

This adds an extra menu entry that runs the Ubuntu bootloader. To do everything from the one boot menu, you need to copy the Ubuntu bootloader menu entries to the Mandriva menu. Look for the main title option, the one that appears first in the menu. It will consist of three lines; the title to show on the boot menu, the kernel to load with a number of options and the initrd to use. Copy these lines to the Mandriva menu.lst and change the title to something appropriate. Then change the device paths to reflect the correct locations. Grub counts from zero, so (hd1,0) is the first partition (0) on the second disk. You can either include the path in each of the kernel and initrd lines or (my personal preference) as a separate root item. Your menu.lst entry will look something like this example (for Ubuntu 7.10):

title Ubuntu 7.10
root(hd1,0)
kernel /boot/vmlinuz-2.6.22-14
root=/dev/sda1 quiet splash
initrd /boot/initrd.img-2.6.22-14

You could also copy the other Ubuntu menu entries in the same way, or leave the Ubuntu menu option as above for the rare occasions you will need anything but the default. If you get a File not found error when selecting this menu, you have probably got the paths wrong. The drive ordering depends on BIOS settings, and even then, Grub cannot boot from USB on all systems. To check the correct path for the kernel, run grub from a root terminal (or you can press C at the Grub menu) to enter the Grub shell. Then run

find /boot/vmlinuz-2.6.22-14

The command should show the correct path for the kernel, including the drive numbers. Make sure this matches up with the root command in your menu.

Follow us on Identi.ca or Twitter

Username:   Password:
Create Account | About TuxRadar