sábado, octubre 31, 2009

boot from usb with grub

Algunos ordenadores no se pueden configurar para que arranquen desde el usb

Pero si tienen instalado grub, hay una buena solución (sencilla)


Booting via grub
This is the easiest way, and has been proven to work on several laptops from 2002-2005. To check if your BIOS is able to detect the USB drive and hand it over to grub, just run grub (from your hard drive if it already installed, or from a grub boot floppy or CD). At the grub menu, hit 'c' to enter command mode. Now search for your USB drive, using the root command to choose a drive/partition and the find command to see if you found the right one. You can go through your devices like in this example:
grub> root (hd0,0) # first harddrive, first partition
grub> find /[tab] # type the slash then press [tab], and it will try to list files on this partition
Error 17: Cannot mount selected partition # Oops no file system here
grub> root (hd0,1) # first harddrive, second partition
grub> find /[tab]
Possible files are: lost+found var etc media ... # That was my hard drive with my linux install
grub> root (hd1,0) # second hard drive usually is the USB drive if you have only one internal drive
grub> find /[tab]
Possible files are: ldlinux.sys mydoc myfile mystick syslinux.cfg # Bingo, that's the USB stick
(If you have 2 internal drives, the USB drive probably is hd2,0 and so on.)
Or, if you know that there is a file called e.g. "MYDRIVE" on the drive, just run
grub> find /MYDRIVE
and grub will look through all drives and partitions that it can access. It will list the correct device to use for the root command.
Boot the drive by entering:
chainloader +1
For convenience, add these commands to your grub configuration (usually in /boot/grub/menu.lst):
# to boot from a USB device
title Boot USB drive
root (hd1,0)
chainloader +1