LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 09-19-2008, 04:33 PM   #1
Darth Cupcake
Member
 
Registered: Nov 2006
Distribution: Slackware
Posts: 53

Rep: Reputation: 15
Issues Reinstalling GRUB


I recently decided to remove Windows Vista from my dual-boot and replace it with Windows XP. Originally, I was using the Vista boot loader to dual-boot between Linux and Vista. This required to have grub actually installed on my Linux partition and then the Vista boot loader booted into that to get to Linux. After I installed XP, it put on the XP boot loader. When I used a live CD to try to reinstall GRUB, it doesn't work. Specifically, when I attempt to use the root command to get to my Linux partition, I get Error 23. I'm not exactly sure what that means. I know Linux is on the first partition of my hard drive which is (hd0,0). Ever time I try to use grub-installer or setup, it gives me errors. I'm wondering if it might have something to do with the grub installation I had to put on the partition for the Vista boot loader. Any help or suggestions would be greatly appreciated.
Thanks

btw, I'm using 64-bit Ubuntu on a laptop.
 
Old 09-19-2008, 04:44 PM   #2
alpha01
Member
 
Registered: Jul 2008
Location: Orange County
Distribution: Ubuntu/Debian, CentOS, RHEL, FreeBSD, OS X
Posts: 75

Rep: Reputation: 19
Quote:
Originally Posted by Darth Cupcake View Post
I recently decided to remove Windows Vista from my dual-boot and replace it with Windows XP. Originally, I was using the Vista boot loader to dual-boot between Linux and Vista. This required to have grub actually installed on my Linux partition and then the Vista boot loader booted into that to get to Linux. After I installed XP, it put on the XP boot loader. When I used a live CD to try to reinstall GRUB, it doesn't work. Specifically, when I attempt to use the root command to get to my Linux partition, I get Error 23. I'm not exactly sure what that means. I know Linux is on the first partition of my hard drive which is (hd0,0). Ever time I try to use grub-installer or setup, it gives me errors. I'm wondering if it might have something to do with the grub installation I had to put on the partition for the Vista boot loader. Any help or suggestions would be greatly appreciated.
Thanks

btw, I'm using 64-bit Ubuntu on a laptop.
Are you using the Grub Super Disk? If not this might fixed your problem.

http://supergrub.forjamari.linex.org/
 
Old 09-19-2008, 05:13 PM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
If the grub shell from Live-CD Linux can't see the partition, then how is Super-GRUB going to help?

error 23 means there was an error in parsing a command. Make sure your "root" command is like this: "root (hd0,0)" where "0,0" means "first drive, first partition"
http://www.gnu.org/software/grub/man...index.html#Top

Running from the live CD, give us also the output of "fdisk -l"

Quote:
Ever time I try to use grub-installer or setup, it gives me errors.
You need to tell us what the errors are!!
 
Old 09-20-2008, 09:21 AM   #4
Darth Cupcake
Member
 
Registered: Nov 2006
Distribution: Slackware
Posts: 53

Original Poster
Rep: Reputation: 15
I figured Super GRUB Disk wouldn't be able to do anything a live CD can't, but thank you anyway alpha01.

here's my output on the live CD:

ubuntu@ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000080

Device Boot Start End Blocks Id System
/dev/sda1 1 6989 56139111 83 Linux
/dev/sda2 * 6990 13995 56275695 7 HPFS/NTFS
/dev/sda3 13996 14593 4803435 5 Extended
/dev/sda5 13996 14593 4803403+ 82 Linux swap / Solaris
ubuntu@ubuntu:~$ grub
Probing devices to guess BIOS drives. This may take a long time.

[ Minimal BASH-like line editing is supported. For
the first word, TAB lists possible command
completions. Anywhere else TAB lists the possible
completions of a device/filname. ]
grub> root (hd0,0)
root (hd0,0)

Error 21: Selected disk does not exist
grub> root (sd0,0)
root (sd0,0)

Error 23: Error while parsing number
 
Old 09-20-2008, 11:34 AM   #5
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,596

Rep: Reputation: 2502Reputation: 2502Reputation: 2502Reputation: 2502Reputation: 2502Reputation: 2502Reputation: 2502Reputation: 2502Reputation: 2502Reputation: 2502Reputation: 2502
From your last post, it looks like you are getting to the Grub prompt (grub>) with the live CD, but I'm confused about the entries you posted after that? When you get to the grub prompt you type: root (hd0,0)##hit the enter key, then type: setup (hd0)##hit the enter key, type: quit ##Hit the enter key. Should be done.
 
Old 09-20-2008, 01:15 PM   #6
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Quote:
Originally Posted by yancek View Post
From your last post, it looks like you are getting to the Grub prompt (grub>) with the live CD, but I'm confused about the entries you posted after that? When you get to the grub prompt you type: root (hd0,0)##hit the enter key,
Did you notice that that is exactly what he did??

Darth;
Your second attempt (root (sd0,0)) is invalid---GRUB uses only the hdx,y notation.

For some reason, your /dev/sda1 is not being recognized as hd0,0. You can try hd0,1 or maybe hd1,0

Also try grub's "find" command.

I am not at a computer with GRUB installed, so I can't do any experiments.

GRUB manual here:
http://www.gnu.org/software/grub/manual/grub.html#Top

Last edited by pixellany; 09-20-2008 at 01:33 PM.
 
Old 09-20-2008, 01:40 PM   #7
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
I'm back with GRUB installed...

Try something like this at the grub prompt:

find /boot/grub/stage1
OR
find /boot/vmlinuz

This will tell you if there are GRUB files or a kernel named vmlinuz anywhere.

You can also mount the partitions as reported by fdisk and poke around there.
 
Old 09-21-2008, 07:52 PM   #8
Darth Cupcake
Member
 
Registered: Nov 2006
Distribution: Slackware
Posts: 53

Original Poster
Rep: Reputation: 15
Output of your suggestions, pixellany:

grub> find /boot/grub/stage1
find /boot/grub/stage1

Error 15: File not found
grub> find /boot/grub/vmlinuz
find /boot/grub/vmlinuz

Error 15: File not found
grub> root (hd0,1)
root (hd0,1)

Error 21: Selected disk does not exist
grub> root (hd1,0)
root (hd1,0)

Error 21: Selected disk does not exist

The contents of /boot/grub on my linux partition:
default installed-version minix_stage1_5 xfs_stage1_5
device.map jfs_stage1_5 reiserfs_stage1_5
e2fs_stage1_5 menu.lst stage1
fat_stage1_5 menu.lst~ stage2
 
Old 09-22-2008, 04:50 PM   #9
Darth Cupcake
Member
 
Registered: Nov 2006
Distribution: Slackware
Posts: 53

Original Poster
Rep: Reputation: 15
All fixed!

I just had to type 'sudo grub' rather than 'grub' (I could have sworn I tried that before). I feel a little dumb right now. Thanks everyone for helping out.
 
Old 09-22-2008, 05:32 PM   #10
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Don't feel dumb!! This is not the first example of a program that wants root powers, but will sit in stony silence when you try to run it as a mere mortal.

The candidates for dummy include:
the author of the SW.
all the experts that assumed you were running as root, but did not say anything.

Glad to hear you got things working.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Reinstalling GRUB without Reinstalling my Distro MBA Whore Linux - Newbie 8 03-15-2008 08:39 PM
Reinstalling grub republicson Linux - Newbie 15 02-28-2006 01:35 PM
reinstalling GRUB vineet7kumar Linux - Newbie 1 01-15-2006 12:02 PM
reinstalling grub vineet7kumar Linux - General 2 01-10-2006 07:57 AM
reinstalling grub ELconkestador Linux - Software 1 02-12-2005 10:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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