Link to home
Start Free TrialLog in
Avatar of ahoffmann
ahoffmannFlag for Germany

asked on

damaged MBR

After doing a
  convert C: /fs:ntfs
the MBR is damaged that way it didn't find anything on the disk, even ntld( no message at all after reboot).
After connecting the disk as second drive, I can access all files on all partitions. So I'm pretty shure that the FS and the partition table is ok. NT's and Linux's fdisk show the right partition table, while dskprobe shows useless data.
ERD didn't reinstall a valid MBR too.

How can I get (and store) a valid MBR on this disk?
Avatar of BlackMan
BlackMan

FDISK /MBR should do it...
Avatar of ahoffmann

ASKER

Which fdisk (does NT have one)?
DOS' fdisk didn't help.
Hmm, I did it with a DOS 6.22 FDISK a couple of month ago?! What is the error? Or did it just not fix the problem?
DOS' fdisk didn't work, just hangs (not shure if there was no message at all or "no operating system founs")
You did call it with /MBR? As fas as I remember, this switch is not available before DOS 6.0
DOS 6.20: fdisk /MBR
Just checked with MS, seems like I was wrong about the DOS version..
Check
http://support.microsoft.com/support/kb/articles/q69/0/13.asp?FR=0

BTW., just don't have BIOS Boot-sector virus protection enabled? This will prevent you from creating a MBR.
Avatar of Lee W, MVP
A DOS Fdisk/mbr may not work with an NTFS drive.
I've gad to do the fdisk /mbr on a number of NTFS drives because of a virus problem at one of my sites.

Used dos 6.21 disk with no problems
1)open dskprobe
2)click 'drives | physical volume'
3)double click the correct drive, then click 'set active' on the handle
4)click 'sectors | read' sector 0, # of sectors 1
5)click 'view | bytes'
at offset 0000, the first byte pair should be FA
at offset 01F0, the last 2 byte pairs should be 55 AA
There should be nothing between offset 00E0 and 01A0 except 0's
if there is you proabaly have a bootsector virus
If partition 1 is supposed to be active, you should have an 80 at offset 01BE. If partition 2 is supposed to be active, then the 80 would be at 01CE, etc...
If you want, you can click on 'file | Save as' and email me the sector at joey@minckler.net

fdisk /MBR didn't help (it's NTFS, read the question).

jminck, I also played with dskprobe (see question) and I did not
try to change and save anything 'cause it definitely shows a wrong partition table, which in fact, is ok (tested with several fdisk). Unfortunately dskprobe writes 512 bytes, as far as I understand, and this may destroy my working partition table.
I'd like to do dskprobe, if I'm save that it will not destroy my partition table ('cause then I'll loose my data).

About viruses, I cleand the first 448 bytes of the MBR, then used all methods described here before without success. If it's a virus it must be in all my fdisks *and* convert *and* several MBRs from other installations I tested, unbelievable.
Adjusted points to 500
There is only one way to repair a mbr or for that matter any corrupted installation of Nt.

You will have to have the 3 windows setup floppy disks that come with nt or you can make and boot off of disk 1 and then follow the prompts to repair the boot sector, it should beable to repair the Mbr and allow your system to boot up into Nt once again. Nt will ask you if you have a repair disk if you don't it makes things harder but should still beable to be done.

You can create setup floppys from a Windows 95 Box or another machine by using this procedure.

goto start and then run and type after inserting the Nt cdrom in the cd drive.

d:\i386\winnt.exe /ox   This will work on an Win95 Box.

where d:\ is your cdrom letter


How to: Create setup disks.
Solution:

At the command prompt, change the directory to x:i386 is (where x is the CD-ROM drive). Enter the following at the command prompt:
START WINNT32 /OX


1) Open the 'Command Prompt'.
2) At the command prompt, to change to the CD drive enter:
CD /D x:
(where x is the CD drive letter).
3) Insert the Windows NT 4.0 Server installation CD.
NOTE: The 'Windows NT CD-ROM' dialog box appears; close this dialog box.
4) Enter the following to change to the i386 directory:
CD I386
5) Enter the following at the command prompt:
WINNT32 /OX
NOTE: NOTE: If the Setup disks are being created on a DOS, Windows 3.x or Windows 95 machine, use the command WINNT.EXE.
(The 'Windows NT 4.0 Upgrade/Installation' dialog box appears.)
6) Click 'Continue'. (A new 'Windows NT 4.00 Server Installation/Upgrade' dialog box appears.)
 Windows NT 4.00 Upgrade/Installation
7) Label 3 blank formatted diskettes as follows:

a) 'Windows NT Server Setup Disk 3'
b) 'Windows NT Server Setup Disk 2'
c) 'Windows NT Server Boot Disk'

8) Insert the disk labeled 'Windows NT Server Setup Disk 3' into the floppy drive.
 Insert Setup Disk 3
9) Click 'OK'. (Files are copied to the diskette; a new dialog box appears, prompting the user to eject the diskette and insert 'Setup Disk 2'.)
10) Insert the disk labeled 'Windows NT Server Setup Disk 2' into the floppy drive.
 Insert Setup Disk 2
11) Click 'OK'. (Files are copied to the floppy diskette; another dialog box appears prompting the user to eject the diskette and insert 'Boot Disk'.)
12) Insert the disk labeled 'Windows NT Server Boot Disk' into the floppy drive.
13) Click 'OK'. (Files are copied to the floppy diskette.)
 Insert Setup Boot Disk

Good Luck


wayneb, please read my question: I still said that ERD didn't help
Also keep in mind that my ERD is made from FAT and I'm now to boot on NTFS, There is also no MBR on ERD, it must be made before using dskprobe :-O
Setup "constructs" an MBR, but where did it get its information from?

PLEASE, read the question before posting huge useless texts :-(
ahoffmann,
I'm not trying to waste your time, but it sounds like you may be screwed. Do you have some unused hardware lying around? if so try this. Get some similar hardware together and try a repair installation to a different physical drive and use FAT. Swap the drives and try to boot up. This may get you up and going.

I know there is no finesse to this approach, but it may provide quicker results than trying to figure out the boot sector of the original drive.

You may even want to convert the new drive to NTFS while it is in the new PC. reboot and test before swapping to verify that it will work prior to moving to the old platform.

Ignore errors logged into the event viewer as they would probable be drivers that will work once thw drive is moved into the old machine.

As always, Good Luck
tcalesa, what do you mean by:
"try a repair installation to a different physical drive"

How will I do a repair installation?
BTW, I know that my pertition *is* NTFS and working as 2'nd drive'

So, the question is very simple:
  how can I make a valid MBR for 2'nd drive on the 2'nd drive
If this works it should be easy to patch this MBR to be used as 1'st drive and swap the drives.
Or am I barking up the wrong tree?
Ok, my only suggestion is this:  

Reinstall nt to a different location.  This should rewrite the masterboot record.

Something else you can do to boot up to the partition (not that you want to do this all the time)
is create an NT boot disk.  See:
http://support.microsoft.com/support/ntserver/serviceware/10140511.asp
What I meant was try to get NT set up on a different computer on a similar drive and then move the new drive to the old CPU "box".

I assume you have the ERD. Run setup on another PC with a sililar  Hard drive scheme and do an ERD installation on the clean hardware.
Then just move the new hard drive to the old hardware.

I rarely like to say reinstall, but it may be your only option at this point.

Actually, leew's suggesstionmay work and better. Try it and if it doesn't work, you may be looking at a reinstall.

What I meant was try to get NT set up on a different computer on a similar drive and then move the new drive to the old CPU "box".

I assume you have the ERD. Run setup on another PC with a sililar  Hard drive scheme and do an ERD installation on the clean hardware.
Then just move the new hard drive to the old hardware.

I rarely like to say reinstall, but it may be your only option at this point.

Actually, leew's suggesstionmay work and better. Try it and if it doesn't work, you may be looking at a reinstall.

tcalesa, you suggest a new installation.
Not realy what I want (otherwise I still would have done it), 'cause it's not the first time I got this behavior.
I need a fix, means a repair, not a workaround or reinstallation.
Thanks anyway.
ahoffmann
I suggested a repair installation of your original on a different platform.

Sorry that won't work for you.

Good luck resolving
Do you have technet?  If so, have you read articles Q153973
 and Q121517?  I think one of these contains your answer.  They are quite long so I won't post them unless you ask for them.  Or I could e-mail them if you leave your address.

Regards,
Bert.

I ran into a situation like that once long time ago.  Let see if I remember how I fixed it...

The way that I fixed it basically involved with half a new install:

1) Put your damaged drive back as your primary active drive.  
2) Using your NT installation media, i.e. either your three NT installation disks or bootable CD.
3) Start a new NT installation on the damaged drive but don't overwrite your old NT directory.  Changed the new installed
directory to something like winnt-spare.
4) Follow all the instructions like a normal installation until it start copying setup files on your harddisk.
5) While it is copying files onto your drive.  Abort the installation.
6) Remove the installation media and reboot your PC.
7) If the Boot manager comes back, you are back in business.
Otherwise, good luck!
8) If 7) is OK, you still need to clean up your "boot.ini" and
the temporary directory which stores the NT setup files.


Thanks kklam, I still tried this too, but when I try to install NT again it complains that it did not have a disk. Crazy :-o

leew, using a boot disk ends up in a message that there is no valid or a currupted NT installation (that's not realy true).

bchew, M$'s articles Q153973 points to the right direction.
Unfortunately when I want to write the backup bootsector, it complains with "invalid data" (or similar) and then aborts without writing the sector.
So either the backupsector is damaged also, or it points to the FAT layout (even the bytes in dskprobe state that it is NTFS).
But I think that this article is wrong, or I missed something essential in dskprobe:
  In the step where to write the bootsector, it says to type the number of relative sectors from step #5. IMO this would overwrite the backup bootsector with itself.
Could you please verify if this is true (and therefore the article wrong)?
The boot disk has worked for me once (I've only tried it twice and the other time was with a system with a very screwed up hard disk).  You did verify the boot.ini on the floppy points to the right disk and partition?
> You did verify the boot.ini on the floppy points to the right disk

Yes, cause I copied it from the damaged disk :-)
(It's the same as on my ERD)
Did convert change partition sequences, eventually?
Good luck - because ive got a similar problem with a corrupt MBR and ive been trying for ages to fix it.
1. Make sure the first physical hard disk has a good and bootable MBR.
2. Make sure the second physical hard disk is that not-bootable one.
3. Make sure you have no mirror, volume or strip set partitions on the second disk.
4. Boot system with a clear DOS startup disk
5. Run DEBUG and input the following except comments after ";".

a100
     mov ax,0201    ; read 1st disk's MBR to offset 1000h
     mov bx,1000
     mov cx,1
     mov dx,80
     int 13
     mov ax,0201    ; read 2nd disk's MBR to offset 1000h
     mov bx,2000
     mov cx,1
     mov dx,80
     int 13
     int 3
g=100
m1000 10bd 2000    ; move 1st' MBR code to the 2nd
a=200
     mov ax,0301    ; write new MBR to 2nd disk
     mov bx,2000
     mov cx,1
     mov dx,80
     int 13
     int 3

What the meaning of above procedures is to copy a good MBR code to the bad one without changing its partition information. Since it is very low level operation, I strongly recommend you indeed understand every step and meaning of the assembly code. Make very sure it is suitable to you. Else, the data on your second disk, even the first disk, may be lost.

In fact, FDISK /MBR does the same thing, except it does not work with NTFS.
Sorry, the last paragraph should be:

a200    ; write assembly code at offset 200h
    mov ax,0301    ; write new MBR to 2nd disk
    mov bx,2000
    mov cx,1
    mov dx,80
    int 13
    int 3
g=200    ; run assembly code from offset 200h
bbao, I'll give it a try (on my risk)-:

Questions:
1) your last comment did not change anything (except a comment), or did you mean that the line (in the answer)    m1000 10bd 2000
is obsolete?

2) Reading MBR on the 2'nd disk, why is it necessary?
    Are you shure this section starts with   mov ax,0201
1. It should be "a200", not "a=200". "g=200" is needed to run the code. "m1000 10bd 2000" is used to copy the 1st MBR's good boot code to the 2nd one at 2000.

2. It is necessary, since you should keep the 2nd disk's partition table. Yes, it starts with "mov ax, 0201", but sorry for a wrong comment, the comment of this should be "read 2nd disk's MBR to offset 2000h".

As you and I mentioned, it has risk, so I think you should backup all the data as possible as you can do.

Good luck!
ok bbao, I understand :-)
This is equivalent to do following under UNIX:

dd bs=190 count=1 if=/dev/hda of=/dev/hdb

Nice to hear this, is it what you want? Please let me know how it goes. :-)

BTW, your UNIX experience is pretty rich, could you explain what does the command-line mean?
> dd bs=190 count=1 if=/dev/hda of=/dev/hdb
   bs=190  (blocksize)
   count=1 (use one block)
   if=/dev/hda (input file; /dev/hda is first sector on first drive)
   of=/dev/hdb (output file; /dev/hdb is first sector on 2'nd drive)

Or simply: copy 190 bytes from the very beginning of 1'st to beginning of 2'nd drive.
(Things could be so easy :-))

bbao, patching the MBR in the suggested way didn't change anything :-(
The error message is same as the before?
no error message, I said "nothing changed". Means that it just did not find anything on the disk, even ntldr.
Probably I should tell you that this is a 4.3GB IDE disk with 4 partitions as follows:
    bootable 1 600MB
                     2 1000MB
                     3 600MB
                     4 1100MB
I was just rereading the comments. I know you have probably checked this, but have you taken blackmans suggestion to investigate boot sector protection in the bios of the pc?

Have you also run a disk checking utility like Checkit Pro to ensure there is nothing physically wrong with the drive?

I'm sorry if I wasted your time, but I thought it a good idea to at least ask.
How could I install NT on another blank drive if there is a boot sector protection enabled in BIOS? Anyway, I checked.

About Checkit Pro, don't have it.
I also agree that it could be a physical problem. But as I said before, I've had this problem on another machine and solved by re-installing.
Also chkdisk does not report any errors.

I will believe that convert is buggy, but chkdisk also?
.. I should remove and repost this question, squeezing all the comments to the informational ones.
It's to much to read, right Jason_Shulenberger ?-))
ahoffman,
did the disk dump work? I may have a machine with a similar problem.
Which disk dump?

> similar problem
nice to see that it's not only me :-((
I've read somthing about such things in a german journal (iX)
I'll try to contact the author next week; probaly it has to
do with the 4.3GB disk.

bbao's debug dd equiv.

Are you saying it has to do with this particular brand of har disk?

Keep me posted it you could I'd appreciate it.

Good luck.
Technical note: The ERD WILL NOT repair the MBR. FDISK /MBR is the best way to do this. Dos 6.0 and above supports this command.

The current situation:
NT4 installed on drive c:\ using NTFS
invalid boot sector

Make the 3 NT floppy disks as described.
Create an Emergency Repair Disk on a different NT workstation with NT 4 installed on drive C:\ using NTFS, too.

Boot with the first of the three disks.
There is a point where you can select to repair a damaged NT4 installation.
There is a point where you can restrict the error search to the bootenvironment.
Restrict it and you should be able to recreate all necessary startup files and a proper boot sector with the repairdisk created on the other NT 4 workstation
So, If I've processed these comments again correctly, you have a second drive you installed NT on so you could boot and look at the file system on the first drive.  Correct?  If so, then have you run NT's Chkdsk on the disk with the MBR problem?  
My solution does not require to install NT a second time and it does not require to put the harddisk with the invalid MBR from the workstation to another workstation.

The repair of the damaged MBR could be done with the 3 boot disks created via winnt /ox
AND the Emergency repair disk (created using rdisk.exe).
Only for this rdisk.exe you need a RUNNING NT 4 Workstation, winnt /OX can be run under pure MS DOS, too.

Please let me know if you had success with this procedure.

The problem is: You need write access to your NTFS partition which is possible by booting with the 3 NT boot disks.

the boot sector of two NT workstations installed on C:\ using NTFS is identical.
But as I said in my first comment, restrict the repair to the bootenvironment.

leew, you're right: I use the damaged disk as secondary drive.
There are no Problems at all (chkdsk reports OK), see also my comment from November 05 1998 - 11:45PM PST .
liebla, tried this in you variant (ERD from another NT) too, didn't help.

Sounds that there is no solution without reinstalling NT, which I won't do because of SP3 + hotfixes + several apps + etc. + ..
ahoffmann,
How about running a full backup of the affected system and restoring to another server/hard drive? this would prevent the full reinstall problem with the apps etc. then you can format and recover the old hardware and do another backup/restore to it.
tcalesa, I'm half the way doing something like you suggested.
But unfortunatelly there are still some dragons to beat (see early comments).
BTW, this still is not an acceptable workaround, 'cause I just want to get back a valid MBR (destroyed by convert), nothing else.
I'm not worried about the points, I'm just not sure if trying to hack the MBR is going to work, so I made another suggestion.

If you do fix the problem and have no luck with the MBR, could you contact EE cust service to adjust this to a zero point Q? It'd make and interesting PAQ at least, and you'll save the points as it seems no acceptable solution was found.

BTW, I take the to mean that the Debug command didn't work? I did get my similar problem fixed, I had used FDISK from a Win95 disk inadvertently. I tried again with a Dos 6.22 disk and all was well. I probably had something easier to fix.

Good luck
Following workaround solved the problem without going through the whole installation of NT and apps etc.

1.  damaged drive as primary master
2.  boot linux (from floppy or whatever)
3.  change partition type (where NT resides) to type DOS FAT
    using linux's fdisk
4.  backup NT partition as follows:
    dd bs=1024 count=620000 if=/dev/hda1 of=a_save_place
5.  boot DOS from floppy
6.  fdisk /MBR
7.  install NT (using NTFS)
8.  boot linux
9.  restore previous installation:
    dd bs=1024 count=620000 if=a_save_place of=/dev/hda1
10. cross your fingers

I'm not shure if step 5. and 6. are necessary. Probably the NT
installation in step 7. can be aborted after it converts to NTFS.

If this fails too, the existing installation must be copied using
NT as follows:

1.  damaged drive as slave, working NT as primary master
2.  boot NT, copy NT from slave to a_save_place
3.  damaged drive as primary master
4.  boot linux (from floppy or whatever)
5.  change partition type (where NT resides) to type DOS FAT
    using linux's fdisk
6.  boot DOS from floppy
7.  fdisk /MBR
8.  install NT (using NTFS)
9.  see 1.
10. boot NT
11. restore previous installation:
    copy a_save_place slave
12. see 3.
13. cross your fingers


I'm still searching for a clean, straight forward, solution.
Any comments are welcome.
ASKER CERTIFIED SOLUTION
Avatar of linda101698
linda101698

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Pretty clever ahoffmann. I am saving this one is case of a rainy day!!!