LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-04-2009, 03:37 PM   #1
ilw
LQ Newbie
 
Registered: Nov 2004
Posts: 8

Rep: Reputation: 0
Restore MBR and setup Grub correctly


A couple of days ago one of my hard drives died (it was master on the primary ide) and my computer no longer gets past the initial POST i.e. it gets to the stage where normally Grub would start doing stuff and just hangs.
From the little i know i'd guess that losing the hard drive has possibly meant i've lost or corrupted my MBR and has probably screwed up my Grub settings as well... I've tried following various instructions from the interweb, but nothing has changed - I think my almost total lack of knowledge of what i'm doing isn't helping so much.

Any help/advice would be appreciated! I've included some of the config info and results from common commands below

Code:
grub> find /boot/grub/stage1
 (hd0,0)


grub> geometry (hd0)
drive 0x80: C/H/S = 38913/255/63, The number of sectors = 625142448, /dev/sda
   Partition num: 0,  Filesystem type is ext2fs, partition type 0x83
   Partition num: 1,  Filesystem type unknown, partition type 0x82
   Partition num: 2,  Filesystem type is ext2fs, partition type 0x83

grub> geometry (hd1)
drive 0x81: C/H/S = 19457/255/63, The number of sectors = 312581808, /dev/sdb
   Partition num: 0,  Filesystem type unknown, partition type 0x6

grub> geometry (hd2)
drive 0x82: C/H/S = 24792/255/63, The number of sectors = 398297088, /dev/sdc
   Partition num: 0,  Filesystem type is ext2fs, partition type 0x83
I've tried running the setup command in grub, but it doesn't seem to have helped.

Heres my menu.lst


Code:
title		Ubuntu 8.04, kernel 2.6.24-16-generic
root		(hd0,0)
kernel		/boot/vmlinuz-2.6.24-16-generic root=UUID=074c9d6a-c235-4ef2-a129-b27316dd217d ro quiet splash
initrd		/boot/initrd.img-2.6.24-16-generic
quiet

title		Ubuntu 8.04, kernel 2.6.24-16-generic (recovery mode)
root		(hd0,0)
kernel		/boot/vmlinuz-2.6.24-16-generic root=UUID=074c9d6a-c235-4ef2-a129-b27316dd217d ro single
initrd		/boot/initrd.img-2.6.24-16-generic

title		Ubuntu 8.04, kernel 2.6.22-14-generic
root		(hd0,0)
kernel		/boot/vmlinuz-2.6.22-14-generic root=UUID=074c9d6a-c235-4ef2-a129-b27316dd217d ro quiet splash
initrd		/boot/initrd.img-2.6.22-14-generic
quiet

title		Ubuntu 8.04, kernel 2.6.22-14-generic (recovery mode)
root		(hd0,0)
kernel		/boot/vmlinuz-2.6.22-14-generic root=UUID=074c9d6a-c235-4ef2-a129-b27316dd217d ro single
initrd		/boot/initrd.img-2.6.22-14-generic

title		Ubuntu 8.04, memtest86+
root		(hd0,0)
kernel		/boot/memtest86+.bin
quiet


and my device.map

Code:
(hd0)	/dev/sda
(hd1)	/dev/sdb
(hd2)	/dev/sdc
 
Old 03-04-2009, 03:53 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 20,944

Rep: Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070
This should do it providing everything is in place.
Code:
root (hd0,0)
setup (hd0)
 
Old 03-04-2009, 04:04 PM   #3
ilw
LQ Newbie
 
Registered: Nov 2004
Posts: 8

Original Poster
Rep: Reputation: 0
thanks for the quick response, but i tried that before and it didn't seem to do anything.
 
Old 03-04-2009, 04:18 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 20,944

Rep: Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070
You mentioned you'd done the "setup" command - you didn't mention that you'd done the "root" first.
Do you see the boot menu ?. If not, hit the <Esc> key when post finishes (i.e. the blank screen) within a few seconds. Then select the recovery option. Post any interesting messages.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
restore mbr varun_saa Mandriva 3 07-20-2007 02:38 PM
How do I restore my MBR aka "Oops I messed up my Grub" codeape Debian 4 04-12-2007 11:14 PM
restore MBR to use GRUB after OS rebuild goBoating Linux - General 3 06-16-2006 08:54 AM
ubuntu: windows took over MBR and can't restore grub eantoranz Linux - Software 3 02-03-2006 08:29 PM
restore mbr (in lilo and grub) abs Slackware 5 02-07-2004 02:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:52 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