Author Topic: Easy MBR repair.  (Read 10966 times)

Offline lame_penguin

  • Full Member
  • ***
  • Posts: 61
Easy MBR repair.
« on: September 27, 2009, 11:59:39 PM »
Apologies if anyone else has posted this, I didn't find it when searching the forums. Boot a live cd, I used a PCLOS '07 disc I had handy. Click My Computer, System, your root partition. Root directory/desktop/repair mbr link on desktop. Run it, close/save the conf. file it shows, reboot.

It worked for me anyway, I could find my ubcd and didn't want to download it again..

lp
"It isn't easy having a good time.." (Frankenfurter)

The lame penguin- sleddin' along at the back of the pack..

Offline bicol_willem

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 2378
Re: Easy MBR repair.
« Reply #1 on: September 28, 2009, 01:51:21 AM »
Hmm, Start > System > Configuration > Boot and init > Redo MBR  is on the Live CD (PCLinuxOS) but I guess your solution would become handy when using a other distro's Live CD .... Will keep and try this tip, thx.

Online Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11591
  • ----IOFLU----
Re: Easy MBR repair.
« Reply #2 on: September 28, 2009, 10:57:46 AM »
Grub native install:

From a root terminal on any live CD from any distribution that uses grub; not grub2.

[root@localhost ~]# grub                                   <Enter>

grub> find /boot/grub/stage2                          <Enter>
 (hd0,0)                                   <-- Yours will vary depending on where Linux is installed. Use your results for next command.

grub> root (hd0,0)                             <Enter>
 Filesystem type is ext2fs, partition type 0x83

grub> setup (hd0)                         <Enter>
 Checking if "/boot/grub/stage1" exists... yes
 Checking if "/boot/grub/stage2" exists... yes
 Checking if "/boot/grub/e2fs_stage1_5" exists... yes
 Running "embed /boot/grub/e2fs_stage1_5 (hd0)"...  15 sectors are embedded.
succeeded
 Running "install /boot/grub/stage1 (hd0) (hd0)1+15 p (hd0,0)/boot/grub/stage2 /boot/grub/menu.lst"... succeeded
Done.

grub> quit                                     < Enter>

[root@localhost ~]#
« Last Edit: August 19, 2011, 01:08:17 PM by old-polack »
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

Offline bicol_willem

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 2378
Re: Easy MBR repair.
« Reply #3 on: September 28, 2009, 04:22:28 PM »
I feel like writing that on the wall OP !  One never knows ..  :D

Online Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11591
  • ----IOFLU----
Re: Easy MBR repair.
« Reply #4 on: September 28, 2009, 04:49:11 PM »
I feel like writing that on the wall OP !  One never knows ..  :D

It's simple enough to memorize. Lord knows I did. ;D ;D

You can find it here too, if you can boot the liveCD and get on the net. ;)
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

smcs_steve

  • Guest
Re: Easy MBR repair.
« Reply #5 on: September 29, 2009, 02:43:43 AM »
I feel like writing that on the wall OP !  One never knows ..  :D
+1

OP - thou art truly sagacious!

Offline coonhunter

  • Full Member
  • ***
  • Posts: 202
Re: Easy MBR repair.
« Reply #6 on: August 08, 2010, 03:28:35 PM »
If you run linux from within an extended partition then repairing the mbr is not enough.You may need to fix the extended partion as well which is the first 63 sectors of any logical partition.I would strongly recommend backing up your mbr and all the extended partions on a hard drive.This is simply done with sfdisk :

sfdisk -d /dev/hda > hdd_partions.save

This will save the mbr and all the extended partions into a file named hdd_partions.save (you can name this whatever you want).Remember to put the saved file onto a removable media because if the partion table gets hosed you won't have access to your OS!Replace /dev/hda with whatever hdd the OS is on.If the mbr or extended partions get messed up you can restore it with:

sfdisk /dev/hda < hdd_partions.save

Offline izto

  • Full Member
  • ***
  • Posts: 64
Re: Easy MBR repair.
« Reply #7 on: March 16, 2011, 04:09:20 PM »
grub> find /boot/grub/stage2
 (hd0,4)

grub> root (hd0,4)
 Filesystem type is ext2fs, partition type 0x83

grub> setup (hd0)
 Checking if "/boot/grub/stage1" exists... yes
 Checking if "/boot/grub/stage2" exists... yes
 Checking if "/boot/grub/e2fs_stage1_5" exists... yes
 Running "embed /boot/grub/e2fs_stage1_5 (hd0)"...  17 sectors are embedded.
succeeded
 Running "install /boot/grub/stage1 (hd0) (hd0)1+17 p (hd0,4)/boot/grub/stage2
/boot/grub/menu.lst"... succeeded
Done.

grub>


Will restart to try that...

Online wedgetail

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 2439
  • Any Bugs in site?
Re: Easy MBR repair.
« Reply #8 on: April 24, 2011, 10:11:57 PM »
izto
What happened here, did it work?    :)
32 bit: KDE (older) & various KDE-mini, ASUSTek P5P41D Rev X.0x, BIOS AMI0207 07/21/2009, "Pentium(R) Dual-Core CPU E5300 @ 2.60GHz", nVidia GeForce 9600 GT, 2x1GB Seagate Technology 1000528AS HDD
TV CompuPro VideoMate Vista E700 (not working in Linux), Acer X243HD LCD Screen