LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 04-02-2005, 04:20 PM   #1
robintw
Member
 
Registered: Jul 2004
Posts: 48

Rep: Reputation: 15
Changing drives from primary to secondary controller


Hi all,

I've been having a few problems with my linux server recently - and have
come to the conclusion that IDE Channel 0 has failed. The hard drive on it
is still fine though (I've tested it using knoppix on another computer). I
have replaced the hard drive in my server - as master on the secondary
channel (IDE Channel 1) and it boots but gets part way throught the startup
and stops because it "Can't create the device node for hda2". Is that
because it is looking for it on IDE channel 0 and can't find it? Do I need
to configure something so it knows where the hard drive is? I have come to the conclusion that the drive is fine - I can put in on the secondary channel and boot knoppix and access it fine. I assume I need to edit some configuration files to tell grub where everything is...what do I need to edit and how do i need to change it.

Thank you in advance,

Robin
 
Old 04-02-2005, 07:46 PM   #2
knetknight
Member
 
Registered: Oct 2002
Location: Kansas City
Distribution: OpenSUSE, Fedora
Posts: 64

Rep: Reputation: 15
hi robin,

here's what i can think of off the top of my head.

0. make backup copies of any files before you edit them.

1. edit /boot/grub/menu.lst

change references to "hd(0,0)" to "hd(2,0)"

change the "root=/dev/hda#" kernel parameter to point to the root partitions new location, probably just need to change the "hda" part to "hdc" and leave the number that follows as-it-is.

here's an example from my own system:
(my root is on /dev/hda2 but you'll have to sub with whatever you use. i'd also change any other kernel paramters that point to anything on /dev/hda. again, probably just need to change anythiing that says "hda" to "hdc".)
Code:
kernel (hd0,0)/vmlinuz root=/dev/hda2
initrd (hd0,0)/initrd
would become
Code:
kernel (hd2,0)/vmlinuz root=/dev/hdc2
initrd (hd2,0)/initrd
2. edit /etc/fstab

this file shows which partitions are to be mounted for which parts of the filesystem.

same as in #1 above, change references to "hda" to "hdc" and leave the numbers that follow and anything else on the line alone.

here's an example from my own system:
Code:
/dev/hda2     /        ext3       acl,user_xattr     1 1
/dev/hda1     /boot    ext3       acl,user_xattr     1 2
/dev/hda5     swap     swap       pri=42             0 0
would become
Code:
/dev/hdc2     /        ext3       acl,user_xattr     1 1
/dev/hdc1     /boot    ext3       acl,user_xattr     1 2
/dev/hdc5     swap     swap       pri=42             0 0
i think that'll do it, please let me know how it goes.

Last edited by knetknight; 04-02-2005 at 07:50 PM.
 
Old 04-03-2005, 04:58 AM   #3
robintw
Member
 
Registered: Jul 2004
Posts: 48

Original Poster
Rep: Reputation: 15
Hi,

Thanks for your ideas - I am about to try them. At the moment I do not have any (hd0,0) bits - but I have (hd0,1) bits - should I just change that to (hd2,0)?

Robin
 
Old 04-03-2005, 05:06 AM   #4
robintw
Member
 
Registered: Jul 2004
Posts: 48

Original Poster
Rep: Reputation: 15
Hi

I have just tried your ideas - and changed (hd0,1) to (hd2,1) and changed all the hda's to hdc's and when I boot up grub gives an error saying "Error 21 - Selected disk does not exist".

Should I try (hd1,1) or what?

Any other ideas?

Cheers - and thanks for your help so far!

Robin
 
Old 04-03-2005, 09:14 PM   #5
knetknight
Member
 
Registered: Oct 2002
Location: Kansas City
Distribution: OpenSUSE, Fedora
Posts: 64

Rep: Reputation: 15
hi robin, i suggest you try this.

change the hd(2,1) entries in grub back to their original values, hd(0,1) i think.

however, leave the root= kernel parameter set to root=/dev/hdc#. (you probably know this but, just in case, leave # as whatever number is already there as that represents the partition number. since you simply moved the exact same drive to the secondary controller the partition number should stay the same.)

also, /etc/fstab should still contain references to the appropriate partitions on hdc instead of hda.

if this still doesn't work for you i ask you to post the complete contents of your /boot/grub/menu.lst and /etc/fstab files. i'm very interested in figuring this out with you and i'll duplicate your scenario on one of my test machines if i need to so that i can work with the problem first-hand to figure out what i'm missing.

keep me posted, thanks.

Last edited by knetknight; 04-03-2005 at 09:18 PM.
 
Old 04-04-2005, 04:37 AM   #6
robintw
Member
 
Registered: Jul 2004
Posts: 48

Original Poster
Rep: Reputation: 15
Thank you very much!

That seems to have solved it fine. It is now all working - and *phew* my webserver is now back up.

Thanks again!

Robin
 
Old 04-04-2005, 10:11 AM   #7
knetknight
Member
 
Registered: Oct 2002
Location: Kansas City
Distribution: OpenSUSE, Fedora
Posts: 64

Rep: Reputation: 15
great, glad to hear it. now i hope along with you that it actually fixes the initial problem.
 
Old 04-04-2005, 02:05 PM   #8
robintw
Member
 
Registered: Jul 2004
Posts: 48

Original Poster
Rep: Reputation: 15
Yep - it fixes the problem and its all fine now

Thank you very much!

Robin
 
  


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
primary - secondary DNS jsheffie Solaris / OpenSolaris 2 08-01-2005 06:55 AM
Primary and secondary group trophy Linux - Newbie 2 04-03-2004 12:30 AM
setting up primary HD and secondary HD dataport Linux - General 8 01-23-2004 10:18 PM
Using a primary/secondary HD slave mvendramini Linux - Hardware 4 04-20-2003 11:45 AM
Primary and Secondary DNS dilberim82 Linux - Networking 3 07-13-2001 10:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

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