LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 06-30-2009, 04:53 AM   #1
bcbotha
Member
 
Registered: Nov 2008
Location: South Africa
Distribution: Ubuntu, Windows
Posts: 151

Rep: Reputation: 16
How to recover grub after installing XP


I'm running Ubuntu 9.04 on my laptop and decided to dual boot with XP. I have XP installed but only to realize that i never made a copy of my grub menu list. how can I recover my ubuntu partition or recover grub?

thanks
 
Old 06-30-2009, 06:12 AM   #2
watcher69b
Member
 
Registered: Nov 2007
Location: /home/watcher69b
Distribution: RH, Fedora & CentOS
Posts: 552

Rep: Reputation: 41
does your system boot using windows now or do you get the GRUB> prompt?

if you go right to windows use your Linux CD and boot to recovery mode. cd to /mnt/sysimage and do an ls
you should still see the /boot partition. if you do copy your grub.conf(menu.lst) file somewhere.
you should be able to fdisk -l (L as in LIST not I) to see if you can see your boot partition (usually 200mb +/-)
make sure it is marked bootable. if not then do fdisk /dev/<harddisknumber> once you are in fdisk i believe it is 'a' to mark bootable then 'w' to save changes. reboot and follow the directions below...


if you get the GRUB> prompt type initrd in<tab> to see if it auto completes the file name. if it does backspace and type grub setup.
if not then type root= (hd<tab> [it will list options]
root=(hd0,<tab> [again it will list options]
once you have found your /boot partition usually (hd0,0) type grub setup

the setup command is not destructive so dont worry...
 
Old 07-01-2009, 01:42 AM   #3
bcbotha
Member
 
Registered: Nov 2008
Location: South Africa
Distribution: Ubuntu, Windows
Posts: 151

Original Poster
Rep: Reputation: 16
thanks grub is now working but i cant load XP for grub. ive listed XP in grub as:
Code:
title Windows XP
root (hd0,1)
chainloader +1
makeactive
boot
but this does not work. when i type sudo fdisk -l i find XP on /dev/sda1.
the error im getting is: Error 13: Invalid or unsupported executable format

Press any key to continue...

Anything i can do?

thanks
 
Old 07-01-2009, 04:41 AM   #4
ronlau9
Senior Member
 
Registered: Dec 2007
Location: In front of my LINUX OR MAC BOX
Distribution: Mandriva 2009 X86_64 suse 11.3 X86_64 Centos X86_64 Debian X86_64 Linux MInt 86_64 OS X
Posts: 2,369

Rep: Reputation: Disabled
You stated root(hd0,1) it means that windows is on sda2 so the second partition of you're drive .
If it is on the first partition where windows normally is it should be (hd0,0)
Grub start counting with ZERO
If you are not sure run as su or sudo the command fdisk -l(l lower case) and post the outcome

Last edited by ronlau9; 07-01-2009 at 04:45 AM.
 
Old 07-01-2009, 06:57 AM   #5
bcbotha
Member
 
Registered: Nov 2008
Location: South Africa
Distribution: Ubuntu, Windows
Posts: 151

Original Poster
Rep: Reputation: 16
thanks ronlau9

i had the wrong partition. i logged on and changed the grub/menu.lst from (hd0,1) to (hd0,0) and it works. i can now boot to both now.

thanks again
 
  


Reply



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
LXer: Recover Ubuntu Grub loader after installing Windows LXer Syndicated Linux News 0 03-18-2009 05:20 PM
How to Recover GRUB!!! arun-linux Linux - Software 2 04-13-2008 01:31 PM
How to Recover GRUB!!! arun-linux Linux - Newbie 2 04-13-2008 01:28 PM
grub halts on "loading stage 1.5" after installing RECOVER PRO (asus) giuggioliniluca Linux - Software 2 09-06-2006 05:18 PM
GRUB to recover? allenpanther Red Hat 2 02-09-2004 07:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 10:32 AM.

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