PCLinuxOS New User Guide : DosMbr

HomePage :: PCLinuxOS Forum | Index | Categories | Changes | Login/Register
Most recent edit on 2007-05-06 22:16:43 by SySy [moved]

Additions:
moved http://docs.mypclinuxos.com/index.php?title=Restoring_the_old_DOS/Windows_MBR

Deletions:
NOTE: Be very carefull about doing any of these actions. All can result in a lost partition table and lost data. If you have questions please ask for help on the forums.

In this page:


Using DOS FDisk to install an MBR
Using Lilo to restore a standard MBR
Using PCLinuxOS Live CD and ms-sys to restore a standard MBR
Using only PCLinuxOS and our standard MBR imag
Using your Windows Installation CD
Using a Bootdisk
Using Freedos


Using DOS FDisk to install an MBR

Back to The Bootloader FAQ

If you dual-boot Windows and Linux, and your master boot record (MBR) is broken which prevents both Windows AND Linux from starting, you can solve this by reinstall a default DOS/Windows bootloader. This will get Windows booting again. Before you attempt any of this, first give the solution on the Repairing a Broken Bootloader page a try. If that doesn't help, here is how you can reinstall the default DOS MBR to get Windows booting again.

If you've installed Grub before, and have trouble removing it again or installing Lilo after Grub, this will help as well. In that case, you will obviously have to reinstall Lilo after cleaning the MBR using the procedure beneath.

If you dual-boot Windows, and have the installation CD for Windows, please continue reading the "Using your Windows Installation CD" topic beneath.


Using Lilo to restore a standard MBR

Lilo can be used to create a standard MBR. If your MBR has become corrupted this is the simplest way to solve the problem.

Boot PCLinuxOS Live CD, open a terminal. Startmenu -> Terminals -> Terminal Program (Super User Mode)
Type the root password (on the livecd this is "root".)

Execute:
/sbin/lilo -M /dev/hdX mbr

Note: The option -M is a capital letter.
Replace /dev/hdX with your drive. For instance if your using a Primary Master IDE hard drive then you you would be /dev/hda, if you have SATA 1st drive would be /dev/sda. After this your system should boot Windows normally. If you only have Linux you will need to take the extra step of launching PCLinuxOS Control Center and selecting configure Lilo boot loader on the boot tab. Then follow the instructions to setup your Lilo configuration.


Using PCLinuxOS Live CD and ms-sys to restore a standard MBR

This utility can be used to change the Master Boot Record back to a standard MBR.
Execute:
ms-sys -mbr /dev//hdX

Note: To force the change if there is problems you will need to add a -f to the -mbr option.
Replace /dev/hdX with your drive. For instance if your using a Primary Master IDE hard drive then you you would be /dev/hda, if you have SATA 1st drive would be /dev/sda. After this your system should boot Windows normally. If you only have Linux you will need to take the extra step of launching PCLinuxOS Control Center and selecting configure Lilo boot loader on the boot tab. Then follow the instructions to setup your Lilo configuration.


Using only PCLinuxOS and our standard MBR image


We have a default MBR standing ready that, when installed, will get Windows starting again. It will also remove any Grub you might have installed previously. If neither Windows nor the installed PCLinuxOS work, start by booting from the liveCD now.

Then download this mbr.bin file, to the homefolder /home/guest. It holds the bootrecord to be installed.

To install the bootrecord, open a terminal. Startmenu -> Terminals -> Terminal Program (Super User Mode)
Type the root password (on the livecd this is "root".)

We'll presume two things. One, the mbr.bin file is indeed now in /home/guest. And your /dev/hda harddisk is the first harddisk holding the MBR to be cleaned.

Execute:
dd if=/home/guest/mbr.bin of=/dev/hda


This cleans the existing MBR and reinstalls a standard MBR.


Using your Windows Installation CD


If you have a working Windows, but want to remove the Lilo or Grub from the MBR, start a DOS command prompt with: Start -> Run -> cmd.

You are probably thinking now: "if Windows worked, I wouldn't be needing a fresh MBR!" If your DOS/Windows doesn't load at all, you could put in the Windows installation CD and restart your computer. Instead of installing from the Windows installation CD however, start the Windows Recovery Console. Depending on your Windows version, at the "Welcome to Setup" screen, press F10 or press 'R' for repair. You then get a DOS command prompt and you would then have access to the program needed.

There is an internal "fixmbr" command which repairs your broken master boot record. Executing this command is usually all that is needed. However, sometimes it is also necessary to run "fixboot C:" to boot Windows.

Some interesting Microsoft knowledge base links:
http://support.microsoft.com/kb/307654/
http://support.microsoft.com/kb/310497/
http://support.microsoft.com/kb/314058/
http://support.microsoft.com/kb/216417/
http://support.microsoft.com/kb/305595/


Using a Bootdisk


You can also use another computer to download a DOS 6.22 bootdisk (if you don't have one at hand already, always a good idea to have one at hand) from bootdisk.com and boot from that. Once you booted from the DOS 6.22 bootdisk, you can use the fdisk on the floppydisk.

After running "fdisk /mbr", Windows should load again when you restart your computer.


Using Freedos


Worst case scenario: you don't have a dos bootable floppy disk, or a Windows to create one using the bootdisk.com provided disks. We'll solve this problem using the freedos project. First boot your PC using the live CD. You can then download a floppy image from the fdos.org site. Make sure to get the odin1440.img file.

You can install the downloaded floppy image to a floppydisk with the linux dd command. Open a terminal Startmenu -> terminals -> terminal program (konsole). Go to the folder holding the .img file. Next put in an empty floppydisk and type:
dd if=odin1440.img of=/dev/fd0

Make sure you type it correctly! This installs the freedos diskimage to the disk, it takes a while. When done, check to see if it worked. Reboot from disk and at the dos prompt, execute the "fdisk /mbr" command.

You can also download a 12mb CD iso file which you can burn to a CD using k3b, which is easier perhaps.

More information about the odin freedos disk images, including the download itself, see the freedos odin page.


CategoryFAQ




Edited on 2006-11-08 02:47:14 by FinMan [Added TOC - anchors and links to those]

Additions:

In this page:

Using DOS FDisk to install an MBR
Using Lilo to restore a standard MBR
Using PCLinuxOS Live CD and ms-sys to restore a standard MBR
Using only PCLinuxOS and our standard MBR imag
Using your Windows Installation CD
Using a Bootdisk
Using Freedos










Edited on 2006-11-05 12:05:59 by LiveWickedly [Added the ms-sys option]

Additions:

Using PCLinuxOS Live CD and ms-sys to restore a standard MBR

This utility can be used to change the Master Boot Record back to a standard MBR.
ms-sys -mbr /devhdX
Note: To force the change if there is problems you will need to add a -f to the -mbr option.




Edited on 2006-11-04 08:49:00 by LiveWickedly [Added Using Lilo to restore a standard MBR, as well as a Note at the top urging caution]

Additions:
NOTE: Be very carefull about doing any of these actions. All can result in a lost partition table and lost data. If you have questions please ask for help on the forums.

Using Lilo to restore a standard MBR

Lilo can be used to create a standard MBR. If your MBR has become corrupted this is the simplest way to solve the problem.
Boot PCLinuxOS Live CD, open a terminal. Startmenu -> Terminals -> Terminal Program (Super User Mode)
/sbin/lilo -M /dev/hdX mbr
Note: The option -M is a capital letter.
Replace /dev/hdX with your drive. For instance if your using a Primary Master IDE hard drive then you you would be /dev/hda, if you have SATA 1st drive would be /dev/sda. After this your system should boot Windows normally. If you only have Linux you will need to take the extra step of launching PCLinuxOS Control Center and selecting configure Lilo boot loader on the boot tab. Then follow the instructions to setup your Lilo configuration.




Edited on 2006-06-21 10:00:29 by LexNL [Added extra information taken from forums]

Additions:
You are probably thinking now: "if Windows worked, I wouldn't be needing a fresh MBR!" If your DOS/Windows doesn't load at all, you could put in the Windows installation CD and restart your computer. Instead of installing from the Windows installation CD however, start the Windows Recovery Console. Depending on your Windows version, at the "Welcome to Setup" screen, press F10 or press 'R' for repair. You then get a DOS command prompt and you would then have access to the program needed.
There is an internal "fixmbr" command which repairs your broken master boot record. Executing this command is usually all that is needed. However, sometimes it is also necessary to run "fixboot C:" to boot Windows.
Some interesting Microsoft knowledge base links:
http://support.microsoft.com/kb/307654/
http://support.microsoft.com/kb/310497/
http://support.microsoft.com/kb/314058/
http://support.microsoft.com/kb/216417/
http://support.microsoft.com/kb/305595/


Deletions:
You are probably thinking now: "if Windows worked, I wouldn't be needing a fresh MBR!" If your DOS/Windows doesn't load at all, you could put in the Windows installation CD and restart your computer. Instead of installing from the Windows installation CD however, start the Windows Recovery Console. Depending on your Windows version, at the "Welcome to Setup" screen, press F10 or press 'R' for repair. You then get a DOS command prompt and you would then have access to the fdisk program.
In DOS you can reinstall the DOS bootloader in the MBR by executing "fdisk /mbr".




Edited on 2005-12-27 03:04:12 by LexNL [changed download url of clean mbr]

Additions:
Then download this mbr.bin file, to the homefolder /home/guest. It holds the bootrecord to be installed.

Deletions:
Then download this mbr.bin file, to the homefolder /home/guest. It holds the bootrecord to be installed.



Edited on 2005-12-24 10:08:47 by LexNL

Additions:
Then download this mbr.bin file, to the homefolder /home/guest. It holds the bootrecord to be installed.

Deletions:
Then download this mbr.bin file, to the homefolder /home/guest. It holds the bootrecord to be installed.



Edited on 2005-12-24 10:08:21 by LexNL

Additions:
Then download this mbr.bin file, to the homefolder /home/guest. It holds the bootrecord to be installed.

Deletions:
Then download this mbr.bin file, to the homefolder /home/guest. It holds the bootrecord to be installed.



Edited on 2005-12-24 10:08:07 by LexNL

Additions:
Then download this mbr.bin file, to the homefolder /home/guest. It holds the bootrecord to be installed.

Deletions:
Then download this mbr.bin file, to the homefolder /home/guest. It holds the bootrecord to be installed.



Edited on 2005-12-23 04:11:40 by LexNL [Added a linux-only solution]

Additions:
Then download this mbr.bin file, to the homefolder /home/guest. It holds the bootrecord to be installed.

Deletions:
Then download this mbr.bin file, to the homefolder /home/guest. It holds the bootrecord to be installed.



Edited on 2005-12-23 04:10:18 by LexNL [Added a linux-only solution]

Additions:
If you dual-boot Windows and Linux, and your master boot record (MBR) is broken which prevents both Windows AND Linux from starting, you can solve this by reinstall a default DOS/Windows bootloader. This will get Windows booting again. Before you attempt any of this, first give the solution on the Repairing a Broken Bootloader page a try. If that doesn't help, here is how you can reinstall the default DOS MBR to get Windows booting again.


Deletions:
If you dual-boot Windows and Linux, and your master boot record (MBR) is broken which prevents both Windows AND Linux from starting, you can solve this by reinstall a default DOS/Windows bootloader. This will get Windows booting again.
Before you attempt this, first give the solution on the Repairing a Broken Bootloader page a try. If that doesn't help, here is how you can reinstall the default DOS MBR to get Windows booting again.




Edited on 2005-12-23 04:07:41 by LexNL [Added a linux-only solution]

Additions:
If you dual-boot Windows and Linux, and your master boot record (MBR) is broken which prevents both Windows AND Linux from starting, you can solve this by reinstall a default DOS/Windows bootloader. This will get Windows booting again.
Before you attempt this, first give the solution on the Repairing a Broken Bootloader page a try. If that doesn't help, here is how you can reinstall the default DOS MBR to get Windows booting again.
If you dual-boot Windows, and have the installation CD for Windows, please continue reading the "Using your Windows Installation CD" topic beneath.

Using only PCLinuxOS and our standard MBR image



Deletions:
If you dual-boot Windows and Linux, and your master boot record (MBR) is broken which prevents both Windows AND Linux from starting, you can solve this by reinstall a default DOS/Windows bootloader. This will get Windows booting again. Before you attempt this, first give the solution on the Repairing a Broken Bootloader page a try. If that doesn't help, here is how you can reinstall the default DOS MBR to get Windows booting again.

Using only Linux and our standard MBR image

If you dual-boot Windows, and have an installation CD for Windows, please continue reading the "Using your Windows Installation CD" topic beneath.




Edited on 2005-12-23 04:01:26 by LexNL [Added a linux-only solution]

Additions:

Using only Linux and our standard MBR image



Deletions:

Using Linux and a standard MBR image





Edited on 2005-12-23 04:00:56 by LexNL [Added a linux-only solution]

Additions:
We have a default MBR standing ready that, when installed, will get Windows starting again. It will also remove any Grub you might have installed previously. If neither Windows nor the installed PCLinuxOS work, start by booting from the liveCD now.

Deletions:
We have a default MBR standing ready that, when installed, will get Windows starting again. It will also remove any Grub you might have installed previously. If neither Windows nor the installed PCLinuxOS work, start by booting from the liveCD now.



Edited on 2005-12-23 04:00:19 by LexNL [Added a linux-only solution]

Additions:
If you dual-boot Windows and Linux, and your master boot record (MBR) is broken which prevents both Windows AND Linux from starting, you can solve this by reinstall a default DOS/Windows bootloader. This will get Windows booting again. Before you attempt this, first give the solution on the Repairing a Broken Bootloader page a try. If that doesn't help, here is how you can reinstall the default DOS MBR to get Windows booting again. If you've installed Grub before, and have trouble removing it again or installing Lilo after Grub, this will help as well. In that case, you will obviously have to reinstall Lilo after cleaning the MBR using the procedure beneath.

Using Linux and a standard MBR image

If you dual-boot Windows, and have an installation CD for Windows, please continue reading the "Using your Windows Installation CD" topic beneath.
We have a default MBR standing ready that, when installed, will get Windows starting again. It will also remove any Grub you might have installed previously. If neither Windows nor the installed PCLinuxOS work, start by booting from the liveCD now.
Then download this mbr.bin file, to the homefolder /home/guest. It holds the bootrecord to be installed.
To install the bootrecord, open a terminal. Startmenu -> Terminals -> Terminal Program (Super User Mode)
Type the root password (on the livecd this is "root".)
We'll presume two things. One, the mbr.bin file is indeed now in /home/guest. And your /dev/hda harddisk is the first harddisk holding the MBR to be cleaned.
Execute:
dd if=/home/guest/mbr.bin of=/dev/hda

This cleans the existing MBR and reinstalls a standard MBR.
If you have a working Windows, but want to remove the Lilo or Grub from the MBR, start a DOS command prompt with: Start -> Run -> cmd.
In DOS you can reinstall the DOS bootloader in the MBR by executing "fdisk /mbr".


Deletions:
If you dual-boot Windows and Linux, and your MBR is broken which prevents both Windows AND Linux from starting, you can reinstall the default DOS bootloader. This will get Windows booting again. Before you attempt this, first give the solution on the Repairing a Broken Bootloader page a try. If that doesn't help, here is how you can reinstall the default DOS MBR to get Windows booting again.
In DOS you can reinstall the DOS bootloader in the MBR by executing "fdisk /mbr". If you are running Windows start a DOS command prompt with: Start -> Run -> cmd.




Edited on 2005-12-20 14:34:37 by LexNL [minor rewrite]

Additions:
Worst case scenario: you don't have a dos bootable floppy disk, or a Windows to create one using the bootdisk.com provided disks. We'll solve this problem using the freedos project. First boot your PC using the live CD. You can then download a floppy image from the fdos.org site. Make sure to get the odin1440.img file.

Deletions:
Worst case scenario: you don't have a dos bootable floppy disk, or a Windows to create one using the bootdisk.com provided disks. Boot your PC using the live CD. Download a dos bootdisk from the freedos project. You can download a floppy image from the fdos.org site. Make sure to get the odin1440.img file.



Edited on 2005-12-20 14:32:58 by LexNL

Additions:
If you dual-boot Windows and Linux, and your MBR is broken which prevents both Windows AND Linux from starting, you can reinstall the default DOS bootloader. This will get Windows booting again. Before you attempt this, first give the solution on the Repairing a Broken Bootloader page a try. If that doesn't help, here is how you can reinstall the default DOS MBR to get Windows booting again.

Using your Windows Installation CD

Using a Bootdisk

Using Freedos

Worst case scenario: you don't have a dos bootable floppy disk, or a Windows to create one using the bootdisk.com provided disks. Boot your PC using the live CD. Download a dos bootdisk from the freedos project. You can download a floppy image from the fdos.org site. Make sure to get the odin1440.img file.
You can install the downloaded floppy image to a floppydisk with the linux dd command. Open a terminal Startmenu -> terminals -> terminal program (konsole). Go to the folder holding the .img file. Next put in an empty floppydisk and type:
dd if=odin1440.img of=/dev/fd0

Make sure you type it correctly! This installs the freedos diskimage to the disk, it takes a while. When done, check to see if it worked. Reboot from disk and at the dos prompt, execute the "fdisk /mbr" command.
More information about the odin freedos disk images, including the download itself, see the freedos odin page.


Deletions:
If you dual-boot Windows and Linux, and your MBR is broken which prevents both Windows AND Linux from starting, you can reinstall the default DOS bootloader. This will get Windows booting again. Before you attempt this, first give the solution on the the Repairing a Broken Bootloader page a try. If that doesn't help, here is how you can reinstall the default DOS MBR to get Windows booting again.

Using Freedos

Worst case scenario: you don't have a dos bootable floppy disk, or a Windows to create one using the bootdisk.com provided disks. You might get a dos bootdisk (with fdisk, for the fdisk /mbr call) using the freedos project: You can download a floppy image from the fdos.org site.
You can install the downloaded floppy image (get the odin1440.img file) with the linux dd command. Open a terminal Startmenu -> terminals -> terminal program (konsole). Go to the folder holding the .img file. Next put in an empty floppydisk and type:
dd if=odin1440.img of=/dev/fd0

Make sure you type it correctly! This installs the freedos diskimage to the disk, it takes a while. When done, check to see if it worked. If it worked, reboot from disk and execute the "fdisk /mbr" command.
More information about the odin freedos disk images, see the freedos odin page.




Edited on 2005-12-19 13:45:33 by LexNL [added freedos option]

Additions:
More information about the odin freedos disk images, see the freedos odin page.



Edited on 2005-12-19 13:41:57 by LexNL [Added freedos option]

Additions:
You can install the downloaded floppy image (get the odin1440.img file) with the linux dd command. Open a terminal Startmenu -> terminals -> terminal program (konsole). Go to the folder holding the .img file. Next put in an empty floppydisk and type:
dd if=odin1440.img of=/dev/fd0


Deletions:
You can install the downloaded floppy image (get the odin1440.img or fdos1440.img file) with the linux dd command. Open a terminal Startmenu -> terminals -> terminal program (konsole). Go to the folder holding the .img file. Next put in an empty floppydisk and type:
dd if=fdos1440.img of=/dev/fd0




Oldest known version of this page was edited on 2005-12-19 13:36:28 by LexNL [Initial text]
Page view:

Using DOS FDisk to install an MBR

Back to The Bootloader FAQ

If you dual-boot Windows and Linux, and your MBR is broken which prevents both Windows AND Linux from starting, you can reinstall the default DOS bootloader. This will get Windows booting again. Before you attempt this, first give the solution on the the Repairing a Broken Bootloader page a try. If that doesn't help, here is how you can reinstall the default DOS MBR to get Windows booting again.

In DOS you can reinstall the DOS bootloader in the MBR by executing "fdisk /mbr". If you are running Windows start a DOS command prompt with: Start -> Run -> cmd.

You are probably thinking now: "if Windows worked, I wouldn't be needing a fresh MBR!" If your DOS/Windows doesn't load at all, you could put in the Windows installation CD and restart your computer. Instead of installing from the Windows installation CD however, start the Windows Recovery Console. Depending on your Windows version, at the "Welcome to Setup" screen, press F10 or press 'R' for repair. You then get a DOS command prompt and you would then have access to the fdisk program.

You can also use another computer to download a DOS 6.22 bootdisk (if you don't have one at hand already, always a good idea to have one at hand) from bootdisk.com and boot from that. Once you booted from the DOS 6.22 bootdisk, you can use the fdisk on the floppydisk.

After running "fdisk /mbr", Windows should load again when you restart your computer.

Using Freedos


Worst case scenario: you don't have a dos bootable floppy disk, or a Windows to create one using the bootdisk.com provided disks. You might get a dos bootdisk (with fdisk, for the fdisk /mbr call) using the freedos project: You can download a floppy image from the fdos.org site.

You can install the downloaded floppy image (get the odin1440.img or fdos1440.img file) with the linux dd command. Open a terminal Startmenu -> terminals -> terminal program (konsole). Go to the folder holding the .img file. Next put in an empty floppydisk and type:
dd if=fdos1440.img of=/dev/fd0

Make sure you type it correctly! This installs the freedos diskimage to the disk, it takes a while. When done, check to see if it worked. If it worked, reboot from disk and execute the "fdisk /mbr" command.

You can also download a 12mb CD iso file which you can burn to a CD using k3b, which is easier perhaps.


CategoryFAQ
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by Wikka Wakka Wiki 1.1.6.2
Page was generated in 0.7081 seconds