LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 03-04-2005, 10:35 PM   #1
emendelson
LQ Newbie
 
Registered: Mar 2005
Posts: 6

Rep: Reputation: 0
Grub setup for Linux moved to 2nd HDD?


Here's a problem that may be impossible to solve, but I hope it isn't: I've installed SUSE 9.2 on the main hard disk in my ThinkPad T42, and put the bootloader on /dev/hda1. Now I want to take this HDD and put in a Second Hard Disk adapter so that I can put back the Windows HDD that was originally the main hard disk. I want to be able to write a GRUB menu that will let me boot from the SECOND (Linux) HDD and run Linux. I've tried various permutations of the map command in GRUB, but haven't got it solved yet. Can anyone help?

Here is what I've tried in menu.list:

<<first - the original setting for use when Linux is on the main HDD>>

title SUSE LINUX 9.2
kernel (hd0,0)/vmlinuz root=/dev/hda5 ...
initrd (hd0,0)/initrd

<<Then, my attempt at the new setting for use when it's on the 2nd HDD>>

title SUSE 9.2 from 2nd HDD
map (hd0) (hd1)
map (hd1) (hd0)
kernel (hd0,0) <<etc. as in the original>>

This doesn't work - Linux starts booting, then gives me a kernel panic when it doesn't recognize any file system on hda5.

Can anyone suggest a menu item that will work in this situation? Many thanks
 
Old 03-04-2005, 11:51 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
Let's see if I understand this correctly.
You will reinstall the Win HDD as primary, and Linux will be secondary. Therefore, win will be on /dev/hda and Linux will be on /dev/hdb. Is that correct?
If so, then edit the grub.conf (or menu.lst, is that's what your distro uses) to point grub to /dev/hdb1. change the config lines to point to hdb1 (grub notation:kernel (hd1,0)/vmlinuz root=/dev/hdb5), initrd (hd1,0)/initrd.
Then edit the windows config lines (no need for the map options if win is on hda).
BTW, your example shows SuSE on both HDDs.
Finally, you need a backup means of booting into the Linux install so that your can re-install grub to the MBR of the Primary HDD (hda).
 
Old 03-05-2005, 10:57 AM   #3
emendelson
LQ Newbie
 
Registered: Mar 2005
Posts: 6

Original Poster
Rep: Reputation: 0
Many thanks for your help!

Yes, I should have made this clearer. I don't have a USB CD/DVD drive for this laptop, so the only practical way to install Linux on its own HDD from a CD or DVD is by taking out the original Windows HDD, and putting in the Linux HDD as the main HDD.

What I want to do now is put the Windows HDD back in the main drive slot, and put the Linux HDD in the ThinkPad 2nd HDD adapter. With a little experimenting, I see that GRUB/Linux refers to the drive in the 2nd HDD as hdc (not hdb), so I've tried the following:


title SUSE 9.2 from 2nd HDD hd1
kernel (hd1,0)/vmlinuz root=/dev/hdc5 ...
etc etc.

Notice the hdc5 as the root. This starts the initial non-gui stage of booting going, but then it stops when it can't check the file system on hda5 (that's hda - the Windows disk). BTW, trying h0,0 instead of hd1,1 fails completely: Grub can't find anything to boot.

Anyway, this may or may not be possible, but if I could avoid buying a USB DVD (which would let me install directly to the second HDD), I like to be able to do so.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Setting up Linux on a 2nd HDD? jacatone Linux - Newbie 4 03-06-2004 10:12 PM
2nd hdd for linux 54az Linux - Newbie 7 02-06-2004 05:12 PM
1st HDD = RH9.0 (grub) ... How do I modify grub when adding 2nd hard disk ? Onyx^ Linux - Software 1 09-05-2003 09:16 AM
installing SuSe Linux on 2nd (windows 98) HDD camtheoz Linux - General 1 05-16-2002 03:58 PM
Linux boot from 2nd HDD in T21 pholm01 Linux - Software 4 12-14-2001 08:41 AM

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

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