LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva
User Name
Password
Mandriva This Forum is for the discussion of Mandriva (Mandrake) Linux.

Notices


Reply
  Search this Thread
Old 07-20-2007, 02:58 AM   #1
varun_saa
Member
 
Registered: Dec 2004
Posts: 188

Rep: Reputation: 30
restore mbr


Hello,

I had windowsxp(FAT) with
mandriva spring.

I resinstalled windows NTFS mode
and I am not able to restore
my boot loader.

I used the DVD in restore mode
but it did not work.

Tried in console mode :

chroot /mnt/sysimage

/sbin/grub-install /dev/sda1

Did not work.

Further I tried :

chroot /mnt/sysimage

/sbin/grub-install --recheck /dev/sda1

But this also did not work

Is there a way to get my boot loader
back ?

Thanks in advance

Varun
 
Old 07-20-2007, 04:35 AM   #2
Zmyrgel
Senior Member
 
Registered: Dec 2005
Location: Finland
Distribution: Slackware, CentOS, RHEL, OpenBSD
Posts: 1,006

Rep: Reputation: 37
It should work by chrooting:
Code:
mount /dev/sda2 /mnt
mount -t proc proc /mnt/proc
mount -o bind /dev /mnt/dev
chroot /mnt /bin/bash
source /etc/profile
grub
> root (hd0,0)   <--- boot partition with GRUB
> setup (hd0)
> quit
// done
 
Old 07-20-2007, 05:14 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,120

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Quote:
Originally Posted by varun_saa
Tried in console mode :

chroot /mnt/sysimage

/sbin/grub-install /dev/sda1
You need to update the MBR, not the (partition) bootsector record.
try "/sbin/grub-install /dev/sda".
 
Old 07-20-2007, 02:38 PM   #4
ernie
Senior Member
 
Registered: Nov 2001
Location: Toledo, Ohio - USA
Distribution: Mageia 1
Posts: 1,079
Blog Entries: 4

Rep: Reputation: 70
If grub was correctly installed before reinstalling WinXP, you should be able to run the Mandriva DVD in rescue mode, then simply run the reinstall boot loader menu item. It has worked for me here in the past.

Another way (also using the Mandriva DVD in rescue mode) may be:

Select Go to a shell

Note: When you start the shell, you see a command to return to the rescue menu. Remember this command (I can not recall the command). You will need it when you are finished.

Create mount points to which you will mount your hard drive partitions:
Code:
mkdir /mnt/root
mkdir /mnt/root/home
mkdir /mnt/root/mnt/win_c
Mount your hard drive partitions (for the case where /dev/sdb1 is '/', /dev/sdb2 is /home, and /dev/sda1 is /mnt/win_c):
Code:
mount /dev/sdb1 /mnt/root
mount /dev/sdb2 /mnt/root/home
mount /dev/sda1 /mnt/root/mnt/win_c
The idea here is to mount your partitions so they are arranged as if you simply started Linux normally. Here is an example:

For the case where you mount the main Linux partition at '/', a second Linux partition at '/home', and your Windows partition at /mnt/win_c:

Mount the main Linux partition at /mnt/root, the second Linux partition at /mnt/root/home, and the Windows partition at /mnt/root/mnt/win_c

Now you are ready to start a changed root session (with your Main Linux partition on the hard drive as the root):

Code:
chroot /mnt/root
Next run MCC:

Code:
/usr/bin/drakconf
In the MCC menu navigate to the Boot loader menu item:
  • Press the UP ARROW key to move the cursor to the menu.
  • Press the DOWN ARROW key two times to move the cursor to the Boot loader menu item.
  • Press the TAB key to move the cursor to the OK item.
  • Press the ENTER key to start the Boot loader utility.
You should not need to make any changes in the Bootloader main options screen (the Boot device is usually /dev/sda and will only need to be changed if it points to a partition e.g.: /dev/sda1 or /dev/sdb2). Press the ENTER key to continue to the drakboot screen.

You should not need to make any changes in the drakboot screen either, so press the ENTER key to finish.

The Boot loader utility should save any changes you may have made, then install the bootloader to the MBR.

To close the changed root session press CTRL+D.

Enter the command to return to the rescue menu (from my note above).

In the rescue menu, choose the option to reboot the computer. It should eject the DVD for you then reboot.

When the computer reboots, you should have your boot menu again.

HTH,
 
  


Reply



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
How to restore MBR without using dos fdisk? Anjum Butt Linux - Newbie 11 04-25-2009 05:13 AM
restore MBR to use GRUB after OS rebuild goBoating Linux - General 3 06-16-2006 08:54 AM
restore old MBR? paperdiesel Linux - Software 2 08-10-2004 12:22 AM
restore mbr (in lilo and grub) abs Slackware 5 02-07-2004 02:39 PM
How do I restore LILO in the MBR? josedsilva Linux - Software 2 03-20-2003 12:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva

All times are GMT -5. The time now is 02:46 PM.

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