Page 1 of 2

How to revert to original mbr using grub4dos?

Posted: Sat 16 Jul 2011, 14:16
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)

Posted: Sat 16 Jul 2011, 14:26
by rcrsn51

Code: Select all

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

Posted: Sat 16 Jul 2011, 14:33
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?

Posted: Sat 16 Jul 2011, 15:41
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?

Posted: Sat 16 Jul 2011, 16:37
by rcrsn51
screwup22 wrote:Do I just open the Console terminal window and type the above code?
Yes.

restore mbr

Posted: Sat 23 Jul 2011, 12:24
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.

Posted: Sat 23 Jul 2011, 13:57
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/

Posted: Sat 23 Jul 2011, 15:49
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!!

Posted: Sat 23 Jul 2011, 16:00
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.

Posted: Sat 23 Jul 2011, 16:22
by Strampke
And what is that 'cat'-line please?
That's what screwup was asking for.

Posted: Sat 23 Jul 2011, 16:32
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.

Posted: Sat 23 Jul 2011, 22:53
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.

Posted: Sun 24 Jul 2011, 01:14
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

~

Posted: Sun 24 Jul 2011, 03:17
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.

Posted: Sun 24 Jul 2011, 03:40
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.

Posted: Sun 24 Jul 2011, 04:09
by Bruce B
Did someone forget to say: ms-sys --help ?

~

Posted: Sun 24 Jul 2011, 10:54
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

Posted: Sun 24 Jul 2011, 12:22
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.

~

Posted: Sun 24 Jul 2011, 13:37
by Strampke
Problem is fixed.
I appreciate the support from members of this forum.

Posted: Sun 24 Jul 2011, 15:33
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.

~