February 11, 2010

Two steps to install bootloader on your USB key

You can also use this to boot into Ubuntu Wubi installation while having your windows in Hibernation!

Install MBR on the USB stick


On windows:
  1. download grubutil for windows then extract all and run grubinst_gui.exe
  2. Select from the menu 'Disk' and click 'Disk Refresh' then choose your usb device.
  3. Select 'Part List Refresh' and choose 'Whole Disk (MBR)'
  4. Click 'Install', and that's it.
On Linux:
- Download the source of grubinst from SourceForge http://downloads.sourceforge.net/gru...7&big_mirror=0
- Uncompress the zip file to some directory (in your home partition for example)
- Open a terminal
- Go to that directory
- Compile grubinst using
Code:
make -f Makefile.lnx
- Get the proper device name of you USB key. It is IMPORTANT you do not do mistakes here otherwise you will destroy you hard disk regular MBR. So for example, type
Code:
sudo fdisk -l
and try to see how is your USB key named. For example, mine is /dev/sdc
- In case we got wrong (2 precautions), we are going to save the MBR we will overwrite, so that we should be able to put it back if there was a problem. So type:
Code:
sudo ./grubinst --save-mbr=USB.mbr /dev/sdX
(replace X by the proper letter of your USB)
- Now the MBR of you key has been saved next to grusint program.
- We can now write Grub4DOS MBR to the key (always replace X by relevant letter):
Code:
sudo ./grubinst /dev/sdX


Install a bootloader on a USB stick

To install wubi loader:
- Copy wubildr to the root of your key, and rename it grldr
- Make a ubuntu directory to the root of your key
- From your harddrive, copy /ubuntu/winboot to the /ubuntu on the key, so that you usb key will have the directory /ubuntu/winboot.
done.

To install regular grub4dos:

  1. download latest grub4dos here: http://download.gna.org/grub4dos/ and extract grldr and menu.lst to your usb flashdrive top directory.
  2. edit menu.1st as you wish.

Helpful links:
1. http://it.dennyhalim.com/2009/02/install-grub4dos-make-usb-bootable-from.html
2. http://ubuntuforums.org/showpost.php?p=5966083&postcount=7

No comments:

Post a Comment