Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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
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
Last edited by colorpurple21859; 10-06-2012 at 09:25 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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.