How to revert to original mbr using grub4dos?

Booting, installing, newbie
Message
Author
screwup22
Posts: 4
Joined: Sat 16 Jul 2011, 13:59

How to revert to original mbr using grub4dos?

#1 Post by screwup22 »

Hi all,

I installed Lucid Puppy on my E drive after formatted it to ext2, leaving winXP on my C drive.

I also installed Grub4dos as a bootloader.

When installing Grub4dos, it said it there was an option to restore the original MBR.

At the time I stupidly didn't write down the thing it told me to do in order to go back to the original MBR, thinking I could just google it if I wanted to do this.

Anyway, I can't find anywhere how to restore this backup with whatever command I need, and I'm hoping that someone here will be able to help me.

I've tried using Windows Recovery COnsole on WinXP CD, but I just get a blue screen with WIndows Set Up as a title and no other options. My intention if I'd had options was to use fixmbr command in the hope of going back to windows only, and just using the puppy linux live Cd instead of having it as a dual boot on my hard drive.

Anyway,

I am hoping someone can give me clear instructions to guide me to restoring my backed-up copy of my original master boot record, using the terminal commands.

(this is driving me completely bonkers btw)

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#2 Post by rcrsn51 »

Code: Select all

ms-sys --mbr --write /dev/sda

screwup22
Posts: 4
Joined: Sat 16 Jul 2011, 13:59

#3 Post by screwup22 »

rcrsn51 wrote:

Code: Select all

ms-sys --mbr --write /dev/sda
thanks for the reply, but I wonder if you could kindly elaborate on what you've typed above, or if someone else could.

I need clear step by step instructions to try to get my old windows installed mbr back.

If not already obvious, I best state now that I'm a complete noob regarding linux.

do I just open the Console terminal window and type the above code?

screwup22
Posts: 4
Joined: Sat 16 Jul 2011, 13:59

#4 Post by screwup22 »

anyone help? or suggest where I can get help?

I'll summarise my first post:

I believe Grub4dos made a backup of my old master boot record.
I now want to restore that original master boot record (abandoning grub and puppy hard drive installation).

For some reason (unknown to me), I can't use the windows repair/recovery console with WinXP CD to fix the mbr.

(I intend format the sda6 partition with puppy live CD, after I've got mbr sorted)

any help out there? anyone?

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#5 Post by rcrsn51 »

screwup22 wrote:Do I just open the Console terminal window and type the above code?
Yes.

Strampke
Posts: 35
Joined: Sat 06 Jan 2007, 18:11

restore mbr

#6 Post by Strampke »

Canadians seem to be people of few words aren't they rcrsn1?

Maybe someone can enlighten this subject further.

At first install a small screen popped up with a different text than rc adviced.
It started with cat

Three questions:
- Can someone write down the 'cat' phrase again
- Is it possible to adapt the grub4dos help file in a way that it is possible to learn how to reset the mbr to its original state.
- Can someone explain the difference between the two commands to reset the mbr

Thanks a lot in advance for showing the commands AND explaining a bit.

big_bass
Posts: 1740
Joined: Mon 13 Aug 2007, 12:21

#7 Post by big_bass »

here's some more info

@rcrsn51 is helpful he may have been to busy to go into details at that time



a little GUI would be nice, hint coders
----------------------------------------------

This program is used to create Microsoft compatible boot records. It is able
to do the same as Microsoft "fdisk /mbr" to a hard disk. It is also able to
do the same as Microsoft "sys d:" to a floppy or FAT partition except that
it does not copy any system files, only the boot record is written.
Specifications of boot records is taken from
http://www.geocities.com/thestarman3/as ... detail.htm

The program is useful when using Linux to restore a backup of a reference
Microsoft Windows installation.

Author of this program is Henrik Carlqvist (henca@users.SourceForge.net), it
is available for download from http://ms-sys.sourceforge.net/

User avatar
Burn_IT
Posts: 3650
Joined: Sat 12 Aug 2006, 19:25
Location: Tamworth UK

#8 Post by Burn_IT »

If you can actually get into Windows there is a nice little boot sector manager called BOOTICE that has a Portable Apps version and handles all sorts of Boot sectors on all sorts of disks/flash drives.
It is a Gui as well as a command line tool and will generate boot code and put it in the right place for you.
It will also let you edit a BCD file (Vista and Windows 7) or a Grub4Dos menu.lst.
I've still to discover some of it's capabilities!!
"Just think of it as leaving early to avoid the rush" - T Pratchett

User avatar
Béèm
Posts: 11763
Joined: Wed 22 Nov 2006, 00:47
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

#9 Post by Béèm »

scewup22, Ypu screwed up.

It is always necessary to read and eventually make notes of what you are doing.

I suppose you can boot from the puppy CD.
If yes, you can probably find the menu.lst which is generated.
pen this file with an editor (probably geany) and look at the first part.
Normally the code to restore the MBR is mentioned there.
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
[url=http://puppylinux.org/wikka/HomePage]Consult Wikka[/url]
Use peppyy's [url=http://wellminded.com/puppy/pupsearch.html]puppysearch[/url]

Strampke
Posts: 35
Joined: Sat 06 Jan 2007, 18:11

#10 Post by Strampke »

And what is that 'cat'-line please?
That's what screwup was asking for.

User avatar
Béèm
Posts: 11763
Joined: Wed 22 Nov 2006, 00:47
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

#11 Post by Béèm »

Strampke wrote:And what is that 'cat'-line please?
That's what screwup was asking for.
This is the thread of screwup, not yours.
You were the one who brought up the cat issue, not screwup.
You should have noted the cat thing when you got it on the screen.

Screwup has got several solutions for his problem.
Let's wait which one did solve his problem.
Last edited by Béèm on Sat 23 Jul 2011, 23:01, edited 1 time in total.
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
[url=http://puppylinux.org/wikka/HomePage]Consult Wikka[/url]
Use peppyy's [url=http://wellminded.com/puppy/pupsearch.html]puppysearch[/url]

Strampke
Posts: 35
Joined: Sat 06 Jan 2007, 18:11

#12 Post by Strampke »

It is always necessary to read and eventually make notes of what you are doing.
You should have noted the cat thing when you got it on the screen.
@Béèm
So you are the teacher type.
Well instead of pinpointing others to what the should have done, you might consider just helping and explaining, because that is what this forum is all about my friend.

Bruce B

#13 Post by Bruce B »

Maybe best to avoid these topics. They become lengthy and no solution.

I could say get a Windows 98 boot floppy, boot with it and type A:FDISK /MBR, but people probably think that wouldn't work.

http://support.microsoft.com/kb/69013

~

cthisbear
Posts: 4422
Joined: Sun 29 Jan 2006, 22:07
Location: Sydney Australia

#14 Post by cthisbear »

But not with Grub 4 Dos....
see my post.

Boot Floppy...to fix MBR.

http://www.murga-linux.com/puppy/viewtopic.php?t=70076

""""

Chris.

hoven
Posts: 145
Joined: Mon 21 Jun 2010, 23:39

#15 Post by hoven »

Strampke wrote:
It is always necessary to read and eventually make notes of what you are doing.
You should have noted the cat thing when you got it on the screen.
@Béèm
So you are the teacher type.
Well instead of pinpointing others to what the should have done, you might consider just helping and explaining, because that is what this forum is all about my friend.
Strampke, I thought this was Puppy forum, cats shouldn't be talked about ;)

I don't think the cat thing is what you think it is. I might remember it wrongly but I don't think it did anything to restore the boot record. What it might have done is type out the contents of the menu.lst which might have instructions at the top on how to restore the boot record (which might have been using the dd command like: dd if=mbr.bin of=/dev/sdb).

Just use a text editor to open your menu.lst and read.

ms-sys --mbr --write /dev/sda
That writes a new Windows 98 style master boot record to the first hard drive.

dd if=/dev/sda of=/mbrbackup.bin bs=512 count=1
That copies the existing MBR (512 bytes long) to a backup file.

There are some boot records in the /usr/lib/syslinux folder.

dd if=/usr/lib/syslinux/mbr.bin of=/dev/sdb bs=440 count=1
That will write DOS/Windows boot record to second disk

cat menu.lst
That prints out menu.lst in terminal window

cat mbr.bin > /dev/sdb
That will also write mbr.bin to second disk.

I didn't know anything about Linux before reading this forum so hopefully I have it right.
Last edited by hoven on Sun 24 Jul 2011, 04:18, edited 2 times in total.

Bruce B

#16 Post by Bruce B »

Did someone forget to say: ms-sys --help ?

~

User avatar
Burn_IT
Posts: 3650
Joined: Sat 12 Aug 2006, 19:25
Location: Tamworth UK

#17 Post by Burn_IT »

Just to add a little spice :roll:

Microsoft changed the /MBR switch after ME and it overwrite a different length by four bytes.

> If you read again you will see that I told the user to use a *Windows
> 98* startup floppy and use the fdisk /mbr command, this command rewrites
> or zeros out the 4 byte long disk signature from offsets 1B8h through
> 1BBh. These are 4 of the famous 6 bytes that fdisk /mbr rewrites, it
> rewrites the 4 byte disk signature at bytes 440 to 443 along with the
> two bytes 444 & 445. Rewriting the disk signatures invalidates the
> Mount Manager's database and allows or causes it to reassign drive
> letters. The Windows 2000/XP fixmbr command does not rewrite these
> bytes, it rewrites the first 440 byte and doesn't touch the disk
> signature, fdisk /mbr rewrites the first 446 bytes and zeros out the
> signature.


Also there is an undocument switch /CMBR n where n is the drive number STARTING AT ONE NOT ZERO. see http://bharucha.com/tp701/fdiskSecrets.html
"Just think of it as leaving early to avoid the rush" - T Pratchett

Bruce B

#18 Post by Bruce B »

Burn_it -- thanks for that

A bit of trivia to add. If I want to run Microsoft on the hard disk, I like to let its software make the initial preparation. This includes calculating CHS the Microsoft way, partitioning the first partition and formatting it if it is to be used for the MS OS.

~

Strampke
Posts: 35
Joined: Sat 06 Jan 2007, 18:11

#19 Post by Strampke »

Problem is fixed.
I appreciate the support from members of this forum.

Bruce B

#20 Post by Bruce B »

Strampke wrote:Problem is fixed.
I appreciate the support from members of this forum.
Screw it up again so we can give more help. I was looking forward to over twenty pages worth of help.

~

Post Reply