Menu

14 December 2010

Installing GRUB on USB

---------- Forwarded message ----------
From: anks <ankscorek   AT gmail.com>
Date: Mon, Dec 13, 2010 at 10:39 AM
Subject: [LUG@IITD:10772] Installing GRUB on USB


Select the partition on the usb disk for GRUB installation. Mount it
and run this command:

grub-install --root-directory=/media/disk /dev/sdb

In this command usb device desired partition is mounted on folder /
media/disk. The GRUB images are placed inside this directory. After
the script is finished, it tells you about the device.map file, as it
tells you, check to see if all your devices are listed there, if so,
you are all set and ready for the last step.

Create a menu file for GRUB, which tells the bootloader where to load
the kernel from. Sample menu.lst file which is from www.dreamincode.net

       # the default choice, 0 is the first one
       default 0
       # timeout in seconds, to wait for choice
       timeout 5
       # set the colors of the screen
       color cyan/blue white/blue
       # hd0 is the usb device itself
       # my hard drive became hd1
       title       Debian GNU/Linux
       root        (hd1,4)
       kernel  /boot/vmlinuz-2.6.26-2-amd64 root=/dev/sda5 ro
       initrd      /boot/initrd.img-2.6.26-2-amd64

       title       Debian GNU/Linux(single-user mode)
       root        (hd1,4)
       kernel  /boot/vmlinuz-2.6.26-2-amd64 root=/dev/sda5 ro single
       initrd      /boot/initrd.img-2.6.26-2-amd64

Change the locations for your own kernel files, also change the root
device to the appropriate partition where you installed your system's
boot directory.

Now you are all set and ready to use the usb device, double check the
menu entries, make sure you put this menu file in your usb device
inside the /boot/grub/ directory.
Now reboot the system with your usb connected to it, change the BIOS
settings if needed (to boot any usb devices first), and see if it
works.

Hope this helps..Thanks to dreamincode.net forums for putting this
procedure in simple language

By- Narendra Sisodiya

Post a Comment