Solved

GRUB loader missing... Ubuntu, linux, xp, dual boot

Posted on 2008-11-02
11
1,605 Views
Last Modified: 2013-12-15
I have a dual boot with XP Pro and Ubuntu 9.10.  When I first installed Ubuntu I messed up my partitions and had two empty partitions.  I went into XP and deleted them using Paragon Partition Manager.  I then updated the MBR.  I restarted my computer and it booted straight into Windows.  I use this computer primarily as my Linux system.  The GRUB loader has disappeared.  I'm not a very experience Linux user so I don't really know how to go about fixing this.  Can someone provide some help?  Thanks.
0
Comment
Question by:ubuntuguy
  • 5
  • 4
  • 2
11 Comments
 
LVL 4

Expert Comment

by:Kaddict
ID: 22863862
The answer is stated in your question :)

The answer is " I then updated the MBR. " ... When you update your MBR with a Windows Boot, then it boots straight into Windows because this is where the GRUB loader is located (in the MBR).

If you need help replacing a GRUB loader, then read the installation document of gentoo and you will (quickly) see how to boot from CD in order to get into your installed linux (the command is chroot, search it in the installation help)

Once you "chroot" 'ed your installed linux, just run grub-install /dev/your-hard-disk   (IDE normally installs on /dev/hda and SATA normally installs on /dev/sda, according to what I remember)

Best of lucks and feel free to ask further questions,

-kaddict
0
 
LVL 10

Expert Comment

by:Andrew Doades
ID: 22863864
http://www.supergrubdisk.org/

This looks very good, seems like a nice simple app and just for waht you want.
0
 
LVL 1

Author Comment

by:ubuntuguy
ID: 22863865
I have done the following to try to fix it.

1)  Booted into live CD
2) Went to terminal
sudo grub
find /boot/grub/stage1
( this returned (hd0,5)
root (hd0,5)
setup (hd0)

when I do setup(hd0) I get a message that says cannot install - invalid device
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 1

Author Comment

by:ubuntuguy
ID: 22863878
I'm thinking I should mount the system into a temp directory and then chroot from there and repeat the steps above.  I'll try it. I'll let you know what happens
0
 
LVL 4

Accepted Solution

by:
Kaddict earned 500 total points
ID: 22863882
Here's a quick CHROOT guide:

1. Boot on your live CD
2. Mount your linux partition
            sudo mkdir /media/system
            sudo mount /dev/partition /media/system      (where partition is like hda1 or sda1)
3.  Prepare the special folders
            sudo mount --bind /dev /media/system/dev
             sudo mount -t proc /proc /media/system/proc  
 4. Change your environment
            sudo chroot /media/system  
 

And what you want to do is reinstall grub so....

5. Reinstall grub
            sudo grub-install /dev/harddisk
(Where harddisk is like hda or sda) (not a partition like hda1 or sda1)


Good luck!

-kaddict
0
 
LVL 4

Expert Comment

by:Kaddict
ID: 22863884
Ubuntuguy: Right on, just posted the how to :)
0
 
LVL 1

Author Comment

by:ubuntuguy
ID: 22863898
how does supergrubdisk work?  I have no idea how I'm supposed to use it
0
 
LVL 10

Expert Comment

by:Andrew Doades
ID: 22863919
I personally don't know, someone a while back told me about this, and I thought I would share with you here as it seems perfect for the job in hand

http://www.supergrubdisk.org/wiki/
0
 
LVL 1

Author Comment

by:ubuntuguy
ID: 22863980
Kaddict I tried your steps and I get the following:

Searching for GRUB installation directory ... found: /boot/grub
The file /boot/grub/stage1 not read correctly
0
 
LVL 4

Expert Comment

by:Kaddict
ID: 22863990
A quick google gives some results with people having that issue

Here's a paste from http://www.linuxquestions.org/questions/linux-software-2/gentoo-grub-the-file-bootbootgrubstage1-not-read-correctly-275708/

"Your fstab indicates the root of the filesystem is /dev/sda3 (grub hd0,2), but your grub.conf says 'root (hd0,0). Grub is looking in the wrong place for the root of the filesystem.
 And, since /boot is in it's own partition, shouldn't the grub.conf kernel line begin:
 kernel (hd0,0)/kernel-2.6......"

I guess you have exactly the same issue but with different parameters. Look at your fstab's root and grub.conf's root and boot partitions. I don't know exactly how your system is configured, but if you look carefully you may just point up the error.

good luck

-kaddict
0
 
LVL 1

Author Comment

by:ubuntuguy
ID: 22863993
I always get problems with my linux system when I have it with windows as a dual boot... I think I'm saying bye to windows forever on this machine. Kaddict I'm sure your solution is right... I was trying to fix it another way and I know I did something to the stage1 file.  
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. http://www.linuxmint.com. Once you open the link you will see …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question