LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-03-2009, 11:50 AM   #1
vin1956
LQ Newbie
 
Registered: Feb 2009
Posts: 6

Rep: Reputation: 0
Loading Linux onto slave hard drive


Hello...
I'm a newbie to Linux and to this community and hope someone could give me some direction. (I originally posted in the "Newbie" forum and was told, though indirectly, to post it here.) I'm having difficulty loading Simply Mepis 7 on my second hard drive.

Here's my configuration:
HP Pavilion a 302x Desktop
Celeron 2.5 ghz/ 400 mhz frontside bus
2 gb ddr ram

HDD 1- 60 gb
Dual boot: Win 2000 & Win XP Pro.

HDD 2-10 gb

My situation:
I installed Mepis on HDD 2 as primary master drive. Rebooted and system loaded Mepis fine.
Reconfigured back to HDD 1 (Windows OSs)as primary master drive and HDD 2 as primary slave.
I then went into the bios and changed boot sequence to HDD 2 and it wouldn't boot into Mepis (I was able to install Ubuntu 8.04 and worked with this configuration just fine).

Here's the message I got when I tried to boot into Mepis with HDD 2 drive:
"Kernel panic-not syncing: no init found. Try passing init=option to kernel".

I bet if I change the configuration back to HDD 2 as primary master drive it would work (I haven't tried that though to see).

I don't want to load Mepis on HDD 1, I want to keep the OSs separate.

Does anyone have any suggestions?

Thanks,
Vin
 
Old 02-03-2009, 05:08 PM   #2
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
The problem is that drive letters change when you replace the primary and secondary hard disk.

Primary: sda (or hda)
Secondary: sbd (or hdb)

When the drive was primary, the system expected to find the root directory on sda1. When you have two drives in the system, Linux attempts to run from the slave, which is sdb now, but it still has pointers to sda1. And that doesn't work.

There are two ways to solve this:

One, the poor man's methos, quick and dirty:
Open /boot/grub/menu.lst and find the lines which boots the kernel you just installed. It looks something like this:
Code:
itle           Debian GNU/Linux, kernel 2.6.18-4-k7
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.18-4-k7 root=/dev/hda1 ro
initrd          /boot/initrd.img-2.6.18-4-k7
In the red line change hda1 to hdb1, or sda1 to sdb1, whatever you find there. Save the file.
Open /etc/fstab and find:
Code:
/dev/hda1       /               ext3    defaults,errors=remount-ro 0       1
/dev/hda6       /home           ext3    defaults        0       2
/dev/hda5       /usr            ext3    defaults        0       2
And change hda to hdb, or sda to sdb.

This method fails if you would decide to move your slave hard disk to the secondary controller, then it becomes hdc, and the game starts again.

It is better to refer to the disk partitions by UUID. You get the UUID's by issuing:
Code:
blkid
on the command line.

You get an answer like:
Code:
/dev/hda1: LABEL="boot" UUID="c1420be7-ac52-477b-b31d-820d809105dc" TYPE="ext3"
/dev/hda3: TYPE="swap"
/dev/hda5: LABEL="/usr" UUID="5c35c1c8-a5d5-4e9d-9655-55e4ea4fed9c" TYPE="ext3" SEC_TYPE="ext2"
/dev/hda6: UUID="e7307d00-7354-44d4-81d3-502a0a860b7c" TYPE="ext3" SEC_TYPE="ext2"
/dev/hda7: LABEL="/var" UUID="60bd51f9-d5b5-413a-b74a-b26a2fd96a46" TYPE="ext3" SEC_TYPE="ext2"
Now in the /boot/grub/menu.list change this part:
Code:
root=/dev/hda1
to:
Code:
root=UUID=c1420be7-ac52-477b-b31d-820d809105dc
Be very careful where the '=' symbols are and where the quotes are not. Obviously, don't use the UUID from this example, but those you found yourself.

In /etc/fstab, replace
Code:
/dev/hda1
with the correct UUID for hda1:
Code:
UUID=c1420be7-ac52-477b-b31d-820d809105dc
And the correct UUIDs for the other partitions as well. Replace only the part /dev/hda1 with that UUID string, nothing more, nothing less.

Boot it first while your disk is still primary, then try to put it as secondary.

If you edit those files, you have to do that as root. (or sudo, or use crtl-F2 to start a GUI editor as root, but best is to do this in a console. Use nano as your editor)

/boot/grub/menu.lst might be grub.conf on your system.

jlinkels
 
Old 02-06-2009, 04:17 PM   #3
vin1956
LQ Newbie
 
Registered: Feb 2009
Posts: 6

Original Poster
Rep: Reputation: 0
jlinkels...

Thank you for replying to my post so quickly.
If, after installing Mepis 7 and I can't boot into it, how do I perform the fix that you suggest?

Also, I re-tried to install Mepis 7 by leaving the configuration with HDD1 (the two Windows platforms) as primary master, and HDD2 (linux platform) as primary slave. I installed Mepis on sdb (HDD2). Rebooted, changed the boot sequence in the BIOS to boot from HDD2 (as primary slave) and it wouldn't boot it. I got the same message when trying to boot the Mepis system: "Kernel panic-not syncing: no init found. Try passing init=option to kernel". Now, I did this same routine with Mepis 3.4.3 and I was able to boot into HDD as primary slave, booting Mepis 3.4.3. That's what I'm using now on HDD2. What do make of that, that I could install and boot Mepis 3.4.3 on HDD2 but not Mepis 7?
Thanks,
Vin

Last edited by vin1956; 02-06-2009 at 04:30 PM.
 
Old 02-06-2009, 04:41 PM   #4
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
I like to load linux on and boot from the primary master, and put Windows on the slave or secondary master drive. Then, to boot Windows, use grub to swap logical drives, so that Windows thinks it is on the primary boot drive. The advantage here is that when Windows clobbers the master boot record on its drive, it doesn't over-write grub, but still satisfies its own requirements for an updated MBR. It makes it easy to either split up the drives to independent machines, or combine existing drives onto one machine.

A stanza in grub.conf something like this does the trick:
Code:
title Win XP
    map (hd0) (hd1)
    map (hd1) (hd0)
    rootnoverify (hd0,0)
    chainloader +1
    makeactive
--- rod.
 
Old 02-08-2009, 07:29 AM   #5
vin1956
LQ Newbie
 
Registered: Feb 2009
Posts: 6

Original Poster
Rep: Reputation: 0
Rod.....
Thanks for the suggestion, I appreciate it.
The reason why I'm using the sited configuration is because if/when my Windows partitions go down, I've had to install everything, including Linux when I had them all on the same HDD. So now I figured I'd separate the platforms on separate HDDs and Norton Ghost the Windows platforms (2000 & XP) in the event they go down, and don't have to start from scatch.
As I stated above, the only Mepis distro that I've been able to use in that configuration is 3.4.3. Do you have any idea why I'm able to boot independently into the primary slave (HDD2) with that distro and not Mepis 7 and don't get this message with 3.4.3, "Kernel panic-not syncing: no init found. Try passing init=option to kernel", that I get with Mepis 7?
Thanks.
Vin
 
Old 02-09-2009, 01:27 PM   #6
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
I think the reply by jlinkels has all the answers to your problem. It is up to the installer software to set up the bootloader according to your hardware configuration. If the disk configuration changes after the OS is installed, the you will have to make the accordant changes to the bootloader setup. It is also not outside the realm of possibility that the installer has not set up your bootloader correctly. However it came to be in the current state, jlinkels has given you a pretty good description of how to fix it, or at least get started on fixing it.
The key issue is that the kernel needs to be told where to find a root partition, and that the description of where that partition is, is dependent on how the disks are attached. Using UUIDs to describe the partitions is a very good way to insulate against changing configurations.
From the information you have provided, this should not be a difficult repair.
--- rod.
 
  


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
Loading Linux onto slave hard drive vin1956 Linux - Kernel 2 02-10-2009 05:44 AM
Loading Linux onto slave hard drive vin1956 Linux - Newbie 1 02-03-2009 12:00 PM
Loading Linux onto slave hard drive vin1956 Linux - General 1 02-03-2009 11:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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