Help - Search - Members - Calendar
Full Version: Setting Up Grub
Linuxhelp > Support > Technical Support
iampayam
I used to have a dual-boot system with Windows XP and Mandrake Linux on different partitions of the same hard drive and used GRUB, which came with Mandrake, as a boot loader. Recently I wanted to uninstall Linux and use its partition for extra storage, so I used the Windows XP disk management utility to remove the linux partitions (there were three of them, one relatively big and two tiny ones) and reformated the resulting free space as a single NTFS partition (probably a big mistake!). Anyhow, now when I boot my computer I still get GRUB, but it is in command line mode and I dont have the list of operating systems in a nice menu interface like I used to. I have to go through the command sequence:
----------------
rootnoverity (hd0,0)
makeactive
chainloader +1
boot
---------------
in order to boot Windows XP and this works just fine, but I wanted to know if there is any way to install the GRUB menu interface again and have it boot windows XP from the first partition on hd0 by default. Also, since I removed the linux partitions, I can't figure out where GRUB is loading from. Could it be residing on my newly created NTFS partition as a ghost? If so, its code is eventually going to be overwritten and become unusable as I fill up my NTFS partition. I hope this is not the case, because that would mean my computer can become unbootable all of the sudden. Does anyone have any insight?

Thanks in advance.
michaelk
grub is a 2 stage boot loader. The initial stage is located in the Master Boot Record (MBR) and the 2nd i.e. the menu i.e. grub.conf or menu.lst is (was in your case) located in your /boot. Since you deleted your linux partitions grub can not find the menu and all you get is the prompt.

To restore the windows bootloader boot up the XP install CD to recovery mode and runt the fixmbr utility. If you have a recovery CD instead of a install CD you will need to find / download the windows 98 fdisk utlilty along with a DOS boot floppy and run fdisk /mbr.
iampayam
One problem though... When I was initially partitioning my hard drive I used the partitioning utility that came with the Linux install disk (because frankly it was much easier to use than the Windows partitioning utility!) Because windows did not create the partition table, when I go to use fixmbr, I get a warning message that the partition table is non-standard and if I continue some of my partitions may become inaccessable.
hughesjr
Instead of a DOS disk, you might try booting from a Windows XP disc and entering the repair console and useing the fixmbr and/or the fixboot commands.
iampayam
OK, for anyone following up on this topic this is what happened:
As I suspected part of GRUB was still residing (I think!) on the old linux partitions that I had deleted and replaced with an NTFS partition. The MBR must have been referring to it by an absolute sector address or something. As I added more files to the new NTFS partition GRUB eventually got corrupted. When I booted it would attempt a boot from CD eventhough there was no CD in the drive and then it would display the GRUB> prompt but I couldn't type anything in. I booted with my Win XP CD went into install-repair and used the fixmbr and fixboot commands and this fixed everything and fortuantely none of my partitions were lost. Hope this helps someone else. Thanks for all those who posted.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.