LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   General (https://www.linuxquestions.org/questions/general-10/)
-   -   MBR question... (https://www.linuxquestions.org/questions/general-10/mbr-question-2687/)

Thymox 05-22-2001 10:02 AM

Does anyone know of a way to save the MBR to a floppy (in either Win or Lin)? I've not got a problem with it at the moment, but fdisk /mbr will only work so many times.

A while ago (before I fully understood about the MBR) I tried to install QNX, it failed. So I tried again (without doing an 'fdisk /mbr'), and it failed again. I removed the remnants of the QNX installation (with a Mandrake 7.1 install CD), and then booted. Couldn't find anything to boot on the bootable partition. Finally did an 'fdisk /mbr' (several times in the end) and still couldn't boot. It seems that doing an 'fdisk /mrb' will only put in place the last used MBR, which happened to be Windows.

The ability to copy the MBR to a floppy could be a god-send for complete newbies that think they've knackered their HD and are about to re-install Windows.

Anyone have any suggestions?

Thymox 05-22-2001 10:05 AM

Sorry, my bad...
 
Quote:

Originally posted by Thymox
It seems that doing an 'fdisk /mrb' will only put in place the last used MBR, which happened to be Windows.

Should have read 'which happened to be QNX'.

Sorry guys.

Still, any ideas?

CragStar 05-22-2001 12:47 PM

I had always thought that the file in /boot called boot.0300 contained the MBR when you first installed Linux. I would make a copy of this just in case you need it. Not sure how much use this would be?

mongrel 05-22-2001 02:43 PM

You can copy the MBR to a floppy but you won't be able to boot your computer with that floppy.

To copy the MBR from Linux:

Code:

dd if=/dev/hda of=/dev/fd0 bs=512 count=1

Thymox 05-23-2001 04:27 AM

Cheers, guys.

It's not a question of booting from the floppy. In some of my replies to people that are having problems installing Linux, I have stated that they should do an fdisk /mbr before they re-install Linux. I came across a problem with this - installing a new OS overwrites the mbr and only saves 1 copy of the previous record. Thus, if you 'forget' to do an fdisk /mbr a couple of times, you really are in the shit should you want to remove all remnants of an alternative OS and go back to Windows (god forbid!).

Having a safe copy of the MBR on a floppy would give you the opportunity to:
Boot into DOS using a Windows Boot Floppy, replace your current MBR with your 'nice, safe' version, reboot and you should not see any problems.

Like, for example:

Someone wants to try Linux. They install it. It goes wrong (they installed it wrong?). They re-install it, without having done an fdisk /mbr. It goes wrong again. They finally do an fdisk /mbr and hope that all is well. It won't be - they will now be given an 'L' prompt. Nothing works. Typing 'Linux' won't boot. Typing 'windows' won't boot. No matter how many times they type fdisk /mbr, they won't be able to remove LiLo. Thus, being able to copy a 'windows safe' MBR to a floppy should get them out of trouble.

Thanks for the advice guys - anyone know how to do this from DOS/Windows with FDISK?

ugge 05-23-2001 03:28 PM

When you install LILO it automatically make a copy of the current MBR and stores it elsewhere.
I think it is in the /boot directory.

Correct me if I'm wrong but fdisk /mbr (dos fdisk that is) always write back a dos/windows boot block.
Sometimes though it won't help.
Then the only thing that help is to manually write zeros to the MBR wich is the first 512 bytes of the hard disk.

CragStar 05-23-2001 04:58 PM

I think the boot.0300 is the LILO back-up of the MBR ugge.

As for a windows backup I also thought that fdisk /mbr did re-write windows boot section. But to be honest I have never tried to use it. (usually just a quick format of the HD would do!:)).

I don't know how to make a permanent copy through windows though.

abyss 05-23-2001 06:23 PM

Hi guys.

Thymox, the way I get around this is to use gdisk instead of fdisk.

For those unfamiliar, gdisk is a handy little DOS utility I'm told was created by Symantec. I have a windoze 98se boot floppy (with cd rom support) that I added the gdisk command to. It's very small and can easily be added to a windoze boot floppy.

gdisk is a life saver. I've installed multiple versions of Linux (and freeBSD) on multiple machines. As you said, at some point the MBR inevitably becomes screwed.

I then boot the machine from the floppy and run:

gdisk 1 /MBR

and it "reinitializes" the MBR.

Also, gdisk will get rid of nasty compressed and/or logical drives that seem impervious to fdisk (under DOS).

Cheers

abyss


All times are GMT -5. The time now is 04:27 PM.