LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 05-13-2006, 10:53 AM   #1
SMGEG
LQ Newbie
 
Registered: May 2006
Posts: 20

Rep: Reputation: 0
Hard disk woes......please help


Recently I had a problem with one of my IDE drives.../dev/hda1. So I decided to replace it with a nice new sata drive. I am not using raid. I installed the drive....booted up and it was recognized by the BIOS as the 2nd drive. Grub pops up and I select my kernel and grub can't find it. Here is what I see (running Gentoo)

root (hd4,0)
Filesystem type is reiserfs, partition type 0xa5
kernel /boot/newkren root=/dev/sda3

Error 15: File not found

Press any key to continue

For further clarity:

/dev/sda1 = /boot
/dev/sda2 = swap
/dev/sda3 = /

grub-install has confirmed that sda is hd4...boot partition of course being hd40.

At any rate, I got out my Gentoo install CD...booted off it and noticed Linux does see all my partitions and everything looks good. So I mount /dev/sda1 to /mnt/Getnoo/boot and go over and look at my kernel newkern sitting right there in /boot. Everything worked fine prior to me installing the new SATA drive. Any ideas?
 
Old 05-13-2006, 02:18 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
I think I see the problem.

You have /boot in it's own partition, seperate from / (the root of the filesystem).

Your grub config doesn't tell grub where to find the rest of itself in /dev/sda1. Root is now in /dev/sda3 (hd4,2 in grub speak).

root (hd4,0)
Filesystem type is reiserfs, partition type 0xa5
kernel /boot/newkren root=/dev/sda3

Try editing the config so that it looks like this:

root (hd4,2)
Filesystem type is reiserfs, partition type 0xa5
kernel (hd4,0)/boot/newkren root=/dev/sda3

The addition of the /boot partition location in the kernel line is how it's shown in a SUSE installation. It may work in Gentoo as well.

Last edited by bigrigdriver; 05-13-2006 at 02:20 PM.
 
Old 05-13-2006, 06:50 PM   #3
SMGEG
LQ Newbie
 
Registered: May 2006
Posts: 20

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by bigrigdriver
I think I see the problem.

You have /boot in it's own partition, seperate from / (the root of the filesystem).

Your grub config doesn't tell grub where to find the rest of itself in /dev/sda1. Root is now in /dev/sda3 (hd4,2 in grub speak).

root (hd4,0)
Filesystem type is reiserfs, partition type 0xa5
kernel /boot/newkren root=/dev/sda3

Try editing the config so that it looks like this:

root (hd4,2)
Filesystem type is reiserfs, partition type 0xa5
kernel (hd4,0)/boot/newkren root=/dev/sda3

The addition of the /boot partition location in the kernel line is how it's shown in a SUSE installation. It may work in Gentoo as well.
Thank you for your help. I now get:

root (hd4,2)

Error 22: No such partition.


As a further point of clarification, this is not a new install. This grub config worked prior to me adding a new disk that currently has not been partitioned or even a file system built on it.Completely in the raw. I totally don't understand why this would cause grub not to boot.

Last edited by SMGEG; 05-13-2006 at 06:52 PM.
 
Old 05-13-2006, 07:15 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
IMO grub uses a file called device.map (/boot/grub/device.map) that looks similar in your case to the following:
Code:
# this device map was generated by anaconda
(fd0)     /dev/fd0
(hd0)     /dev/hda
.
. 
(hd4)     /dev/sda
It is used due to the fact that grub sometimes has problems guessing devices from the BIOS. When you removed the IDE drive the mapping changed and grub is now looking in the wrong place. Removing the old IDE device and reordering the devices should get you back in business.

This should also rebuild the device.map file
delete the old device.map file and invoke grub like:
grub --device-map=/boot/grub/device.map

Last edited by michaelk; 05-13-2006 at 07:17 PM.
 
Old 05-13-2006, 07:33 PM   #5
SMGEG
LQ Newbie
 
Registered: May 2006
Posts: 20

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by michaelk
IMO grub uses a file called device.map (/boot/grub/device.map) that looks similar in your case to the following:
Code:
# this device map was generated by anaconda
(fd0)     /dev/fd0
(hd0)     /dev/hda
.
. 
(hd4)     /dev/sda
It is used due to the fact that grub sometimes has problems guessing devices from the BIOS. When you removed the IDE drive the mapping changed and grub is now looking in the wrong place. Removing the old IDE device and reordering the devices should get you back in business.

This should also rebuild the device.map file
delete the old device.map file and invoke grub like:
grub --device-map=/boot/grub/device.map

Thank you. I do appreciate all your help. I cheated. I simply:

emerge --unmerge grub
emerge lilo

Back in business. Always was fond of lilo anyway.

That however is not to say this is all for not. Just out of curiosity, you mention grub is now looking in the wrong place. When you say that though, since we are speaking of the act of booting up the kernel, I almost wondered if for a moment you thought my kernel was on /dev/hda? My kernel was actually on /dev/sda1. I did remove /dev/hda though. I just wanted to clarify because this would be good to know going forward on other machines I have running grub still. If grub will fail to work on the removal of any drive, regardless of if it has a kernel on it or not...due to changes in the device map, that is good information.

Last edited by SMGEG; 05-13-2006 at 08:25 PM.
 
  


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
Cloning 1 hard disk to smaller hard disk, dd or ghost? fireman949 Linux - Hardware 8 12-23-2012 12:51 AM
60GB laptop hard disk & 200GB external USB hard disk linux compatibility powah Linux - Hardware 0 03-07-2006 10:55 AM
Hard disk/partition woes. "In interrupt handler - not syncing" Nathan-H2-Dog Linux - Laptop and Netbook 3 01-27-2006 04:54 PM
Reiser file system / Hard Disk/ Hard Drive Problems Oxyacetylene Linux - Software 4 10-10-2005 02:24 PM
Hard Disk question - Making a big hard disk MrAnonym Linux - General 2 09-15-2003 06:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

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