LinuxAnswers - the LQ Linux tutorial section.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 07-10-2006, 10:09 PM   #1
Registered: Oct 2003
Location: Mississauga, ON
Distribution: Ubuntu 9.04
Posts: 494

Rep: Reputation: 30
Windows wipes out GRUB - can't load Ubuntu!

Hello everyone,

Could someone help me restore GRUB? Here's what I have done so far:

1.) Booted from Ubuntu Dapper Drake LiveCD
2.) I type sudo grub-install /dev/sda5 and get:
Probing devices to guess BIOS drives. This may take a long time.
Could not find device for /boot: Not found or not a block device.

3.) Mounted my Linux partitions under /mnt/linux. I have two linux partitions: one at /dev/sda7 which was mounted under /, and one at /dev/sda5 which was mounted under /boot/
So I typed in "sudo mount /dev/sda7 /mnt/linux/" and "sudo mount /dev/sda5 /mnt/linux/boot"

4.) Then I typed "sudo mount -o bind /proc /mnt/linux/proc"
5.) I sudo chroot /mnt/linux.
6.) sudo grub-install /dev/sda5 returns:
sudo: unable to lookup ubuntu via gethostbyname()

7.) I type sudo grub, get "sudo: unable to lookup ubuntu via gethostbyname()"
8.) I type grub. I enter grub.
9.) find /boot/grub/stage1 returns: Error 15: File Not Found
10.) I type root (hd0,4) (since /boot was at /dev/sda5), I get Error 21: Selected disk does not exist
11.) I type root (sd0,4), I get Error 23: Error while parsing number
12.) I type grub-install /dev/sda5 (without sudo), get:
/dev/sda5: Not found or not a block device.

What should I do?

Some helpful information:
Before chroot, if I type sudo fdisk -l, I get:

Disk /dev/sda: 60.0 GB, 60011642880 bytes
255 heads, 63 sectors/track, 7296 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 1 8 64228+ de Dell Utility
/dev/sda2 * 9 6087 48829567+ 7 HPFS/NTFS
/dev/sda3 6088 7295 9703260 5 Extended
/dev/sda5 * 6088 6098 88326 83 Linux
/dev/sda6 6099 6160 497983+ 82 Linux swap / Solaris
/dev/sda7 6161 6641 3863601 83 Linux
/dev/sda8 6642 7295 5253223+ b W95 FAT32

After chrooting, if I type fdisk -l, I get nothing.

My menu.lst had the following entry for Ubuntu:

title Linux 2.6.15-23-386
root (hd0,4)
kernel /vmlinuz-2.6.15-23-386 root=/dev/sda6 ro quiet splash
initrd /initrd.img-2.6.15-23-386


- Vince
Old 07-10-2006, 11:41 PM   #2
Daniel Ngu
LQ Newbie
Registered: Apr 2006
Distribution: Debian Sarge with kernel-image-2.6.8-3-686-smp
Posts: 9

Rep: Reputation: 0
Hi vincebs,

Do a update-grub after the chroot. That should restore your grub.

Old 07-17-2006, 03:30 PM   #3
Registered: Oct 2003
Location: Mississauga, ON
Distribution: Ubuntu 9.04
Posts: 494

Original Poster
Rep: Reputation: 30
Tried it and restarted, it didn't work

It still boots into Windows without GRUB loading.

Any other suggestions?
Old 07-17-2006, 04:09 PM   #4
Registered: Oct 2005
Location: Knoxville, Tn (USA)
Distribution: OpenSUSE, Ubuntu
Posts: 250

Rep: Reputation: 30
"updating" Grub will only reinstall the system files which are probably already there. When you installed Windows it rewrote the master boot record (MBR), so you will need to install Grub back to the MBR. You can do so with grub-install. See here for instructions from the Grub site.



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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
GRUB doesn't load Windows XP Vladk1000 Linux - Newbie 4 09-17-2005 04:08 AM
GRUB won't load Windows Norab Linux - Hardware 1 08-19-2005 02:33 PM
GRUB can't load Windows XP... Ubuntu for AMD K8 can't boot up Navyblue Linux - Newbie 20 07-31-2005 11:19 AM
Grub will not load Windows XP with Ubuntu dual boot Alex4R Linux - Software 1 03-26-2005 12:29 PM
trying to use Dell Restore disk wipes RH9 except for GRUB krome Linux - Software 5 11-03-2003 01:31 AM

All times are GMT -5. The time now is 08:12 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration