Solved

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

Posted on 2008-11-02
11
1,585 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
 
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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
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 Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

This document is written for Red Hat Enterprise Linux AS release 4 and ORACLE 10g.  Earlier releases can be installed using this document as well however there are some additional steps for packages to be installed see Metalink. Disclaimer: I hav…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now