LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Using GRUB to boot Windows 7 (https://www.linuxquestions.org/questions/linux-newbie-8/using-grub-to-boot-windows-7-a-919233/)

johnvo 12-17-2011 01:56 PM

Using GRUB to boot Windows 7
 
How do I boot Windows 7 from a grub> prompt?


A little background:
I was playing with some partitions in WINDOWS 7 and I deleted a partition that (unbeknownst to me) was important because now I can't get back into Windows 7 after a restart. Instead, I am at a "grub>" prompt at bootup. I'm running GNU GRUB version 0.97.

I tried "root(hd0,<tab out>" gave me:

Possible partitions are:
Partition num:0, FIlesystem type unknown, partition type 0x7
Partition num:2, FIlesystem type unknown, partition type 0x7
Partition num:3, FIlesystem type unknown, partition type 0x7

So I tried typing all three possible partitions. No luck. Help?

johnvo 12-17-2011 02:18 PM

Answer
 
Chain-loading:
If you want to boot an unsupported operating system (e.g. Windows 95), chain-load a boot loader for the operating system. Normally, the boot loader is embedded in the boot sector of the partition on which the operating system is installed.

Set GRUB's root device to the partition by the command rootnoverify (see rootnoverify):
grub> rootnoverify (hd0,0)

Set the active flag in the partition using the command makeactive1 (see makeactive):
grub> makeactive

Load the boot loader with the command chainloader (see chainloader):
grub> chainloader +1

`+1' indicates that GRUB should read one sector from the start of the partition. The complete description about this syntax can be found in Block list syntax.

Run the command boot (see boot).
However, DOS and Windows have some deficiencies, so you might have to use more complicated instructions. See DOS/Windows, for more information.

akuthia 12-17-2011 04:22 PM

Do you also have a version of linux installed? what is the need for grub in this situation? did you try to install it so you could boot into windows?

if you're just trying to "fix" booting into windows (with no consideration of any other OS's) then you can load your windows media and run the repair wizard which should fix the mbr


All times are GMT -5. The time now is 06:56 PM.