LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Home Forums HCL Reviews 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 01-27-2005, 06:26 PM   #1
Ekpyrotic
Member
 
Registered: Jul 2003
Distribution: Mandrake, Debian, Fedora, Gentoo (almost)
Posts: 57

Rep: Reputation: 15
GrUB: Selected Disk Does not Exist


Happy I was, using my dual-boot FC3/WIndows laptop, when one dark and cloudy day GrUB decides that it hates me.

I hadn't altered grub.conf, hadn't touched device.map, hadn't really messed with anything. All of a sudden though, GrUB decided that it was just going to hang after the BIOS finished loading and print the word GRUB on the screen. That's it., 'GRUB' and a blinking cursur. I don't even get to the menu.

With a sigh, I went over to my neighbors house and downloaded Knoppix. Booted onto the live CD, chrooted, and examined my grub config. As I thought, everything was as I had left it. Here are the contents of grub.conf and device.map:

[root@Knoppix grub]# cat grub.conf

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd0,4)
# kernel /boot/vmlinuz-version ro root=/dev/hda5
# initrd /boot/initrd-version.img
#boot=/dev/hda5
default=3
timeout=5
splashimage=(hd0,4)/boot/grub/splash.xpm.gz
hiddenmenu
title Fedora Core (2.6.10)
root (hd0,4)
kernel /boot/vmlinuz-2.6.10 ro root=LABEL=/ rhgb quiet
initrd /boot/initrd-2.6.10.img
title Fedora Core (2.6.9-1.667smp)
root (hd0,4)
kernel /boot/vmlinuz-2.6.9-1.667smp ro root=LABEL=/ rhgb quiet
initrd /boot/initrd-2.6.9-1.667smp.img
title Windows XP
rootnoverify (hd0,1)
chainloader +1

[root@Knoppix grub]# cat device.map
# this device map was generated by anaconda
(fd0) /dev/fd0
(hd0) /dev/hda

I tried running grub-install, and I think I may have discovered the problem:

[root@Knoppix grub]# grub-install hd0
/dev/hda5: Not found or not a block device.

[root@Knoppix grub]# grub-install hda
/dev/hda5: Not found or not a block device.

And here is some further confirmation:

GNU GRUB version 0.95 (640K lower / 3072K upper memory)

[ 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/filename.]

grub>
root (hd0,4)

Error 21: Selected disk does not exist

grub>

Can anyone tell me what the hell is going on?

Many thanks,

Will
 
Old 01-27-2005, 06:34 PM   #2
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 373Reputation: 373Reputation: 373Reputation: 373
That is a bit odd. Did you add any new hardware? Change the internal device connections?

I had a problem with grub after something along those lines. It might not work for you, but it wouldn't hurt. Boot knoppix, chroot into your system, and execute:
Code:
grub-install --recheck /dev/hda
That will force grub to re-verify its device mapping even though the device.map file exists. Like I said, I don't think it'll hurt anything, so it's worth a shot.
 
Old 01-27-2005, 06:37 PM   #3
Ekpyrotic
Member
 
Registered: Jul 2003
Distribution: Mandrake, Debian, Fedora, Gentoo (almost)
Posts: 57

Original Poster
Rep: Reputation: 15
[root@Knoppix grub]# grub-install --recheck /dev/hda
Probing devices to guess BIOS drives. This may take a long time.
/dev/hda: Not found or not a block device.
[root@Knoppix grub]#


The only thing I can think of that I did was to install the ATI drivers. That involved compiling a kernel module and editing xorg.conf; none of those things should have screwed with GRUB, right?
 
Old 01-27-2005, 06:46 PM   #4
uberNUT69
Member
 
Registered: Jan 2005
Location: Tasmania
Distribution: Xen Debian Lenny/Sid
Posts: 578

Rep: Reputation: 30
just as a sanity check, what does fdisk -l /dev/hda produce while in knoppix?
 
Old 01-27-2005, 06:47 PM   #5
Ekpyrotic
Member
 
Registered: Jul 2003
Distribution: Mandrake, Debian, Fedora, Gentoo (almost)
Posts: 57

Original Poster
Rep: Reputation: 15
root@ttyp1[knoppix]# fdisk -l /dev/hda

Disk /dev/hda: 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/hda1 1 6 48163+ 16 Hidden FAT16
/dev/hda2 * 7 5563 44636602+ 7 HPFS/NTFS
/dev/hda3 6839 7295 3670852+ db CP/M / CTOS / ...
/dev/hda4 5564 6838 10241437+ f W95 Ext'd (LBA)
/dev/hda5 5564 6708 9197181 83 Linux
/dev/hda6 6709 6838 1044193+ 82 Linux swap

Partition table entries are not in disk order
root@ttyp1[knoppix]#
 
Old 01-27-2005, 06:47 PM   #6
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 373Reputation: 373Reputation: 373Reputation: 373
Nope, they shouldn't have done a thing to grub.

The only other thing I could think to try is fsck'ing your partitions. Maybe grub is bothered by something Knoppix doesn't mind.

I'm at a loss to explain it, because you're clearly mounting the partitions through Knoppix, and that means Knoppix is capable of recognizing /dev/hda & reading/writing to it. From what grub is saying, you'd think the drive had gone bad.
 
Old 01-27-2005, 06:48 PM   #7
Ekpyrotic
Member
 
Registered: Jul 2003
Distribution: Mandrake, Debian, Fedora, Gentoo (almost)
Posts: 57

Original Poster
Rep: Reputation: 15
I'm tempted to just fdisk the mbr and install grub from scratch, after backing up my grub.conf file of course. Anyone think this is a good idea?
 
Old 01-27-2005, 06:49 PM   #8
Ekpyrotic
Member
 
Registered: Jul 2003
Distribution: Mandrake, Debian, Fedora, Gentoo (almost)
Posts: 57

Original Poster
Rep: Reputation: 15
It's bad form to reply to oneself, but then again -- grub-install hda already failed, so I guess my previous post was just wishful thinking.
 
Old 01-27-2005, 06:51 PM   #9
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 373Reputation: 373Reputation: 373Reputation: 373
Quote:
Originally posted by Ekpyrotic
Partition table entries are not in disk order
I've never seen that message before. One thing you could try is to go into fdisk, delete your swap partition, save & exit, re-enter, recreate the swap, save & exit.

Just something to re-write the partition table without losing any data.
 
Old 01-27-2005, 06:53 PM   #10
Ekpyrotic
Member
 
Registered: Jul 2003
Distribution: Mandrake, Debian, Fedora, Gentoo (almost)
Posts: 57

Original Poster
Rep: Reputation: 15
Ugh... I have this personal rule: No fdisking after midnight. Currently where I am it's 3 in the morning, but I guess this is an emergency...

I'll let you know how it goes.

Pray for me (and my data)
 
Old 01-27-2005, 06:59 PM   #11
Ekpyrotic
Member
 
Registered: Jul 2003
Distribution: Mandrake, Debian, Fedora, Gentoo (almost)
Posts: 57

Original Poster
Rep: Reputation: 15
The result of my post-midnight fdisking:

Disk /dev/hda: 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/hda1 1 6 48163+ 16 Hidden FAT16
/dev/hda2 * 7 5563 44636602+ 7 HPFS/NTFS
/dev/hda3 6839 7295 3670852+ db CP/M / CTOS / ...
/dev/hda4 5564 6838 10241437+ f W95 Ext'd (LBA)
/dev/hda5 5564 6708 9197181 83 Linux
/dev/hda6 6709 6838 1044193+ 82 Linux swap

Partition table entries are not in disk order

Command (m for help): v
16251 unallocated sectors

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
root@ttyp1[knoppix]#

Chrooted and:

[root@Knoppix boot]# grub-install --recheck /dev/hda
Probing devices to guess BIOS drives. This may take a long time.
/dev/hda: Not found or not a block device.
[root@Knoppix boot]#
 
Old 01-27-2005, 07:01 PM   #12
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 373Reputation: 373Reputation: 373Reputation: 373
Ewww... from the warning it spat out, you may need to reboot twice:
1) After you delete the swap
2) after you recreate the swap

If the partition table is the problem, then it's no good if the kernel is using the original one.
 
Old 01-27-2005, 07:04 PM   #13
Ekpyrotic
Member
 
Registered: Jul 2003
Distribution: Mandrake, Debian, Fedora, Gentoo (almost)
Posts: 57

Original Poster
Rep: Reputation: 15
So to summarize, so I don't screw this up, I should fdisk the swap into oblivion, reboot with knoppix, make a new swap, reboot again, and then try grub-install --recheck?
 
Old 01-27-2005, 07:06 PM   #14
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 373Reputation: 373Reputation: 373Reputation: 373
Yeah, that's the game plan I would try.

I'll keep my fingers crossed.
 
Old 01-27-2005, 07:19 PM   #15
uberNUT69
Member
 
Registered: Jan 2005
Location: Tasmania
Distribution: Xen Debian Lenny/Sid
Posts: 578

Rep: Reputation: 30
just a note about "Partition table entries are not in disk order"

while in fdisk, go to "x extra functionality (experts only)" and then "f fix partition order"
 
  


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
Error 21: Selected disk does not exist satimis Linux From Scratch 2 08-04-2005 03:35 PM
Grub Error 17: Cannot mount selected partition and other Grub problems Sebastian Naitsabes Linux - General 1 07-05-2005 09:33 AM
Grub SuSe, XP, Redhat Error 17: Cannot mount selected partiton hrg Linux - Laptop and Netbook 1 07-16-2004 05:34 PM
Grub SuSe, XP, Redhat Error 17: Cannot mount selected partiton hrg Linux - General 1 07-16-2004 10:14 AM
grub jamming when windows selected nikd Linux - Newbie 10 11-22-2003 02:42 AM

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

All times are GMT -5. The time now is 02:15 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration