# rewrite mbr?



## pianoman1948 (Jan 8, 2005)

Here's an interesting one: I have had occasion to use FDISK /MBR to rewrite the MBR on a hard drive. How do you tell it which drive to write on (I have two)? Does it do all of them?

A related question: I keep reading all kinds of caveats about this command, like it's only good for up to 4 partitions, sometimes it doesn't work, etc. What should I be using instead (i.e., is there something better, more up-to-date)?

I have seen fixboot in the Windows recovery console mentioned, but that's no help when there is no Windows installed on the disk (i.e., if the disk is blank). 

Thanks,
Ted


----------



## crjdriver (Jan 2, 2001)

You do not need windows installed to use the recovery console. Boot with your xp / win2k cd and choose repair; you are now in the RC. From your post [asking about the RC] it would seem that you have either xp or win2k. There is never a need to use win9x / dos tools with nt based os. If you want to write a new mbr, the command in the RC is fixmbr. This will write a new master boot record.


----------



## pianoman1948 (Jan 8, 2005)

crjdriver said:


> You do not need windows installed to use the recovery console. Boot with your xp / win2k cd and choose repair; you are now in the RC.


Thanks very much for your response. Interesting, I never considered that; obviously, I have never actually used the RC. I actually have both 2K and XP, a couple installations of each in separate partitions.

Ok, so I will ask my original question about RC instead of FDISK: Is there a way to tell fixboot on which disk to rewrite the mbr (if you have more than one)?



crjdriver said:


> There is never a need to use win9x / dos tools with nt based os.


Is it really possible to take a blank hard drive and do everything, set up the basic (i.e., primary and extended) partitions with the RC, instead of FDISK and something like Partition Magic?

Thanks,
Ted


----------



## Moby (Mar 19, 2002)

> Is it really possible to take a blank hard drive and do everything, set up the basic (i.e., primary and extended) partitions with the RC, instead of FDISK and something like Partition Magic?


Not with the recovery console part of the CD, but with other tools in setup on the same CD - yes.

As far as I know, on the other question, if you have multiple bootable partitions, when using the XP CD as a boot disc to go into the Recovery console, it asks you which OS setup you want to get at. I'm not sure it's wise going into WIN2k and fixing a boot record with an XP disc though. They may be the same, I'm not sure, but to me you'd use the XP CD to fix an XP installation only.


----------



## JohnWill (Oct 19, 2002)

FDISK /MBR writes the MBR to the first physical drive it finds. If you do an FDISK /STATUS, the drive that's listed as #1 is where the record went.


----------



## pianoman1948 (Jan 8, 2005)

Ok, thanks, folks. More new stuff I need to learn .... <smile>

Ted


----------



## angel (Dec 2, 1998)

I have not tried this so try at your own risk...

FDISK /CMBR <DISK> - Recreates the Master Boot Record on specified disk. Performs the same functions as FDISK /MBR except can be used on other disk drives.


----------



## pianoman1948 (Jan 8, 2005)

thanks ..... and how to indicate <disk>? I read somewhere to use numbers (rather than drive letters). Disk 0, disk 1, etc. To find out what they are, I saw someone recommend using FDISK /STATUS.


----------



## Squashman (Apr 4, 2003)

pianoman1948 said:


> thanks ..... and how to indicate <disk>? I read somewhere to use numbers (rather than drive letters). Disk 0, disk 1, etc. To find out what they are, I saw someone recommend using FDISK /STATUS.


Yes, use the drive numbers.


----------



## JohnWill (Oct 19, 2002)

I truthfully never heard that FDISK /MBR would accept a drive number, and I've never seen that written down. I may have to try it somewhere, just to see what happens.


----------



## angel (Dec 2, 1998)

SYNTAX

Configures a hard disk for use with MS-DOS.

*FDISK [/STATUS] /X*

*/STATUS* Displays partition information. 
*/X* Ignores extended disk-access support (will not use LBA support). Use this switch if you receive one of the following symptoms: 
Unable to access a drive from DOS versions prior to 7.
Disk access messages .
Stack overflow messages.
High amounts of data corruption.
Extra drive letters

SECRET FDISK SWITCHES

Disclaimer: Below is a listing of secret or undocumented MS-DOS fdisk commands and switches. Use these commands at your own risk.

*FDISK /MBR* Command used to rewrite the Master Boot Record. See CH000175 for additional information. 
*FDISK /CMBR <DISK>* Recreates the Master Boot Record on specified disk. Performs the same functions as FDISK /MBR except can be used on other disk drives.
*FDISK 1/PRI:100* Creates a 100MB DOS partition on the hard drive. 
*FDISK 1/EXT:500* Creates a 500MB meg extended DOS partition on the hard drive. 
*FDISK 1/LOG:250* Creates a 250MB logical drives on the hard drive. 
*FDISK /Q* Prevents fdisk from booting the system automatically after exiting fdisk. 
*FDISK /STATUS* Shows you the current status of your hard drives. 
*FDISK /ACTOK* Makes FDISK not check the disk integrity allowing the drives to be created faster. 
*FDISK /FPRMT* Will not get the prompt for FAT32 support, in addition allows FDISK to be forced into using FAT32 on drives smaller then 540MB (by default FDISK will not use FAT32 on any drive smaller then 540MB). Finally this command can only be used with FDISK that supports FAT32.


----------



## crjdriver (Jan 2, 2001)

> s it really possible to take a blank hard drive and do everything, set up the basic (i.e., primary and extended) partitions with the RC, instead of FDISK and something like Partition Magic?


Yes. You can also do this through win2k / xp setup. It will do the same thing. Setup will not give you the option to fixmbr or fixboot however.


----------



## pianoman1948 (Jan 8, 2005)

Thanks very much ... I will have to fool around with it. Lots to chew on.
Ted


----------



## JohnWill (Oct 19, 2002)

Angel, I don't see any capability to select other disks for the /MBR command in your list.


----------



## angel (Dec 2, 1998)

This what you mean?
FDISK /CMBR <DISK> Recreates the Master Boot Record on specified disk. Performs the same functions as FDISK /MBR except can be used on other disk drives.


----------



## JohnWill (Oct 19, 2002)

Yes, where do you see that actually written down? Other than in your message, of course.


----------



## angel (Dec 2, 1998)

Oh! Hehe!
I just found it listed at a few different places online. As I said though, I've not tried it...
http://www.computerhope.com/fdiskhlp.htm
--http://www.computerhope.com/issues/ch000175.htm
http://bharucha.com/tp701/fdiskSecrets.html
http://www.oreilly.com/catalog/pchks/chapter/hack47.pdf


----------



## JohnWill (Oct 19, 2002)

OK, I guess this quote says it all, the undocumented part. 

_This page describes undocumented switches you can use with FDISK. With the switches you can use FDISK in non-interactive mode, e.g. in a batch file._


----------

