LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Getting rid of GRUB (https://www.linuxquestions.org/questions/linux-general-1/getting-rid-of-grub-41079/)

HwzrHlslndr 01-11-2003 08:29 AM

Getting rid of GRUB
 
I used family machine to test drive Linux (dual boot with Windows 98). I love Linux and have since built my own machine with only Linux on it. This morning I tried to rededicate the old machine to windows for the kids. Using Partition Magic, I removed the partitions for Linux. When rebooting, Grub prompt comes up and I can't seem to get around it.

Anyone have suggestions? This is a pretty serious situation here as far as the kids are concerned.

HwzrHlslndr 01-11-2003 08:48 AM

More info...
Possible commands are: background blocklist boot border cat chainloader cmp color configfile debug display displayapm displaymem embed find foreground fstest geometry halt help hide impsprobe initrd install ioprobe kernel lock makeactive map md5crypt module modulenounzip partnew parttype password pause read reboot root rootnoverify savedefault serial setkey setup shade splashimage terminal testload testvbe unhide uppermem vbeprobe viewport

deadbug 01-11-2003 09:01 AM

Been there, done that and got the tee-shirt.

Grub was in your MBR and now cannot find its files it had put on the now-deleted Linux partitions. You want to put your Windows computer back to the way it was. It is as simple as having Windows put its boot loader back in the MBR.

If you have a Windows boot disk, use it to start the computer and type this:

fdisk /mbr

Windows will overwrite the non-working Grub with its original, working boot loader.

If you don't have a boot disk, use the Windows 98 CD and have it do a Rescue boot (I think it does that). You do not want to reinstall the program, though! This would start your computer and allow you to access fdisk from the hard drive.

Your computer will work, the kids will be happy, you will be a hero!

Good luck

HwzrHlslndr 01-11-2003 09:25 AM

Deadbug, I do appreciate your suggestions. Unfortunately, the system did not come with a windows CD--a practice I think is terribly wrong--and I could not find a boot disk. Royally screwed here...

I am reinstalling Linux right now to see if that helps me.

HwzrHlslndr 01-11-2003 09:55 AM

Deadbug,

It would appear that all is well here after reinstalling RH8 and letting it create the partitions again. (Wiping sweat from brow)

I guess I will get my act together before I try that again. I was drastically unprepared. lol

Thanks, man!

deadbug 01-11-2003 10:06 AM

Yeah, reinstalling Red Hat, put Grubs configuration files back on and will now let you start both programs. If you still want to remove Red Hat from the computer, first, use Windows to fix the MBR, then delete the partitions. With Windows now working, load it and at a DOS prompt type:

fdisk /mbr

This will overwrite Grub and then you can delete the Red Hat partitions and rededicate that space to Win98.

Glad to hear you are at least out of the dog house now!

HwzrHlslndr 01-11-2003 10:28 AM

Deadbug, I have my courage back and so I did the fdisk /mbr at DOS prompt. I then thought I'd reboot to see the effect. My assumption was that it would boot Windows. Instead it says "Missing operating system"

What now, mate?

Should I boot with Partition Magic disk and just delete the partitions? It doesn't feel right...

HwzrHlslndr 01-11-2003 01:58 PM

Deadbug,

A couple of things... First: I am having trouble with affero. Don't know why. I have used it before, but can't seem to today. I will get it straightened out and I won't forget you for the help with smartes' post.

Second: I am back to square one--a dual boot system that I'd like to re-dedicate to windows exclusively. The last thing you told me was to fdisk /mbr and then remove linux partitions with Partition Magic, but I am a little gun shy as a result of what I just went through. I can only assume that I should do it again and carry on to the second step which is remove the linux partitions, but I am very weary, as Linux was what enabled me to fix the missing operating system problem. If it's gone I fear I will be hopelessly lost.

deadbug 01-11-2003 02:04 PM

Don't delete them yet--we need to get your system running until we can make sense of this.

Put the Red Hat boot disk in and get linux running. In a terminal window, type:

grub-install /dev/hda

That will get Grub working again.

Now, back to the basic idea--obviously, "Missing operating system" wasn't supposed to happen!

Does Windows boot with Grub installed?

Anyone else who is looking at this have any ideas? A non-NT system (Win98) and fdisk /mbr didn't fix the MBR.

deadbug 01-11-2003 02:17 PM

Looks like we're posting at the same time!

Sorry about the confusion over grub-install and /sbin/grub-install. I thought Red Hat would put the /sbin directory in root's path; apparently not. I'll keep that in mind in future posts!

Anyway, your system is back working as a dual boot and I'm heading away for the weekend. Let's give it til tomorrow evening to see if someone can help us with why fdisk /mbr didn't work.

Have a good one

HwzrHlslndr 01-11-2003 02:41 PM

Deadbug, ok. I am happy to sit on my hands for a while. I am still having trouble with affero, but I want you to know I really do appreciate your help.

Have a great weekend and be safe.

Kind regards,
TAH

mcleodnine 01-12-2003 02:34 PM

Just a thought - check the partitions (with msdos fdisk) and make sure that the Windows partition is marked active. You may need to try the fdisk /MBR again.

HwzrHlslndr 01-12-2003 02:40 PM

msdos fdisk? I'm afraid I may need some very specific instructions here to do what you suggest, i.e., to check if they're active.

Regarding trying fdisk /MBR again: I have done that per your suggestion to someone else. In fact, I did it twice and with the capitals (MBR). No luck. I get "Missing operating system" just as before.

mcleodnine 01-12-2003 03:03 PM

You need the windows/dos version of fdisk and it has to be the same dos/win version as what's on your machine.

The fdisk application is menu-driven dos utility and it''s pretty much self-explanatory. Unfortunately I don't have a dos console to test on at the moment otherwise I could refresh my memory.

HwzrHlslndr 01-12-2003 03:34 PM

hmmmm

I am not sure how to proceed from here.... "You need the windowos/dos version of fdisk...[same as what's on your machine]"

I'm lost

bulliver 01-12-2003 03:56 PM

It will be on the windows boot disk if you made one, or else it will be on the windows install cd's.

deadbug 01-12-2003 05:37 PM

In researching this, I found an instance of someone emphasizing running fdisk from the floppy. I'm scratching my head wondering if that makes a difference. Willing to experiment? Getting back to what you have now is as easy as booting Red Hat from a floppy and issuing /sbin/grub-install /dev/hda.

The experiment: In Windows, make a boot floppy (can Win98 do this by formatting it and checking the "Add System File" box?) and copy fdisk.exe to it. Boot the floppy to a DOS prompt and try fdisk /mbr again.

Whatcha think?

smartes 01-13-2003 05:41 AM

Hello again -

You do not have an install CD for Windows? If you had you could have logged on to the recovery console and chose repair which would take you to a DOS prompt where you can type the command: fixmbr
After I did fdisk /mbr - I was getting Operating System not found. But the fixmbr did not work - I then got NTLDR not found - I gave up and installed XP again (which took an hour). But it took much longer to get my XP configured to what it was previously. I am now trying to get up my courage to run grub-install /dev/hda once more.

But sorry - I do not know how I can help

thackerd 01-14-2003 01:20 AM

same problem
 
I'm having the smae problem of not being able to access windows. everything was working fine as a dual boot system, until I ran the auto update in gnome. from then on if I tried running window from Grub, it wouldn't work. I booted from a windows floppy and tried to access the C: drive and got an invalid media error. I double checked that the windows partition was the active partition using fdisk, then I ran fdisk /mbr and rebooted and I get the error message "missing operating system". What now? I vaguely remember there being a way to copy the system files onto the C: drive without having to reformat that drive, there is still data on there I want/need.

Dave

deadbug 01-14-2003 07:17 AM

I'm experimenting (I have a system with Win98--actually two) with the options you are talking about and I want to try WindowsBBS to see if they have any ideas.

Thackerd, I agree with you that if we're just missing the operating system, there is a non-destructive way to restore it. Keep in mind, that even if you have to reinstall Windows, that doesn't delete your data, so you can relax a little bit about that.

I think the situations are a little different. TAH can boot Windows through Grub without getting an error; you get the error with both boot loaders.

Anyway, our dilema is that any pre-Win2K fdisk.exe should have fixed this problem with fdisk /mbr. In both of your cases, it didn't. Our much-touted fail safe repair failed. Here are the options I would suggest we pursue:

1. Look for what went wrong with fdisk. Is it as simple as you can't run it on the drive you booted from (you have to boot from a:\ to fix c:\)? I don't know, but I'd like to look at exactly what both of you did--how you booted the computer, where you executed fdisk from, what version of fdisk are you running, etc. Also, are you running Win98 or Win98SE?

2. Is there a Win98 equivalent to NT's fixmbr & fixboot commands. To fix this problem in NT, we'd put in the Install CD, boot to Rescue console and run those two commands. Unlike fdisk /mbr, which is an undocumented fix, this one is documented on the Microsoft tech pages. Can we find a tech page that discusses this and has a part the says, "However, if you are using Windows 98, do this . . .?" Can we find the Win98 versions of fixmbr & fixboot. It would help if both of you would do a search for fix* on your Windows systems.

3. What is the best way to restore your .sys files to your root system? Again, the Microsoft tech pages talked about formatting a floppy and putting the system files on it, then copying them to c:\. Dave do you have a boot disk or Win98 CD? If we start heading down this path, you're going to need one or the other.

Please take some time and fill in what you can from above and then we'll start searching the internet.

mcleodnine 01-14-2003 07:47 AM

My advice to anybody with this problem at the moment is that if you have a bootable linux partition you should mount the windows partition and back up any critical data ASAP.

Also - is anyone here having the same problems on systems with lilo as the bootloader?

HwzrHlslndr 01-14-2003 09:56 AM

I will try to provide some answers to the questions above this evening if I can find the time. I apologize for the delay, but Linux is only at home and work has been keeping me away since the weekend.

Thank you Deadbug, et al for your help!

Kind regards,
TAH

HwzrHlslndr 01-14-2003 09:59 AM

Deadbug, I am willing to experiment and will run what you suggest this evening--I hope. I'm not afeared! I have been to hell and back and I remember the way.

thackerd 01-14-2003 10:44 AM

1) I booted from floppy and fdisked from their to, can access anything on the C: drive

2) Will do a fix* search tonight

3) I have a Windows boot disk and CD. FYI I boot from disk and tried "copy command.com c:" and it wouldn't

----------------------
How do I mount the windos partition to make back up of files, once that's done we can play all we want.

I haven't tried lilo yet, but based on the fact that with out a boot loader it still won't boot the windows partition, so I figured the problem wasn't the boot loader.

Dave

KnightAbel 01-14-2003 01:41 PM

just to be sure, windows is on the first partition, right? or have you done something funky with it?

deadbug 01-14-2003 04:17 PM

Abel brings up a good point.

Tom, you used Partition Magic to make room for Linux. What did you do? Also, you mentioned that you don't have the Install CD because didn't ship that way--any chance we're dealing with a Dell computer?

Dave, any of this apply to you?

The notion that hit me was the hidden partition that many manufacturers put at the front of a computer drive. It's purpose is for reinstalling the OS and it is only about 30 MB (1/3 of a small Zip disk). So that Windows can be installed on the first partition, this little one is hidden and the Windows (second) partition is set active as C:\.

If something were to unhide the first partition, the BIOS would call it C:\ and try to go there to load something that wasn't there: Missing Operating System.

Tell me how far off track I am

mcleodnine 01-14-2003 04:21 PM

Hidden partition.... you mean like the old Compaq partition at the end of the drive. They were visible thru fdisk as type 'other'.

As far as I know, windows _really_ wants to be the forst partition and my guess would be that it would choke on the hirst one.

Partition magic - that may be one of the problems and potentially a sulution. Can the machine be booted from PM?

thackerd 01-14-2003 04:39 PM

partitions
 
I used fips to split the windows partition, then during the installation I used disk druid (it wouldn't let me automatic) currently
dev/hda1 is ext3 102MB
dev/hda3 is swap 1028MB
dev/hda4 is extended
dev/hda5 is ext3 18873 MB
dev/hda2 is Win95 FAT32

all that said I seem to remember there being another really small partition (the 2 MB, added onto the 100MB boot partition) that during creatig and deleting Linux partions isn't there. But that doesn't explain why the dual boot worked until I autoupgraded (Kernel included) {which by the way gave me 4 options to boot from in Grub (the old kernel, the new kernel, the new kernal w/ debug and windows, which stopped working at that point. Granted there may have been something I did before that that didn't manifest itself till I tried to boot into windows to get the IRQ for the sound card?

So maybe somehow there really was some 2MB partition on the hda and it got deleted, and that was where windows was "booting" from?

Dave

thackerd 01-14-2003 04:39 PM

ps, hda5 is nested on hda4

HwzrHlslndr 01-14-2003 05:15 PM

Deadbug, et al,

There has been so much in this thread and I have been able to attend to this issue only sporadically since the work week began. I must say, I am having some trouble getting my head around all of this, but...

The way I got back to the dual boot system is I re-installed Linux and let the partitions get built by the install.

I do now have a windows boot disk. (Basically, the only problem I have with Windows right now is--because I began to run the restoration CD at one point last weekend--when it boots it tells me to insert the Windows OS CD. I hit F10 to exit the restoration and I am back to the Windows as always.

I am willing to try whatever the consensus is here in an effort to drop Linux and re-dedicate this p.o.s. to Windows--how appropriate. (lol) I now have a degree of confidence that I can get back to this point if an experiment fails. If not, I'll advertise "Electronic boat anchor for sale." (let's hope it doesn't come to that.)

Kind regards to you all and I apologize again for having not been able to dedicate more time to this of late. It is still an issue here so please do not think that I have given up.

TAH

deadbug 01-14-2003 06:02 PM

Dave, amigo, partner -- what did you do to that drive????

Actually, your problem looks fairly straght forward. Use your Linux boor disk and get Linux up; log in as root and open a terminal window. Type this to reinstall Grub:

/sbin/grub-install /dev/hda

Then, just for grins, open /etc/grub.conf and post the contents. In Red Hat, the easiest way is Start, Run Program and enter this in the window:

gedit /etc/grub.conf

Copy and paste this into one of your next posts.

Reboot and see if everything works.


Tom, this thread is getting kind of long, isn't it? If you can grit your way through getting Windows up, Partition Magic will give you the partition information I'm looking for--we're looking for something in front of your Windows partition.


mcleodnine, no, I'm not talking about something at the end of the drive; it is at the beginning of the drive. You are absolutely correct that up through Win2K, Windows pretty much insisted on having the first partition and will refuse to boot if it doesn't have that. How everyone (including Grub) gets around that Windows uses what the BIOS (or subsequent boot loader) passes to it--it doesn't check the disk's geometry. A hidden partition is ignored by the BIOS and the "first" partition designation is given to the second one. The Dell on my desk has this system and my MSCE told me it is quite common for computer manufacturers to do this today. It allows them to clone drives and only send Recovery disks instead of the normal install disks. It's a Brave New World, my friend.

KnightAbel 01-14-2003 10:39 PM

Yeah, I read thru the thread, and the fact that nothing worked got me thinking. You're not gonna have any luck booting windows off the second partition, so if I were you I'd back up windows and do a complete reinstall, that is, if you want to restore everything.

When you repartition your system before reinstalling windows, make sure to run 'fdisk /mbr' so the master boot record is rewritten

deadbug 01-15-2003 06:48 AM

Abel, I don't think we're at the sledgehammer stage yet. I don't think this is an MBR problem. I think they both successfully rewrote their MBRs, but when the Windows boot loader in the MBR tried to start the first partition, it didn't find Windows. Here's what I did on my computer:

The system I worked on used LILO to dual boot Win98SE (first partition) and Mandrake 8.0 (all the rest). I started Windows and issued fdisk /mbr. I rebooted to a normal Windows boot process. Used the Mandrake boot disk to start Mandy and reinstall LILO. Everything worked as advertised.

Here is where I think each of them stand:

Dave: His solution is pretty obvious to me. Based on how he's laid out his hard disk, when he installed Linux, he moved his Windows partition so he could put his /boot partition up front. He now has a bootable partition before his Windows partition, which the Windows boot loader cannot handle. Reinstalling Grub should fix this. But, if Windows still won't start, modifying grub.conf to hide the first partition will clear that up. I think he is just about fixed.

Thomas: I'll bet when he posts back he will report a small partition in front of his Windows partition. He has Partition Magic, so his solution is probably to use it to make the second partition the active one (hiding the first) and fdisk /mbr his hard drive. Unless he reports back that there isn't a little partition up front, this ought to head him to where he wants.

Comments?

thackerd 01-15-2003 08:17 AM

tried
 
ok, here's the grub.conf:
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/hda5
# initrd /initrd-version.img
#boot=/dev/hda
default=1
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
title Red Hat Linux (2.4.18-14)
root (hd0,0)
kernel /vmlinuz-2.4.18-14 ro root=LABEL=/
initrd /initrd-2.4.18-14.img
title Windows
rootnoverify (hd0,1)
chainloader +1


ok, rebooting now
Dave

thackerd 01-15-2003 08:34 AM

no luck, same problem.
2 questions:

1) how do I back up the few files on the windows partition ( I can't get to it)? I'm assuming mnt it, but how?

2)suggestions on changing he grub.conf?

Dave

HwzrHlslndr 01-15-2003 03:41 PM

Deadbug,

What would you like from me, contents of grub.conf or something from Windows? In your 12:02 post you mentioned booting into Windows and then using Partition Magic. Sorry for my ignorance, but I am no expert when it comes to Partition Magic. I have only used it to boot from, so if I need to do something differently after windows is up and running, please advise.

I have some time to devote to this this evening for a while.

Regards,
TAH

HwzrHlslndr 01-15-2003 03:44 PM

I just ran Ptedit from Partition Magic disk one for kicks. I see the partition table editor. I'd be happy to report on what I am seeing if this is any help.

HwzrHlslndr 01-15-2003 03:48 PM

I just ran the fdisk from same disk--again, for kicks--and there is something that appears to be this small partition you've mentioned in other posts. It has no drive number; it immediately preceeds FAT32; it starts at 0 and ends at 5.

This help?

Courageously yours,
Thomas

deadbug 01-15-2003 04:16 PM

That is it Thomas--let me look at Partition Magic when I get home and I'll try to get you the instructions that will hide that little sucker!

Dave: Let me get home and I'll get the changes to grub.conf that should fix this.

Ciao

deadbug 01-15-2003 06:42 PM

I'm Home!

Thomas: In Partition Magic, select the little partition (highlight it) and then from the top menu: Tools, Advanced, Hide. Select the next partition and see if Tools, Advanced will let you Unhide or make Active that disk. If it doesn't, don't worry about it--it should mean that it is already set.

Now, before you do this, be prepared to not boot through the Linux boot loader again. I would recommend having a Win98 boot disk with fdisk.exe copied to it standing by. I'm not talking about the one that Windows created, but a basic DOS boot disk. If you don't have one, just put a blank disk in and format it. When the format window pops up, the bottom option lets you add the system files to it. Check that and hit start. Before removing it, copy fdisk.exe and sys.com to it.

Make the PM changes and reboot the computer. It should start to A:\. Try changing to C:\ If you get your Windows partition, do the fdisk /mbr thing again and reboot your computer.

If you get a "Missing Operating System" error this time, reboot from the floppy and issue: sys c:\

Reboot.


Dave, log on to Linux as root and open /etc/grub.conf with a text editor. One easy way is in the Run Program menu, type: gedit /etc/grub.conf

Big picture, we want to hide the first partition when Windows boots and unhide it when Linux boots. Grub numbers from zero, instead of the Linux standard of 1. So your first partition on your first drive is hd0,0. In your grub.conf file you have two lines starting with title--title Red Hat ... and title Windows. After each of these lines we want to add a new line like this:

title Red Hat ...
unhide hd0,0

title Windows
hide hd0,0

Save the file and reboot.

Please let me know how this works out.

HwzrHlslndr 01-15-2003 06:57 PM

Aah crap, Deadbug! Once again we're not on quit ethe same page. You seem to be talking about some GUI interface, but what I described to you about the "little sucker" we want to kill is on a console from double clicking on Fdisk on the floppy disc with Windows up and running.

I am going to boot Windows now from PM to see if I can see what you are describing.

TAH

HwzrHlslndr 01-15-2003 07:06 PM

Oh man, yet another thing to deal with... (still smiling)

If I boot from PM disk I am prompted to insert second disc--that's normal, but then I get the following:

"PowerQuest PartitionMagic has detected an error 116 on partition starting as sector 1951875 on disk 1.

The starting LBA value is 19518975 and the CHS value is 164505559.

The LBA and CHS values must be equal.

PowerQuest PartitionMagic has verified that the LBA value is correct and can fix the CHS value.

Would you like [PM] to fix this error?

YES or NO"

Now, common sense tells me to just hit YES, but I'm sure you can understand that I want to avoid any more unknown variables, so I present this info to you, my mentor...

Awaiting my marching orders...

Sincere regards,
Thomas

HwzrHlslndr 01-15-2003 07:16 PM

by the by...

I suspect the reason for this message is because I let the partitions get rebuilt by the Linux re-install. I am pretty sure I have not re-entered PM since I did the Linux re-install

HwzrHlslndr 01-15-2003 07:36 PM

OK. I did what intuition told me: I clicked on YES.

Once back in the PM GUI I highlighted the little one ahead of FAT32 and in the Tools menu all that is available is BootMagic Configuration.

I have looked under other menus in PM and see nothing that seems intuitive toward what you have suggested.

Dumpsterm0uth 01-15-2003 07:42 PM

Getting rid of grub or any boot loader you need a windows floppy disk, and boot it up, and type "fdisk /mbr" and it will reset boot mbr.

deadbug 01-15-2003 07:43 PM

Okay, in Partition Magic (I'm using 7.0) lets me either pick from the graphic or a list of partition in the window below.

My apologies is my post was confusing. I didn't mean to boot from the PM CD (I think it gives you different options), but to boot Windows and from within it lauch PM. Since you reinstalled Windows, you may need to reinstall PM.

If this is too much of a pain, let me know and I'll figure out how to do it through fdisk.

Hope this helps

firemoth 01-15-2003 07:45 PM

Go into fdisk. Say set active partition (or something like that) to set only your windows partition active, then check to make sure no other partitions are set active (I think option 4 on the fdisk menu to see the partitions). Close it. Run fdisk/mbr and reboot. Voila.

HwzrHlslndr 01-15-2003 07:50 PM

I think I am going to have to do this from console screen after windows is up and running and I insert PM disk and double click on fdisk. This presents me with the following options:

1. Create partitions
2. Delete partition
3. Select bootable partition
4. Re-write Master Boot Record

DumpsterMouth, I am happy to hear suggestions as long as you understand what I've been through so far....It's been a long journey. You should be aware, I do NOT have a windows OS CD.

Comments?

Deadbug? You still with me, man? (lmao. That sounded like I was in an ambulance with deadbug holding my hand)

Sincerely,
Thomas

firemoth 01-15-2003 07:56 PM

In that case, just make your windows partition bootable (option 3) and then re write the MBR (option 4)

deadbug 01-15-2003 08:04 PM

I'm back--yep, Option 3, then 4 should do it.


All times are GMT -5. The time now is 04:01 PM.