LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 07-04-2005, 11:15 PM   #1
duffmckagan
Senior Member
 
Registered: Feb 2005
Distribution: Cent OS 6.4
Posts: 1,163

Rep: Reputation: 49
Multiple booting from the same kernel.


I have decided to give it a try this time.

I need to boot multiple distros off the same kernel. I will use the latest and the greatest.

Egag, I remember that you had told me about doing this sometime ago, and now the time has come.

I am sure there must be more guys who can help me out in this one.

I searched google for this, but did not get anything worth reading.

Please tell me any Hard n Fast rules that I need to follow for a successful install.

Thank you.
 
Old 07-05-2005, 12:21 AM   #2
gbhil
Member
 
Registered: Jan 2005
Location: /dev/input/chair0
Distribution: Slackware, Gentoo, Vector, Roll-your-own-with-GNU binutils
Posts: 174

Rep: Reputation: 30
Use Vanilla sources ( no red-hat or Gentoo style distro patched sources)
Make sure the same version of kernel headers is installed in each distro
put /boot on a seperate partition, and make sure it's not auto mounted at boot in each distro's fstab.
I also put /usr/src on a seperate partition, and mount it at boot via fstab on all distro's in case I need access to the kernel source
Build/rebuild the kernel on the same distro each time.
 
Old 07-05-2005, 12:34 AM   #3
duffmckagan
Senior Member
 
Registered: Feb 2005
Distribution: Cent OS 6.4
Posts: 1,163

Original Poster
Rep: Reputation: 49
Quote:
Use Vanilla sources ( no red-hat or Gentoo style distro patched sources)
Not sure what does this mean.
Does this mean I should download a Vanilla Boot Flavor kernel?
 
Old 07-05-2005, 01:07 AM   #4
windowsrefugeeX
Member
 
Registered: Apr 2004
Posts: 272

Rep: Reputation: 30
Vanilla means the kernel source code provided by http://www.kernel.org/
the actual code that has not been modify for a specific distro like FC or Gentoo.
 
Old 07-05-2005, 01:13 AM   #5
duffmckagan
Senior Member
 
Registered: Feb 2005
Distribution: Cent OS 6.4
Posts: 1,163

Original Poster
Rep: Reputation: 49
Quote:
the actual code that has not been modify for a specific distro like FC or Gentoo
I still don't get this.

Does it mean that I can't use the same kernel for Gentoo or FC?
 
Old 07-05-2005, 03:58 AM   #6
Nathanael
Member
 
Registered: May 2004
Location: Karlsruhe, Germany
Distribution: debian, gentoo, os x (darwin), ubuntu
Posts: 940

Rep: Reputation: 33
yes you can - the vanilla kernel :-)

general distro packages:

step 1: different distros have different software
step 2: you cannot use easily install SuSE RPM on FC
setp 3: nor can you (easily) install debian packages on FC or SuSE

--- can you follow so far?

kernel:

setp 1: as different distros have different software packages, they also have different patches for the kernel

step 2: using a kernel patched for debian on a FC system might slightly... NOT WORK! just because it is not for your system (to keep it simple)

step 3: Vanilla kernels are the... lets say: original kernels, no distro has layd hand on them, so they will work on any old system.

step 4: if you dont believe it: just try installing a suse kernel in your FC system... HINT: to not overwrite existing kernels or grub entries :-)
 
Old 07-05-2005, 05:22 AM   #7
windowsrefugeeX
Member
 
Registered: Apr 2004
Posts: 272

Rep: Reputation: 30
I would suggest you read this first dude so u can get a better understanding.



http://www.linux.org/lessons/interm/c2496.html
http://www.linux.org/lessons/interm/...IN-KERN-UPDATE
 
Old 07-05-2005, 05:33 AM   #8
Nobber
Member
 
Registered: Jun 2002
Location: Nova Scotia
Distribution: Debian (home), Kubuntu 7.04 (work)
Posts: 265

Rep: Reputation: 30
Quote:
Originally posted by gbhil
Make sure the same version of kernel headers is installed in each distro
That's unlikely to happen by chance, and it would be a bad idea to force it to happen. Kernel headers should be left alone!
 
Old 07-05-2005, 06:32 AM   #9
duffmckagan
Senior Member
 
Registered: Feb 2005
Distribution: Cent OS 6.4
Posts: 1,163

Original Poster
Rep: Reputation: 49
@Nathanael
That was a really cool explanation.


@windowsrefugeeX
Thanks for the link.



@Nobber
To understand that thing, i will need to take a look at the details of the pros and cons of the thing I am gonna do.
Thank you.

Last edited by duffmckagan; 07-05-2005 at 06:38 AM.
 
Old 07-05-2005, 07:37 AM   #10
runlevel0
Member
 
Registered: Mar 2005
Location: Hilversum/Holland
Distribution: Debian GNU/Linux 5.0 (“Lenny”)
Posts: 290

Rep: Reputation: 31
Re: Multiple booting from the same kernel.

[QUOTE]Originally posted by duffmckagan
I have decided to give it a try this time.
I need to boot multiple distros off the same kernel. I will use the latest and the greatest.
[quote]

I can't understand the reason why you want to install different distros with the same kernel.
What exactly are you trying to do?
Install more than one distro on a hard disk?

So if you are still wanting to continue, first choose the distros carefully. They must be distros which are able to run form a vanilla kernel.
AFAIK Gentoo, Slackware and Debian Sid would be good choices.

Once you got the distros you can use two approaches: Modular kernel and Initrd. As initrd is harder, and every distro calls it's own modules using a script we will use the first approach. The second, initerd is more elegant and effective, but it changes a lot from distro to distro, although there is a quick and dirty way to do even this, but I can't guarantee it works on Debian or Slackware.

As for the first try we will begin installing a Debian Sid. Choose the 'minimum install' so that you don't waste too much time in case it goes wrong. The most important thing to keep in mind is partitioning:

You must create a partition of 200-500MB in size called /boot and place it on the first sectors of the hardisk. If you are using more than one disk, place the /boot partition on the first ide, master. For the veterans: The size of /boot is big, I know, but it's preferable in order to be able to have various kernels and perhaps initrds stored there.

during install choose the GRUB bootloader as it's easier to use and in someway more powerful than Lilo

I haven't talked about hardware detection and all this, but it's more or less straightforward and I'm sure you know which hardware you have attached to your box.
So first install the Debian Sid and get the vanilla sources from here linux-2.6.12.2.tar.bz2 (Vanilla means 'untouched, simple' like vanilla ice).

Place the sources in /usr/src, decompress and make a symlink called linux:
Code:
mv linux-2.6.12.2.tar.bz2 /usr/src
cd /usr/src
tar xvfj linux-2.6.12.2.tar.bz2
ln -s  linux-2.6.12.2.tar.bz2 linux
A trick:
Make a small partition to be mounted at /usr/src, so you can share the same sources on all the distros.

Now you are done and you will be able to work with the kernel just like with the distro kernels. Compile a modular kernel...
If you have no clues on how to do this, please ask, I will tell you on a separate thread as it deserves an explanation of it's own.

Things to keep in mind:
Remember to enable all the filsystems you are going to use, this is no problem since you are using modules.
Once you have a running Debian make a copy of lsmod to see what modules are running with the distro's own kernel:
Code:
lsmod > /home/youruser/lsmod_backup
Copy also your /etc/modules.conf file so that you have a reference.

Now install the other distros. You can install Gentoo from a LiveCD, so this woul be my next choice.

Be sure that you are using the same versions of GCC, Binutils and the libc6 on each distro. Take Debian as the base for comparing. Gentoo has a deep repository and you will find any version there.

The trick is now to install the next distro ensuring that the compiler and the binutils are the same.
Keep in mind to not format /boot and /usr/src (You can also share /home/youruser to save space).

To get the same modules

As you already have the kernel in place what you need to do is editing /etc/grub/grub.conf so that it has an entry referring to the same kernel but with different root partitions.

From inside the new distro or a livecd mount the root partitions of both distros and using MC (the midnight commander) cd to the directory /lib/modules/2.6.12.2 on the first distro and just copy it to the second.

Now you need to edit the second istro's modules.conf so that it contains the same modules as the first and also all the other modules related stuff. I can't help you further here as every distro does this in a different way. In Debian it's /etc/modules.conf and in Gentoo it's /etc/modules.autload/kernel-2.6, dunno how this is configured in Slack...

I it happens that you need a module whih si not compiled just compile the kernel, as you sahre the source directory there will be no problem.


So that would be all. There will surely be lot's of problems as this is extremely experimental and you would need an exhaustive knowledge of every distro , how the base is set up, with which compiler and what differences exist between a vanilla and the distro's own kernel.

To ensure a proper functioning you would need to recompile at least the libc6 against the kernel sources with the same compiler.

Good luck.
 
Old 07-05-2005, 10:26 AM   #11
duffmckagan
Senior Member
 
Registered: Feb 2005
Distribution: Cent OS 6.4
Posts: 1,163

Original Poster
Rep: Reputation: 49
That is really a nice How to

Thanks for the help @runlevel0.

Cheers.
 
Old 07-05-2005, 01:26 PM   #12
runlevel0
Member
 
Registered: Mar 2005
Location: Hilversum/Holland
Distribution: Debian GNU/Linux 5.0 (“Lenny”)
Posts: 290

Rep: Reputation: 31
If you get it running, don't forget to:

A) Tell us
B) Write a Howto and post it here with all what you did and learned. Would be nice.

If you need help just post your questions, your idea is very interesting indeed.
 
Old 07-05-2005, 01:44 PM   #13
duffmckagan
Senior Member
 
Registered: Feb 2005
Distribution: Cent OS 6.4
Posts: 1,163

Original Poster
Rep: Reputation: 49
Thank you guys.

I am finding some help from Linux from Scratch.
I will post it soon here, I know problems are surely gonna come in my way. I will post them here.

Before trying it out, I am gonna read a lot about compiling kernels.

Well, can you make this a bit more clear?

>>Compile a modular kernel...

Does this mean, i need to include the required modules in my kernel for my hardware and stuff?
I have compiled the kernel around 4-5 times with Gentoo. It was the 2.6.11rc3-gentoo (I don't remember exactly.)


>>you would need an exhaustive knowledge of every distro , how the base is set up, with which compiler and what differences exist between a vanilla and the distro's own kernel.

Did not get this.
Can you provide more info on
1.How the base is setup and what compiler is used.
2.Differences between Vanilla and distros own kernel.

You may just point me to something, for reading.
I love reading and learning.

Thanks a lot for the support.

I guess the original idea is from egag, where are you man?
But I guess, he was trying to use it on different versions of Slackware.
 
Old 07-05-2005, 02:58 PM   #14
runlevel0
Member
 
Registered: Mar 2005
Location: Hilversum/Holland
Distribution: Debian GNU/Linux 5.0 (“Lenny”)
Posts: 290

Rep: Reputation: 31
>> Compile a modular kernel.

A dirty trick: After you configured the part related to your CPU, compile everything else as modules: If you don't know what it is, choose "M"...

Modules mean this: The part is compiled as a separate piece of code which is used when needed and left apart or unloaded when not. This has many advantages and the only drawback of being less secure if you plan to build a secure server or so. There are even distros which ship their kernels with extra arguments for make such as "make modular" so that you only have to chose the right architecture, save the config file and launch "make install"

Thus the kernel itself with help of the initscripts will take the modules it needs and simply ignore others.

Drawback is that some modules like some LAN cards need the actual hardware to compile. If you find an error just let this module aside.

Pretty good stuff to read and to learn is the documentation of the Gentoo distro, as it is very similar to a LFS, but based on scripts (it's to make it easier to maintain as Gentoo is an industrial strength distro):

Gentoo Handbook
Gentoo Linux documentation

As Gentoo is so basic it has a chapter for almost everything. You can use this documentation to install a Gentoo almost from scratch and also to learn how stuff works on any Linux system and most of the Un*xes.

There is also stuff here at LQ, look in the Wiki..

And if you want The Sources(TM): The Linux Documentation Project

There you will find documentation on most topics and also the Official HOWTOs, and even the mini-HOWTOs which covers almost every topic, from kernel, to i18n, disk partitioning or even how to connect a coffee machine to a RS232 port (it's not a joke).

Last edited by runlevel0; 07-05-2005 at 03:00 PM.
 
Old 07-05-2005, 10:07 PM   #15
duffmckagan
Senior Member
 
Registered: Feb 2005
Distribution: Cent OS 6.4
Posts: 1,163

Original Poster
Rep: Reputation: 49
Thanks.

I am looking forward on it.

>>(You can also share /home/youruser to save space).
NO way.
I have tried it out before.
It doesn't work properly.
I have had many problems with it. This is because the hidden files in the Home Folder, we simply ignore them! They cause a lot of problems. I have a thread on this too.
It would require a lot of tweaking to make that thing work.
Moreover, I don't need to save space. I have a 40GB HDD, dedicated to distros and 120GB HDD dedicated to Data.

Last edited by duffmckagan; 07-05-2005 at 10:11 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
Multiple booting options srivastava Linux - Software 2 05-19-2005 04:27 AM
booting new kernel. Booting new kernel dies with INIT: VFS issue, really mus335 Linux - General 0 04-21-2004 11:52 AM
Multiple booting NoviceW Debian 3 01-28-2004 07:08 AM
Multiple Booting xcaliba Linux - Software 2 12-29-2003 10:09 AM
multiple booting nonLinuxGuru Linux - General 7 03-16-2002 03:21 PM

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

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