[SOLVED] GRUB Installation on USB drive

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Webbsta
Posts: 8
Joined: Thu May 28, 2009 1:51 pm

[SOLVED] GRUB Installation on USB drive

Post by Webbsta »

Hello everybody,

I am having problems with installing GRUB onto my USB drive, or more specifically, getting my computer to boot to it.

I have followed:
http://wiki.osdev.org/GRUB_2#USB_instructions
(with no errors, everything looking good)

As stated in the above tutorial I then followed the instructions for creating grub.cfg and proceeded to copy my kernel binary image to the location I specified in the config file ("/boot"). I restart my machine, select "boot from USB" (ensuring floppy boot is disabled) and it just boots to my HDD GRUB partition.

I have searched and searched, retrying different things I may have missed to no avail and I was hoping for a bit of advice to see if I may have missed something?

I am developing this on Debian Wheezy using a custom i586-elf gcc. Any help is very much appreciated, thank you.

EDIT:: Forgot to mention for the purposes of trying to get this working, I have used the Bare Bones tutorial and when booting the USB with qemu, it sits at
Booting from Hard Disk...
GRUB _
Last edited by Webbsta on Thu Mar 21, 2013 4:47 pm, edited 2 times in total.
greyOne
Member
Member
Posts: 58
Joined: Sun Feb 03, 2013 10:38 pm
Location: Canada

Re: GRUB Installation on USB drive

Post by greyOne »

Looks like something went wrong with your GRUB installation on the Flash drive.
If you really want to be sure, try disconnecting your hard drive (if possible) and booting from USB again.
If it still fails, it probably means that the system can't find your boot loader.

I will mention, my test system couldn't find my USB drive until I enabled Legacy Mode for USB in the BIOS options.
I'm not exactly sure this is a standardized option, but it may help.

If your system fits on a floppy drive, I'd suggest booting from that though;
You can set the boot order for floppy first. That'll boot it to floppy automatically if the floppy's inserted.
Setting USB to first in my boot order caused my system to not boot; I think it tries to boot from my mouse.

You could also try an external hard drive, that worked for me.
Webbsta
Posts: 8
Joined: Thu May 28, 2009 1:51 pm

Re: GRUB Installation on USB drive

Post by Webbsta »

martin@eagle:~$ sudo grub-install --root-directory=/media/OSDEV --no-floppy --recheck --force /dev/sdc1
/usr/sbin/grub-setup: warn: Attempting to install GRUB to a partitionless disk or to a partition. This is a BAD idea..
/usr/sbin/grub-setup: warn: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and their use is discouraged..
Installation finished. No error reported.
martin@eagle:~$
Just wondering if that second warn has any bearing on this problem... QEMU doesn't complain about it not being bootable but it is still stuck on "GRUB _".
Webbsta
Posts: 8
Joined: Thu May 28, 2009 1:51 pm

Re: [SOLVED] GRUB Installation on USB drive

Post by Webbsta »

As much as I would like to give a reason as to why this is now marked solved, I have no idea. I tried the same thing far too many times to remember what I may have done differently unfortunately. Thanks.
Post Reply