PDA

View Full Version : Restoring win98 MBR with Knoppix CD



knophead
09-04-2004, 06:04 AM
I have (had?!) redhat 9.0 dual booting with win98SE. Tried the allegedly simple "FDISK /MBR" route to clearing out redhat so i could save some hdd space and just use knoppix CD and then ...

on boot i get the normal boot messages, windows boot begins and then i am left with just an "a>" prompt asking me to tell it where command.com is. I duly oblige and of course nothing happens. GRUB does not load so i have nowhere else to go.

I understand that i can use dd to restore the old 98 mbr from /boot/boot.b but wanted to save what is there at the moment by loading knoppix CD and going from there. I have successfully copied boot.d onto a floppy so have some insurance but then i tried

dd if=/mnt/hda1 of=/mnt/floppy/badmbr.bk bs=446 count=1

then i get "/mnt/hda1 is a directory" and nothing happens (I was trying to copy the mbr w/o the partition table to a file called badmrb.bk on my floppy).

Have also tried to go into rh 9.0 rescue mode but cant cd into hda2 (the linux partition) to track down boot.d - if i could I might just copy that straight to the windows partition and see what happens.

Am happy to try alternative approaches but i keep finding 80% solutions which dont quite seem to make it. Would be grateful for any suggestions people might have on this. general approach seems quite clear ie using "dd" but specific implementation under KNoppix is eluding me.

Thanks in advance.

firebyrd10
09-04-2004, 07:54 AM
/mnt is a directory, you need to send the file to /dev/hda BUT!

If you do chances are that file will become the new partiton, effectivly deleting your old files, not a good idea.

I would suggest http://www.ultimatebootcd.com/, it has alot of usefull programs.

What you will want off it is Ranish partition manager.

When it boots, go up to master boot record, then hit enter. Press space to cycle through the options and then pick normal (or standard, something to that extent). HIt ESC and make sure that your windows partiton is bootable, (should have a > next to it.) if it isn't, go down to it and hit B.

Then just hit F2, then ESC and reboot (with cd out of drive of course).

knophead
09-04-2004, 11:47 AM
thanks for this suggestion. I am actually ok deleting the old red hat partition files because i cleaned everything out first. what i need to do is to make the windows partitions boot properly. if that works then i can delete the old red hat partition, expand my win98 partition and just use my knoppix cd.

firebyrd10
09-04-2004, 05:02 PM
thanks for this suggestion. I am actually ok deleting the old red hat partition files because i cleaned everything out first. what i need to do is to make the windows partitions boot properly. if that works then i can delete the old red hat partition, expand my win98 partition and just use my knoppix cd.
Well not only just deleting but sending the file to a partition won't effect the MBR.

baldyeti
09-04-2004, 05:16 PM
Make sure it's your windows (hda1?) partition which is (and is the only one) marked bootable/active. This, along with "fdisk /mbr" should restore your windows boot sequence.

knophead
09-04-2004, 05:27 PM
hda1 is the windows partition - have checked and all files are visible etc under knoppix. is also only one under fdisk marked as "A".

fdisk /mbr is the thing i did which created this mess (first message up top gives details).

Have since tried a few more things.

1. tried copying boot.d backup (its redhat) to hda1

> knoppix@ttyp1[boot]$ dd if=/dev/hda2/boot/boot.d of=/dev/hda1 bs=446 count=1
> dd: opening `/dev/hda2/boot/boot.d': Not a directory

i hear what the message says but dont understand what to do about it.

2. then i copied the boot.d file to floppy and tried to copy from there.

> knoppix@ttyp1[boot]$ dd if=/mnt/floppy/copyboot of=/mnt/hda1 bs=446 count=1
> dd: opening `/mnt/hda1': Is a directory

similar (possibly opposite?) message and similar lack of understanding on my part(!)

Can anyone explain or suggest ways to get boot.d info back to hda1 so i can once more get win98 running (a sad excuse for an OS to be sure but it has all my data there ... )

Thanks

baldyeti
09-04-2004, 05:39 PM
Mmh... was your redhat lilo written to hda (mbr) or hda2 (RH root partition)?
Anyway if all you want to do is restore windows as the primary OS, boot from a win98 floppy, then issue "fdsik/mbr" and "sys c:" and you should be set.

knophead
09-05-2004, 04:37 AM
thanks for the new suggestion. Still no good but some error messages which may be helpful.

C:> sys c:
cannot specify default drive

and maybe more worrying on boot up with the system disk it gives me

MODE.COM either corrupted or missing

and it reports errors in my config.sys file at lines 35 and 36 which refer to MODE.COM

lines 35 and 36 (if i have counted right) are as follows:

install=mode.com con cp prepare=((850) ega.cpi)
install=mode.com con cp select=850

Is this indicating that the mode.com file on the system disk is bad :?:

firebyrd10
09-05-2004, 05:46 AM
Doesn't look like the poblem is getting windows to boot anymore. Its getting it to boot properly.

knophead
09-05-2004, 04:05 PM
small update:

A:> sys c:
invalid function

then still as before:
MODE.COM either corrupted or missing

errors in my config.sys file at lines 35 and 36:

install=mode.com con cp prepare=((850) ega.cpi)
install=mode.com con cp select=850

understand this not knoppix related anymore but if anyone knows the answer can they pls let me know.

Thanks

knophead
09-20-2004, 05:55 AM
All the problems I described seem to have been red herrings. I have now found both the problem and a solution. it was as in most of these cases both unexpected and simple.

I had installed Norton Systemworks 2003 on my windows partition which includes a limited version of Go-Back. Go Back makes changes to the master boot record which in turn lead to all of the problems outlined above. My problem was of course that when I got to the stage where i was given the message that i had to disable Go-Back I was already unable to boot windows and so could not do it by the normal route. In the end I found the link shown below on the Norton/Symantec website which referred me to a program (gb_prog.exe) on the Systemworks CD ROM which can be run from a system disk and which reverses the changes made to the MBR and so allows the FDISK /MBR command to work normally. Once this was done, everything was fine. Windows booted normally and i will now be able to use the copy of partition magic which i bought as part of my desparate search for a solution to resize the fat32 partition, erase my red hat and then install a new distro on my shiny new seagate 160Gb hard-drive which was also bought as part of this saga.

I hope this is useful to people.

=====================================

Go Back link (and full text)

http://service1.symantec.com/SUPPORT/goback.nsf/docid/2001092611363307?Open&src=bar_sch_nam&docid=2001101713193807&nsf=goback.nsf&view=8655ac7556510eca88256d4200687f49&dtype=&prod=&ver=&osv=&osv_lvl

How to remove changes that GoBack makes to the boot sector and partition tables of a computer

Situation:
When you start your computer, GoBack no longer launches correctly. You may also be unable to access your hard drive.

Solution:
Damage or changes to a computer's boot record may prevent access to the hard drive, causing the computer to stop responding or preventing access to information. By design, GoBack works with the boot record to provide system restoration capability. To troubleshoot problems with the boot record, you may want to remove the changes that GoBack has made.
--------------------------------------------------------------------------------
Notes:
The following instructions require a computer that can successfully start Windows 98/Me in order to create a Windows Startup disk. This computer does not have to be the computer you are trying to remove GoBack changes from.
Gb_prog.exe can be located in the GoBack installation folder (C:\Program Files\GoBack is the default location). Gb_prog.exe can also be found on the Norton SystemWorks CD in the \Support\GBTools folder.
If you have Norton SystemWorks 2002, follow the instructions in the document How to extract the Gb_prog.exe file from the Norton SystemWorks 2002 CD to extract the Gb_prog.exe file.
--------------------------------------------------------------------------------
To remove the changes that GoBack made to the boot record

Create a Windows Startup disk under Windows 98/Me. For more information, see the document How to create a Windows Startup disk.
Copy the Gb_prog.exe file to the Windows Startup disk. If there is not enough room to copy Gb_prog.exe to the Windows Startup disk, then copy Gb_prog.exe to a separate floppy disk.
On the computer that you want to remove the GoBack changes from, insert the Windows Startup disk and then start the computer. The computer has finished starting when you see an A:\> prompt and a blinking cursor.
Insert the disk that has the Gb_prog.exe file.
Type gb_prog.exe /u and then press Enter.
The utility removes the changes that GoBack made to the boot sector and the partition table and further troubleshooting can proceed. If this method does not successfully remove GoBack from the boot record, then see the document Cannot start Windows after installing GoBack.
--------------------------------------------------------------------------------
Note: This process does not entirely remove the GoBack program. Use the Add/Remove Programs utility in the Windows Control Panel to remove the rest of the GoBack program.
--------------------------------------------------------------------------------

[This text just to help people find this solution if doing web search: Cant boot windows but need to disable go-back. Go back changes mbr and prevents fdisk /mbr working. Error message says disable go-back but I cant start windows.]

Bernd Blaauw
09-22-2004, 04:59 PM
I have good experience (for restoring MBR, partition table and bootsectors) with a program called TESTDISK.

search it on the internet, it's small, GPL-licensed and multi-platform.

Saved me from 55GB data loss.

Did you recover you Windows by now?

knophead
09-25-2004, 12:26 PM
windows back up and running. all i did was mash the mbr so once fdisk /mbr had done its thing all was well.
now prepping for a fedora install on my new shiny hdd.