It's easy to solve, but you need some tools before you can do it:
First, boot into the Linux system (it must have GRUB installed!). Use a tool such as GParted to format your USB drive as ext2. It must be ext2*!
When using GParted you should get your USB drive's device file path (should be something like /dev/sdb1
). Take note of it, we'll use it.
Open a terminal window and run:
sudo umount -l /dev/sdb1
Replacing /dev/sdb1
with whatever you took note of. If the above command throws you an error such as "device is not mounted" just ignore it.
sudo mount /dev/sdb1 /mnt
sudo grub-install --root-partition=/mnt /dev/sdb
Replace /dev/sdb
with what you took note of, but do not put the number (which is probably 1) in the end of the path. Also note the space between /mnt
and /dev/sdb
.
sudo umount /dev/sdb1
Remove the USB drive from the Linux box and plug it in your computer. Turn it on. When you see the grub rescue
prompt, run
ls
That should show you all your drives/partitions. You'll have to find your USB drive. It will probably be (hd1,msdos1)
. Run ls (hd1,msdos1)/
(don't forget the /
). If the output is boot/
then this is the correct partition. If you don't get this output, repeat with all the "msdoses" until you get it. Take note of the right one. I'll use (hd1,msdos1) as the example. Run:
set prefix=(hd1,msdos1)/boot/grub
then
insmod chainload
insmod ntfs
set root=(hdX,Y)
Here, replace (hdX,Y) with your Windows partition (you should know its name already).
chainloader +1
boot
That should boot you into Windows. My mission ends here; you'll have to repair Windows' bootloader but that's none of this forum's business. Hint: look for EasyBCD.
If you can't repair Windows' bootloader for some reason, plug in your USB drive and repeat the last six commands in the grub rescue
prompt to boot Windows.