?
Solved

Remove Grub and restore windows boot

Posted on 2005-03-07
13
Medium Priority
?
3,292 Views
Last Modified: 2008-01-09
Hi

I had win_xp and RH9 on my PC (two hard disks) with Grub for dual boot.  I run out of space on my Win_xp hard disk  and decided to format RH9 as it was not used a great deal.  After formating I now cannot boot into windows as Grub still loads and complains that it cannot detect a kernel.
How do I restore windows master boot and remove Grub?  

Thanks

Ajdin
0
Comment
Question by:ajdinb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +2
13 Comments
 
LVL 57

Expert Comment

by:Pete Long
ID: 13475283
0
 
LVL 57

Expert Comment

by:Pete Long
ID: 13475289
ajdinb,
GRUB Legacy FAQ
GNU GRUB FAQ
 
[ French | German | Spanish ]


--------------------------------------------------------------------------------

0. I have questions about GRUB!
1. How does GNU GRUB differ from Erich's original GRUB?
2. Can GRUB boot my operating system from over 8GB hard disks?
3. Can I put Stage2 into a partition which is over 1024 cylinders?
4. How to create a GRUB boot floppy with the menu interface?
5. How to specify a partition? That seems to be very different from my operating system...
6. GRUB does not recognize my GNU/Hurd partition.
7. I've installed a recent version of binutils, but GRUB still crashes in the bootstrap.
8. I can't compile GRUB on Red Hat 7.0.
9. How can I specify an arbitrary memory size to Linux?
10. How to boot Windows (or DOS) from a non-first disk?
11. I have a separate boot partition on GNU/Linux (or another UNIX-like system), and GRUB seems not to handle this situation correctly.
12. How to uninstall GRUB from my hard disk drive?
13. GRUB hangs when accessing my large IDE disk.
14. GRUB hangs when accessing my SCSI disk.
15. I installed GRUB, but it just hangs up.
16. Why doesn't Linux (FreeBSD, NetBSD, etc.) become Multiboot-compliant?

--------------------------------------------------------------------------------

0. I have questions about GRUB!
First of all, read the document in the GRUB distribution enough carefully. You should be able to obtain most information from the document. This FAQ just gives you some hints.

Also, note that we don't accept bugs about unofficial versions, such as Red Hat's. Many versions distributed with GNU/Linux vendors are modified with their own patches, so not all bugs are reproducible in official versions. Thus, try the latest official version, before reporting bugs to us.

1. How does GNU GRUB differ from Erich's original GRUB?
GNU GRUB is the successor of Erich's great GRUB. He couldn't work on GRUB because of some other tasks, so the current maintainer Gordon Matzigkeit took over the maintainership, and opened the development in order for everybody to participate it.

Technically speaking, GNU GRUB has many features that are not seen in the original GRUB. For example, GNU GRUB can be installed on UNIX-like operating system (i.e. GNU/Linux) via the grub shell /sbin/grub, it supports Logical Block Address (LBA) mode that solves the 1024 cylinders problem, and TAB completes a filename when it's unique. Of course, many bug fixes are done as well, so it is recommended to use GNU GRUB.

2. Can GRUB boot my operating system from over 8GB hard disks?
That depends on your BIOS and your operating system. You must make sure that your drive is accessible in LBA mode. Generally, that is configurable in BIOS setting utility. Read the manual for your BIOS for more information.

Furthermore, some operating systems (i.e. DOS) cannot access any large disk, so the problem is not solved by any kind of boot loader. As long as I know, at least GNU/Hurd and GNU/Linux can boot from such a large disk.

3. Can I put Stage2 into a partition which is over 1024 cylinders?
Yes, you can, if your BIOS supports LBA mode. Although you had to use a special Stage1 in the previous version, it isn't necessary any longer, because Stage1 now supports both modes.

4. How to create a GRUB boot floppy with the menu interface?
Create a filesystem in your floppy disk (e.g. mke2fs /dev/fd0).
Mount the floppy on somewhere, say, /mnt.
Copy the GRUB images to the directory /mnt/boot/grub. Only stage1, stage2 and menu.lst are necessary. You may not copy *stage1_5.
Unmount the floppy.
Run the following commands (note that the executable grub may reside in a different directory in your system, for example, /usr/sbin):
/sbin/grub --batch --device-map=/dev/null <<EOF
device (fd0) /dev/fd0
root (fd0)
setup (fd0)
quit
EOF

5. How to specify a partition? That seems to be very different from the notation in my operating system...
Yes, GRUB's device syntax is very different from others, but somewhat resembles DOS and Windows 98. GRUB doesn't distinguish between IDE and SCSI, so your hard disk drives are represented as (hd%d) (%d is an integer, counted from zero). Likewise, your floppy drives are represented as (fd%d).

The point that confuses the users very much is the partition numbering style. GRUB counts partitions from zero, while almost all operating systems count from one. We will fix the inconsistency someday.

6. GRUB does not recognize my GNU/Hurd partition.
I don't know why, but the authors of FDISK programs have assigned the partition type 0x63 to GNU Hurd incorrectly. So use 0x83 if the partition contains ext2 filesystem, and use 0xA5 if the partition contains ffs filesystem, whether the partition owner is Hurd or not. We will use 0x63 for GNU Hurd filesystem that has not been implemented yet.

7. I've installed a recent version of binutils, but GRUB still crashes in the bootstrap.
Please check for the version of your binutils by this command:

$ ld -v

This will show two versions, but only the latter is important. If the version is identical with what you have installed, the installation was not bad.

Well, please try:

$ gcc -Wl,-v 2>&1 | grep "GNU ld"

If this is not identical with the result above, you should specify the directory where you have installed binutils for the script configure, like this:

$ ./configure --with-binutils=/usr/local/bin

If you follow the instructions above but GRUB still crashes, probably there is a serious bug in GRUB. Please report it to the Bug Tracking System.

8. I can't compile GRUB on Red Hat 7.0.
Have you seen this message? We never support any unreleased version of gcc.

9. How can I specify an arbitrary memory size to Linux?
Pass a mem= option to your Linux kernel, like this:

grub> kernel /vmlinuz mem=128M

You may pass other options in the same way. See the documentation for Linux, for available options.

10. How to boot Windows (or DOS) from a non-first disk?
Use the command map, to exchange BIOS drives virtually, like this:

grub> map (hd0) (hd1)
grub> map (hd1) (hd0)

11. I have a separate boot partition on GNU/Linux (or another UNIX-like system), and GRUB seems not to handle this situation correctly.
This is often reported as a bug, but this is not a bug really. This is a feature.

Because GRUB is a boot loader and it normally runs under no operating system, it doesn't know where a partition is mounted under your operating systems. So, if you have the partition /boot and you install GRUB images into the directory /boot/grub, GRUB recognizes that the images lies under the directory /grub but not /boot/grub. That's fine, since there is no guarantee that all of your operating systems mount the same partition as /boot.

There are several solutions for this situation:

Install GRUB into the directory /boot/boot/grub instead of /boot/grub. This may sound ugly but should work fine.
Create a symbolic link before installing GRUB, like cd /boot && ln -s . boot. This works only if the filesystem of the boot partition supports symbolic links and GRUB supports the feature as well.
Install GRUB with the command install, to specify the paths of GRUB images explicitly. Here is an example:
      grub> root (hd0,1)
      grub> install /grub/stage1 d (hd0) /grub/stage2 p /grub/menu.lst
     
12. How to uninstall GRUB from my hard disk drive?
There is no concept uninstall in boot loaders, because if you uninstall a boot loader, an unbootable machine would simply remain. So all you need to do is overwrite another boot loader you like to your disk, that is, install the boot loader without uninstalling GRUB.

For example, if you want to install the boot loader for Windows, just run FDISK /MBR on Windows. If you want to install LILO (I can't imagine why you want to do such a thing, though), run /sbin/lilo on GNU/Linux.
 
http://www.gnu.org/software/grub/grub-legacy-faq.en.html#q12
Pete
0
 
LVL 96

Accepted Solution

by:
Lee W, MVP earned 1000 total points
ID: 13475393
Actaully, you should probably use your XP CD and boot to the Recovery console.  Then use the FIXMBR and FIXBOOT commands in that and you should be ok.  
0
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
LVL 11

Expert Comment

by:DoTheDEW335
ID: 13476284
<<Actaully, you should probably use your XP CD and boot to the Recovery console.  Then use the FIXMBR and FIXBOOT commands in that and you should be ok.  >>

Thats what I would try 1st ;)
0
 
LVL 17

Expert Comment

by:ccomley
ID: 13479598
Grub takes over the Master Boot Record.

The MBR normally (on a windows machien) simply says "OK, we boot XP".  Yours now has more options - but more than you need.

The Windows disk partition managemnet program FDISK has a simple optoin to put the MBR back the way Windows likes it.

FDISK /MBR

You may find you need to be in Recovery Mode to run this successfully.

0
 
LVL 11

Expert Comment

by:DoTheDEW335
ID: 13480616
ccomley, you can also use fixmbr to do the same thing as leew posted above.
0
 

Author Comment

by:ajdinb
ID: 13494358
Thanks guys,

I was going to try FDISK /MBR option but my floppy drive died on me !!!????

Second option was Boot of the XP CD and run FIXMBR and FIXBOOT wich did the job.

Thank you all again
0
 
LVL 96

Expert Comment

by:Lee W, MVP
ID: 13494367
Excuse me - that was my comment!?!?!!
0
 

Author Comment

by:ajdinb
ID: 13494776
How do I change my  Accepted Answer?  Sorry about this, DoTheDEW335  cut/paste you answer which confused me thinking I was accepting
yours (leew).
0
 
LVL 11

Expert Comment

by:DoTheDEW335
ID: 13495681
Post a question in community support and leave a link to this question (Link : http://www.experts-exchange.com/Operating_Systems/WinXP/Q_21340275.html)

http://www.experts-exchange.com/Operating_Systems/WinXP/Q_21340275.html

Ask the moderators to fix it. They will just post in the above link it's free.
0
 
LVL 96

Expert Comment

by:Lee W, MVP
ID: 13497723
Thank You!
0
 
LVL 11

Expert Comment

by:DoTheDEW335
ID: 13498011
Sorry bout the confusion, I tried to use things like <<>> to show I didn't post it , I just agreed with him..
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Disclosure: Use this tutorial only when no other options helps to get Windows XP running without any problems and you don't want to format the drive. The back up of the data is the responsible of the user, however there is a description of how t…
Sometimes people don't understand why download speed shows differently for Windows than Linux.Specially, this article covers and shows the solution for throughput difference for Windows than a Linux machine. For this, I arranged a test scenario.I…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question