LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > General
User Name
Password
General This forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!

Notices


Reply
  Search this Thread
Old 05-22-2001, 10:02 AM   #1
Thymox
Senior Member
 
Registered: Apr 2001
Location: Plymouth, England.
Distribution: Mostly Debian based systems
Posts: 4,368

Rep: Reputation: 64

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?
 
Old 05-22-2001, 10:05 AM   #2
Thymox
Senior Member
 
Registered: Apr 2001
Location: Plymouth, England.
Distribution: Mostly Debian based systems
Posts: 4,368

Original Poster
Rep: Reputation: 64
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?
 
Old 05-22-2001, 12:47 PM   #3
CragStar
Senior Member
 
Registered: Oct 2000
Location: UK - Frome
Distribution: Ubuntu
Posts: 1,081

Rep: Reputation: 47
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?
 
Old 05-22-2001, 02:43 PM   #4
mongrel
LQ Newbie
 
Registered: May 2001
Location: North Carolina
Distribution: SuSE 7.1
Posts: 15

Rep: Reputation: 0
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
 
Old 05-23-2001, 04:27 AM   #5
Thymox
Senior Member
 
Registered: Apr 2001
Location: Plymouth, England.
Distribution: Mostly Debian based systems
Posts: 4,368

Original Poster
Rep: Reputation: 64
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?
 
Old 05-23-2001, 03:28 PM   #6
ugge
Senior Member
 
Registered: Dec 2000
Location: Gothenburg, SWEDEN
Distribution: OpenSUSE 10.3
Posts: 1,028

Rep: Reputation: 45
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.
 
Old 05-23-2001, 04:58 PM   #7
CragStar
Senior Member
 
Registered: Oct 2000
Location: UK - Frome
Distribution: Ubuntu
Posts: 1,081

Rep: Reputation: 47
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.
 
Old 05-23-2001, 06:23 PM   #8
abyss
Member
 
Registered: May 2001
Location: New York, USA
Distribution: AIX, Ubuntu
Posts: 113

Rep: Reputation: 16
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
MBR question shammax Linux - Newbie 5 05-01-2005 10:12 PM
Not your regular GRUB question - just a short question for a fried MBR!! ziphem Linux - General 3 01-31-2005 01:51 PM
A story & a question about the MBR Seventh_Warrior Linux - Software 2 09-22-2004 05:17 PM
question for pro's, big problem with MBR marlor Slackware 42 07-31-2004 09:32 AM
Dual boot, linux MBR on floppy question? Dobie Linux - Newbie 1 12-15-2003 10:19 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > General

All times are GMT -5. The time now is 10:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration