Restore MBR

Go there if you encounter an unexpected error when using the softare. For installation problems, use another forum.

Moderator: feffer

Post Reply
p4board
Posts: 2
Joined: Mon Oct 04, 2010 7:52 pm

Restore MBR

Post by p4board » Mon Oct 04, 2010 8:01 pm

Hi,

I have Windows installed onto my primary partition and I am triing to restore Ubuntu on it.
I succed in restore Image file, but disk is not bootable (Windows Boot remaining).
When I restore MBR from image first a message telling me that MBRs are not the same then an error "in use".
Is there a way to restore Linux Boot Loader and Windows Boot Loader using promt command ?

Thanks,

Olivier.

p4board
Posts: 2
Joined: Mon Oct 04, 2010 7:52 pm

Post by p4board » Tue Oct 05, 2010 7:38 am

Hi,

Reading documentation, partimage seems not to save partition table with images files contrary to NGhost for example.
Do I have to save MBR sépartly ?
If yes what is the option "restore MBR from image file" for ?

Thanks,

Olivier.

glene77is
Posts: 2
Joined: Mon Feb 28, 2011 4:21 pm
Location: Memphis, TN, USA

Restore MBR

Post by glene77is » Tue Mar 01, 2011 12:39 am

*(: Grub_Loader_Restore_110228B.txt

p4board,
Start by reading this article:

How to Repair a Corrupt MBR and boot into Linux ...
http://linuxhelp.blogspot.com/2005/11/h ... -boot.html
I just looked it up.

******************************************************************************************
Here is my example, from my systems.
I realize this is not a direct answer to your query.
But, I usually run Ubuntu, installed at (hd0,sda1).
It has an install to HD which also installs the MBR pointing to the current install.
I have several other OS on my computer, within the multi-booting scheme,
one of which is not ever located by the Grub2 routines.

My examples are from my Ubuntu Linux installation.
On the following info, read the help docs, so you know what to expect.
I offer a money-back-guarantee ! :)

#############################################
I have made use of these scripts:

from: Nathan729, Ubuntu forums.
Re: Altering MBR to point to new Partition.
The simplest solution is to boot from a Live-CD,
and then repair grub...

### grub-install
### (1) copies GRUB images into /boot/grub
### (2) uses grub-setup to install grub into the boot sector.

### Live-CD, Terminal, script Code:
sudo mkdir /mnt
sudo mount /dev/sda1 /mnt

### INSTALL, copy images and install MBR
sudo grub-install --root-directory=/mnt /dev/sda

sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys

### UPDATE grub.cfg
sudo chroot /mnt update-grub

sudo reboot.
********************************************************

****************************************************************************
The next routine assumes that you have a functioning MBR which is pointing elsewhere.

##############################################
from: PaulReaver

Join Date: Mar 2009
Location: south of heaven
Beans: 237
Ubuntu 10.04 Lucid Lynx

# Re: how to restore the grub laoder in ubuntu 10.4
# if your ubuntu is only installed on one partition ie / and on sda1

# boot into a Ubuntu Live-CD
# drop to terminal
# key these scripts.

# make directory in RamDisk.
sudo mkdir /mnt/temp
# mount real partition into RamDisk/mnt/temp
sudo mount /dev/sda1 /mnt/temp
# change root focus to RamDisk/mntTemp
sudo chroot /mnt/temp
# by way of interect reference (mount) call for "update-grub'
sudo update-grub
# exit
sudo shutdown -r

##################################################

glene77is---{^,^}---Memphis,TN,USA

Hartmut
Posts: 26
Joined: Thu Aug 26, 2010 10:06 am

Post by Hartmut » Wed Mar 02, 2011 4:57 pm

The easiest way is to use the supergrub disk http://www.supergrubdisk.org/ and boot the installed System
(supergrub reads the grub config from the harddisk), then use

Code: Select all

grub-install /dev/<<your-disk>>
reboot and everything is fine.

All other ways (LiveCD and so on) have to deal with the problem, that you have another root-device than your real system, so it is not the /boot/grub/*.conf it has to use.
And do not use

Code: Select all

dd if=boot.sek of=/dev/disk bs=512 count=1
because grub does not only use the first sektor, but also (depending on the setup) the following ones up to 1500 blocks.
I had a hard time to learn this lesson....

allissa
Posts: 1
Joined: Mon Jan 09, 2012 5:04 am

Post by allissa » Mon Jan 09, 2012 5:24 am

if you want it
you can try this reference

Code: Select all

_http://www.digitalissues.co.uk/html/os/misc/partimage.html
simple method
hope can help

Post Reply