LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Laptop and Netbook (https://www.linuxquestions.org/questions/linux-laptop-and-netbook-25/)
-   -   Tricky issue with Grub - flash drive dual booting (https://www.linuxquestions.org/questions/linux-laptop-and-netbook-25/tricky-issue-with-grub-flash-drive-dual-booting-872776/)

oblivion2k 04-03-2011 07:23 PM

Tricky issue with Grub - flash drive dual booting
 
First post, glad to be here.
So, luckily this is not an issue that is keeping me from booting at all, however, I need to have my flash drive plugged in to boot or I get a grub error 21. Here's why:
I started with Windows 7 on my laptop internal drive, and installed Fedora Core 12 in dual boot configuration onto my 16Gb flash drive. Already I'm sure some of you see the problem. Grub installed onto my flash drive, therefore, without my flash drive inserted, my BIOS sees no bootloader and won't boot. Essentially what I'm wanting to do is export my GRUB onto the internal hard drive so I can boot my laptop without having my flash drive plugged in. Initially when I tried this I got a No Hard Disk error, which is understandable. I fixed this by going into grub and using setup (hd0) which I was hoping (but not expecting) would export my existing grub setup onto the internal drive with the MBR (hd0). Not quite, as now the error message I receive without my flash drive plugged in is Error 21, as I mentioned earlier. From what I understand this means that the hard drive with the grub menu was not found (maybe?). That's as far as I got. In summary I need to move my grub from my flash drive to my laptop hard drive so that I can boot to the Windows partition on my laptop hard drive without my flash drive plugged in. Not a huge issue, I'm not in a panic or anything, but help would be appreciated.

syg00 04-03-2011 08:04 PM

I don't understand why you got the "No Hard Disk" error - have you been changing the boot order in the BIOS ?.

It is possible to move the /boot onto the internal disk, but you might want to give this some more thought. With external devices I prefer to keep the boot environments separate.
Have Win7 on the internal disk, Linux on the flash. When you want to boot the flash, choose it from the BIOS - most modern machines have a key to pull up a device menu on boot. Presumes the flash is a bootable device as far as the BIOS is concerned.

Tell us which way you want to go, and we can hopefully fix you up.

jefro 04-04-2011 03:21 PM

Error 21 is some grub line trying to find something.

I'd look to boot order in bios first. Is it set to the usb first when the usb is installed?

thorkelljarl 04-05-2011 01:57 PM

Boot flag...

Windows wants a boot flag for the partition that boots, these days, often a special Windows partition just for that purpose. You can use the command "fdisk -l" with "root" privileges in a terminal to check that the boot flag is still there.

Unless you want to install linux beside Win7 on your HDD, the suggestion from syg00 that you keep Win7 and linux separate and use a BIOS function, either changing the boot sequence or using a one-time-boot menu, when booting your linux USB is a good idea.

An easy way to do this is to open your laptop and disconnect the internal HDD, then just install linux on the USB flash drive. As an alternative, you might boot Fedora as a live-cd, then install it on the USB flash as a persistent USB installation. Either way should work.

Then, neither Windows nor linux will know of the others existence. Win7 will boot on its own when the linux USB is not plugged in or is not chosen to be booted. linux will boot if it is plugged in and either the BIOS boot sequence is set to choose the USB before the internal HDD or the BIOS sequence is set to choose the HDD first, and the linux USB is picked in the one-time boot menu at POST.

You may need to do a little repair on Windows to have it boot after you remove the chainloading function that you introduced with Grub. These can be useful.

http://neosmart.net/dl.php?id=1

http://neosmart.net/blog/2009/window...-repair-discs/

Otherwise, google for help in repairing windows after dual-booting linux; you will find many posts.

Note: your posts are easier to read if you separate the text into separate text blocks.

oblivion2k 04-07-2011 12:39 AM

Well, now I've gone and done it...
Formatted the flash drive because I needed it for other things, thinking I could just run the windows 7 startup repair disk when I got home to fix it, and I ran startup repair a few times, no luck. I'm still getting grub errors for some crazy reason. With the flash drive plugged in it's error 21, without it plugged in it's error 17 (or maybe the other way around, I can't remember). Now I'm on an ubuntu 10.10 live cd I had laying around until I can get this fixed.
To answer the previous questions, I had it set to boot from removable drive first, followed by the HDD. This might have been the problem if I'm understanding correctly. For right now though, I just need to get my windows 7 partition working. I'll be installing CentOS and Fedora Core onto my flash drive later for my Fedora Core class at college, so I'll probably need help again for that. Any help getting me going for now with some repair commands for the Windows 7 repair disc would be very much appreciated.

syg00 04-07-2011 01:08 AM

To run the Win7 repair you'll need the internal disk first in the BIOS list - as in before the flash, but (obviously) after the CD.
What issues are you having with that ?. I've had to use the Neosoft one (second link in post #4 above) - worked fine. You just need to recover the MBR on the internal disk - have a read of this technet article.


All times are GMT -5. The time now is 09:58 PM.