Jump to content

FixMBR


FastScan

Recommended Posts


Thanks again kaares, nice job. :)

Just for quick reference:

    MbrFix /drive <num> driveinfo              Display drive information

    MbrFix /drive <num> drivesize              Returns drive size in MB as return value

    MbrFix /drive <num> listpartitions        Display partition information

    MbrFix /drive <num> savembr <file>        Save MBR and partitions to file

    MbrFix /drive <num> restorembr <file>      Restore MBR and partitions from file

    MbrFix /drive <num> fixmbr                Update MBR code to W2K/XP/2003

    MbrFix /drive <num> clean                  Delete partitions in MBR

    MbrFix /drive <num> readsignature {/byte}  Read disk signature from MBR

    MbrFix /drive <num> writesignature hex    Write disk signature from MBR

    MbrFix /drive <num> generatesignature      Generate disk signature in MBR

    MbrFix /drive <num> readstate              Read state from byte 0x1b0 in MBR

    MbrFix /drive <num> writestate <state>    Write state to byte 0x1b0 in MBR

    MbrFix volumeinformation driveletter      Get volume information for partition

Items in RED are the new commands.

Please, do not think I am "picky", but maybe :

MbrFix /drive <num> writesignature hex    Write disk signature from MBR
should really be:
MbrFix /drive <num> writesignature hex    Write disk signature to MBR

jaclaz

Link to comment
Share on other sites

Ok, here (attached) is the updated Pseudo-GUI.

You will need, apart from the files in the attachment, the program from Kaare:

http://www.sysint.no/Nedlasting/MbrFix.zip

And the Wizard's Apprentice WIZAPP.EXE:

http://wizapp.sourceforge.net/

Copy all files to the same directory, rename mbrfix.txt to mbrfix.cmd and double click on it.

A mirror of my pseudo-GUI file is here:

http://home.graffiti.net/jaclaz:graffiti.n...X/mbrfix0.2.zip

Let me know if you find any bugs/problems.

jaclaz

mbrfix0.2.zip

Link to comment
Share on other sites

  • 2 months later...
it is no MBR or damage in MBR can me copy MBR from onther one ?

No, you CANNOT copy an MBR from another disk.

The MBR is made in TWO parts, first one is "STATIC" meaning that is common code to all MBR's written from a given Operating System, second one is "DYNAMIC" meaning that has data (Partition Tables and, in the case of win2k/XP/2003, a "signature") that ONLY belongs to THAT HD/System.

MBRFix replaces the STATIC data with standard one, and can change the signature.

NO changes are made to the Partition Table.

So if your Partition Table is good but the STATIC part is not, MBRFIX is the tool for you.

If your MBR is ok but the Partition Table is not, you will need a tool like TESTDISK:

http://www.cgsecurity.org/testdisk.html

or a Hex/Disk editor, a lot of patience AND some good knowledge of the inner workings of Partition Tables to correct the problem.

A handy utility to change PT easily - but you still have to KNOW what you are doing - is Beeblebrox:

http://students.cs.byu.edu/~codyb/

http://students.cs.byu.edu/~codyb/bbdownload.html

jaclaz

Link to comment
Share on other sites

  • 11 months later...

Jaclaz,

I have seen from you posts on various forums that you are obviously an MBR wiz and I am having a problem.

I followed your instructions in this thread and this is what is reported:

Drive 1

Disk size = 131069 (MB)

Cylinders = 16709

Tracks per cylinder = 255

Sectors per track = 63

Bytes per sector = 512

Disk size = 137436203520 (Bytes) = 127 (GB)

# Boot Size (MB) Type

1 Yes 190779 7 NTFS or HPFS

2 0 0 None

3 0 0 None

4 0 0 None

My system has two hard drives. For some reason drive 0 is my secondary (non boot) drive. It is a sata 320 gb drive connected to the mainboard.

My drive 1 as seen above is my boot drive. It is a 200 gb ide attached to a western digital controller card.

When the machine boots up the controller card reports 186 gb. Windows recognizes all 186 gb as well. But Norton Ghost says Cannot enable the job because it contains invalid drives. Norton Partition Magic reports Error #109: Partition ends after end of disk.

ucEndCylinder (24320) must be less than 16709.

I looked up the error on Symantec support and they say it's either bios (seems to report 186 gb), controller card (no problem in past) or the MBR.

I have thought of running fixmbr but am reluctant to do so.

I tried to backup the mbr using your program. I tried to attach it to this post but was unable (error not permitted to upload a file with that extension).

I also tried to use TESTDISK as I saw that you recommended that to someone on another post.

It reports 137GB/ 127GiB CHS 16709 255 63. "The hard disk seems too small! Check the hard disk size" .

I tried to change the geometry but received an error message.

Can you please help me?

Edited by Eyedoctor2
Link to comment
Share on other sites

@Eyedoctor2

From what you report, it appears that you have somehow corrupted records, I have seen this hapen when a tool like Partition Magic or similar has been used and was interrupted, but it could be caused by almost anything.

It is possible that the drive was originally formatted under another operatig system or using a third party tool with full LBA support.

Let see things one by one.

As I see it, the fact that drive 0 is the one attached to mainboard, even if without active partition on it, is normal, I think that Physical drives enumeration is dependant on hardware connections, so I would not be preoccupied by that, it should be quite normal that the BIOS detects drives attached to mainboard BEFORE those attached to expansion cards.

From what you say, the data reported by Disk driver is CHS 16709x255x63, which would mean

16709x255x63x512=137,436,203,520 bytes

In a perfect word, with a NTFS primary partition spanning over the entire disk, you should have, as seen in beeblebrox (don't be afraid to use it, it won't make changes to MBR unless you tell it to do so):

You should have just one entry like these:

Type 07
Boot 80
BCyl 0
BHd 1
BSec 1
ECyl 1023 #the "real" value should be 16,708, but CHS "stops" at 1023
EHd 254
ESec 63
Startsector 63
Numsectors 268,430,022

But, since your drive is "really" a 200 Gb, i.e around 186 Gb of "true" bytes:

200x1000x1000x1000=200,000,000,000

200,000,000,000/1024/1024/1024=186

It was most probably formatted with appropriate values for it's size, with Numsectors around 390,000,000.

You can run beeblebrox and report them.

I suspect, this is guesswork at the moment, that you hit a known limit or hard disk size barrier, the "48bit LBA one", see here:

http://www.48bitlba.com/

you do not say which OS you are running, so, with another guess on my part, I would say Windows XP pre SP1:

http://www.48bitlba.com/winxp.htm

or Win2k pre SP3:

http://www.48bitlba.com/win2k.htm

DO run the tools you can find on the site:

http://www.48bitlba.com/hdinfo.htm

http://www.48bitlba.com/enablebiglbatool.htm

and upgrade OS if necessary.

Please do report your findings and (hopefully) the fix that worked.

jaclaz

Edited by jaclaz
Link to comment
Share on other sites

Jaclaz,

First thank you very much for replying.

I apologize for not including my OS- Windows XP SP2.

Running beeblebrox I get the exact values you listed except

Numsectors 390716802

I ran http://www.48bitlba.com/enablebiglbatool.htm and it said that since I have sP2 that it passed and there was nothing to do.

Should I purchase the infotool?

You are correct that I have run Partition Magic several times in the past. The most recent time I used it to remove all partitions that I had previously made. I did so after purchasing the new 320gb sata hard drive.

Thanks again for your help!

Link to comment
Share on other sites

Should I purchase the infotool?

Well, wait a minute before spending money, I would have thought that the trial would have given enough info.

However it is not that expensive, and it's however a handy diagnostic tool.

Let's try this before, manually:

Check with Regedit that the keys are as in this articles:

http://support.microsoft.com/kb/303013/en-us

and check the version of ATAPI.SYS

Double check your hard drives and their documentation if there is a jumper related to the 137 Gb barrier or something like "Limit number of reported cylinders".

If the above is OK, the other thing that might be could be an incompatible BIOS of the motherboard and/or of the attached card, you should try looking on the respective manufacturer sites if any fix is available.

Try also these two programs:

SIW:

http://www.gtopala.com/index.html

and

SIV:

http://siv.mysite.wanadoo-members.co.uk/

both give lots of info on hardware and maybe you could find something from their output.

You can also try to run from DOS the intel program:

http://www.intel.com/support/chipsets/iaa/sb/cs-009302.htm

http://www.intel.com/support/chipsets/iaa/sb/cs-009301.htm

And this one (from XP):

http://www.hdtune.com/

I'll post if any other idea comes to my mind....

jaclaz

Edited by jaclaz
Link to comment
Share on other sites

Jaclaz,

Again thanks!

First, the Atapi.sys version is current.

Second, Windows does report the drive to be 186 gb. Just as it reports that my secondary hardrive is 320gb.

The problem is with partion magic, testdisk and beeblebrox all report it to be 131+gb.

I know that this is a new problem because previously Norton Ghost and Partition Magic worked fine without any reported errors. I have at this time a backup created by Norton Ghost 77 days ago but hate to go back that far as I am always making changes. I thought that all this time Norton Ghost had been making automatically scheduled incremental backups. I didn't realize the problem until I tried to use Ghost to create another full backup.

I believe the problem started after removing the partitions in the C (200gb) drive with partition magic. I have contacted symatec support but am still waiting to hear back from them.

I am not at home so I can't try the other utilities that you suggest. I will try tonight.

Is there a software program that I can use to correct the partition size without losing the data on the hard drive?

Thanks again!

Link to comment
Share on other sites

Is there a software program that I can use to correct the partition size without losing the data on the hard drive?

Well, I am afraid not, you see, the partition data in the MBR is correct, (the 390716802 you report, which is approximately the value I expected "Numsectors around 390,000,000").

To be more exact, a value of 390716802 in Numsectors would mean a CHS geometry of 24,321x255x63, i.e.

24,321x255x63x512=390,716,865x512=200,047,034,880 bytes, corresponding

in "Hd Manufacturer Gb" to:

200,047,034,880/1000/1000/1000=200 Gb

and in "real Gb" to:

200,047,034,880/1024/1024/1024=186 Gb

So the MBR is correct, there must be something somewhere else, (at this point and from what you report I am inclined to think it could be something in the Registry, if you are positive that there is nothing "suspect" in the motherboard or card BIOS) that makes these utilities "see" the drive as 132 Gb.

Can you try running a CHKDSK from a command prompt:

http://www.ss64.com/nt/chkdsk.html

WITHOUT any parameter and take note of what it says?

jaclaz

Link to comment
Share on other sites

I will run chkdsk when I get home.

I previously ran chkdsk /r and chkdsk /p and it reported uncorrectable errors.

Would it help at all if I opened up the box and connected the hard drive directly to the motherboard, temporarily disconnecting my dvd and dvdrw drives?

My reluctance to blame the controller card stems from the fact that when the card bios screen flashes up at the beginning it detects a 186 gb drive. Also, Norton Ghost previously ran with this controller card though I did not have the sata drive attached to the motherboard at that time.

History- I previously had the 186gb ide drive partitioned and was saving backups via Ghost on one partition. The hard drive was on the controller card and the dvd and dvdrw were on the motherboard along with a cdrw drive. I then purchased the sata drive, removed the partitions on the 186gb drive and removed the cdrw drive.

So presently sata drive is on motherboard, along with dvd and dvdrw. 186 gb ide continues to be on controller card.

I don't know if this information helps much but as an eyedoctor it never hurts to get a good medical history.

Thanks again for your willingness to help.

Edit:

RESULTS OF CHKDSK

I am going to include 3 gifs with this post.

First is screenshot of chkdsk

Second is Norton Partition Magic summary screen

Third is error message given when trying to resize using Norton Partition Magic.

Hope that helps!

Thanks again!

post-115986-1164112282_thumb.png

post-115986-1164112296_thumb.png

post-115986-1164112308_thumb.png

Edited by Eyedoctor2
Link to comment
Share on other sites

I have not much ideas left:

1) Chkdsk sees the partiiton allright ÷190Gb

2) Windows Explorer ALSO sees it allright ÷190GB

3) Norton Partition Magic ALSO sees it allright ÷190GB

4) The error comes when you try to resize it

That MUST be because somehow the disk (not the partition) is seen as having 16709 Cylinders, i.e. 132 Gb, and this happens with:

a ) MBRFIX

b ) TESTDISK

c ) BEEBLEBROX

d ) NORTON PARTITION MAGIC

Results 1) to 3) are normal as to read information on the partition the MBR is read, which as said, is correct.

Results 4) and a ) to d ) are also all coherent as to read information on the drive geometry the disk driver is interrogated, which actually interrogates the hard disk.

So something must be wrong in

EITHER:

1) the information the hard disk supplies, and this can be only be attributed to:

1a ) a jumper setting on the hard disk

1b ) a jumper or setting in the card or its BIOS

1c ) a setting in the motherboard BIOS that somehow "overrides" board one, though I doubt it

OR:

2) the information the disk driver is correct, but it is badly "translated", and this can be only attributed to:

2a ) a defective driver (disk, card or bus)

2b ) a "hidden" setting or filter somewhere that "overrides" the right values

From the "history" you supplied, the only other thing I can fathom is some kind of conflict with the SATA drive, so, yes, trying the drive hooked directly to the board would be a good troubleshooting step, though cannot say how many "good" info we can get from that.

I would suggest the following:

1) just remove the SATA drive leaving everything else as is, run said apps to check if anything changed

2) remove DVDR leaving everything else as is, run said apps to check if anything changed

3) remove DVDRW leaving everything else as is, run said apps to check if anything changed

4) attach 186 Gb drive directly to MB leaving everything else as is, run said apps to check if anything changed

5) remove the card, run said apps to check if anything changed

6) re-insert card and attach to it 186 Gb drive, run said apps to check if anything changed

7) re-connect just the SATA drive, run said apps to check if anything changed

8) re-connect DVDRW leaving everything else as is, run said apps to check if anything changed

9) re-connect DVDR leaving everything else as is, run said apps to check if anything changed

jaclaz

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...