-   Linux - General (
-   -   USB key boot to windows (

TheBlunderbuss 10-04-2012 02:10 PM

USB key boot to windows

I have a system with Linux and WinXP installed. Grub is set up with Linux as the default. Sometimes, I would like to plug in a USB drive, telling the computer to boot to Windows, without having to provide user input at the GRUB menu.

What I'm currently trying is installing GRUB to the USB thumbdrive. After copying my system's grub.conf to it and removing all but the Windows XP entry, I get marginal success. The first boot-up, GRUB tells me "unknown filesystem" and enters rescue mode. If I reboot from there, it works - Windows gets booted.

I'm wondering why that it doesn't just boot straight away. Either something is wrong with the USB's grub.conf, or the USB key wasn't set up correctly.

Any ideas?

colorpurple21859 10-04-2012 02:51 PM

How did you install grub to the usb key? Which version of grub are you using?

jefro 10-04-2012 04:36 PM

I get the feeling you have an odd issue where you set the boot device as the flash drive and now all the xp info thinks it is D drive instead of C drive.

TheBlunderbuss 10-04-2012 05:32 PM

It is GRUB 1.98, from Debian stable.
I made a new partition table on the flash drive, there are 2 partitions. sdd1 is ~3MB ext2 with the boot flag, sdd2 is FAT32 for other storage.
I believe both were rounded to nearest MiB, not cylinder. I didn't use any syslinux tools on it (mkdiskimage), because I want more than one partition.

Installed with grub-install --no-floppy --root-directory=/mnt/sdd1 /dev/sdd

colorpurple21859 10-04-2012 09:24 PM

My guess from playing around with grub2 on a usb key, is that when you first boot grub thinks that the flash drive is the first hard drive and on reboot gets it right and thinks your internal drive is the first hard drive. If you edit the grub.conf to work on a first boot it may very well fail on reboots. I think you can use uuids or labels to get it right, but I haven't done anything like that, so I can't tell you how to go about setting up the grub.conf

TheBlunderbuss 10-06-2012 09:38 AM

Yeah perhaps the BIOS is assigning the USB key as the first drive and GRUB is confused. I will check that out, as well as (ahem)re-read the grub manual.

All times are GMT -5. The time now is 10:24 PM.