LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices

Reply
 
Search this Thread
Old 08-02-2009, 06:49 AM   #1
betula
Member
 
Registered: Aug 2008
Posts: 165

Rep: Reputation: 15
So I want to chainload?


I have a cd of Gparted and it seems easy to set up a bare hard disk. I want to install three or four distros, having first set up the partitions.

Okay, so I install the 'master' distro in partition #1. Do I then use the chainload command for the next distro in the next partition? Or do I install the four distros first and then set up chainloader?

I also don't quite understand if the chainloader commands (three of them) were to be all on one line or each on its own line.

I really would like to get to grip with this so would appreciate some advice here, please.
 
Old 08-02-2009, 07:14 AM   #2
ronlau9
Senior Member
 
Registered: Dec 2007
Location: In front of my LINUX OR MAC BOX
Distribution: Mandriva 2009 X86_64 suse 11.3 X86_64 Centos X86_64 Debian X86_64 Linux MInt 86_64 OS X
Posts: 2,369

Rep: Reputation: Disabled
Quote:
Originally Posted by betula View Post
I have a cd of Gparted and it seems easy to set up a bare hard disk. I want to install three or four distros, having first set up the partitions.

Okay, so I install the 'master' distro in partition #1. Do I then use the chainload command for the next distro in the next partition? Or do I install the four distros first and then set up chainloader?

I also don't quite understand if the chainloader commands (three of them) were to be all on one line or each on its own line.

I really would like to get to grip with this so would appreciate some advice here, please.
There different ways to do it.
Let say you wish to install 4 distro .
You have made four partitions
The most easy to start with the distro on partition 4 writing GRUB in the boot sector of partition
Same goes for partition 3 and 2
The distro in partition 1 write grub in MBR
Mostly each distro know there arte other distros and put it in there menu.lst
If you already has a distro in partition and after wards you install a
distro in partition 4
Add in the menu.lst of the distro in partition 1

title OS X
root (hd0.3) meaning sda partition 4
configfile /boot/grub/menu.lst

This one way of chain loading
But remeber the second the third and fourth distro has in their menu.lst
all the distro that were already there.
So you some tweaking to do in the menu.lst
 
Old 08-02-2009, 07:16 AM   #3
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
I start with the partitioning of the hd. I make a 200 meg partition for grub (can be primary or logical). I then install grub to that partition and build a menu.lst to boot all other partitions. You can boot a linux distro and chainload from it but if you get an upgrade or change that distro you will have to build another menu.lst. If you install grub in its own partition you can change all the distros without any boot problems as long as you install their boot loader to /. The only problem I have with this is I get lazy about changing the name when I change distros and my menu.lst might say you are booting fedora and you will actually be booting ubuntu or what ever I change the distro to, but the idea is the partition will boot no matter which distro you have there. Here is a tutorial for the method I use.


http://www.justlinux.com/forum/showt...hreadid=147959

Last edited by Larry Webb; 08-02-2009 at 07:20 AM.
 
Old 08-02-2009, 08:14 AM   #4
betula
Member
 
Registered: Aug 2008
Posts: 165

Original Poster
Rep: Reputation: 15
Well, I asked for it, didn't I? A couple of very interesting replies which will take a quite a bit of study on my part. Thanks for them.

A few little questions before I settle down it:

Is a 'menu lst' something I have to create or just open as root for each distro?
Googling tells me that I shall have to have a 'grub floppy' to be able to place grub in its own little partition. Is this right?
Once I've placed grub, how would I create a boot menu to boot all the partitions and where would this be placed?

That guy who has 145 distros on his computer must be something!
 
Old 08-02-2009, 08:23 AM   #5
ronlau9
Senior Member
 
Registered: Dec 2007
Location: In front of my LINUX OR MAC BOX
Distribution: Mandriva 2009 X86_64 suse 11.3 X86_64 Centos X86_64 Debian X86_64 Linux MInt 86_64 OS X
Posts: 2,369

Rep: Reputation: Disabled
A menu.lst is created during install of the GRUB
If you do not install GRUB there is no menu.lst , in this case you have to create it you're self
Normally you find it /boot/grub/menu.lst
 
Old 08-02-2009, 09:40 AM   #6
vonbiber
Member
 
Registered: Apr 2009
Distribution: slackware
Posts: 299

Rep: Reputation: 50
once you installed grub edit the /boot/grub/menu.lst
and create as many entries as you have system installed

an entry for booting a linux system on the second partition
looks like this

title the name you want to appear in your boot menu
root (hd0,1)
kernel /path/to/thethekernelyouwanttobootfrom ...other options...

(the kernel line is usually
kernel /boot/vmlinuz ... etc.
)

note that grub starts counting from 0
hd0,1 means 1st disk 2nd partition
 
Old 08-02-2009, 10:00 AM   #7
colorpurple21859
Senior Member
 
Registered: Jan 2008
Location: florida
Distribution: slackware64-current, puppy, ubuntu
Posts: 1,344

Rep: Reputation: 184Reputation: 184
this is another way, If your are going to keep one main distributon and play with several others install it first on the first partition and install grub to the mbr. edit you /boot/grub/menu.lst and add the following:

title <whatever you want to identify the next partiton>
rootnoverify (hd?,?)
chainloader +1

for each partition you have. the ? has to be replaced with the apropiate number.
for any other distributions, install grub or lilo to the root partion of the distro you are installing. as long as you keep your main distro and don't let other distro's load their bootloader to the mbr you should always at least be able to get into you main distro.
 
Old 08-02-2009, 10:49 AM   #8
polarbear20000
Member
 
Registered: Oct 2006
Location: Holt, FL
Distribution: Slackware 13
Posts: 98
Blog Entries: 1

Rep: Reputation: 16
Or, if you want an example, take a look at this link and see how he did it.
 
Old 08-02-2009, 12:40 PM   #9
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
If you install grub from a live cd to its own partition you have to create your own menu.lst. It is not that hard, open a text editor as root and create the menu and then save it to the partition that you installed grub. You have to make your 'boot/grub' directory.

Last edited by Larry Webb; 08-02-2009 at 12:43 PM.
 
Old 08-02-2009, 12:42 PM   #10
betula
Member
 
Registered: Aug 2008
Posts: 165

Original Poster
Rep: Reputation: 15
My word, how flexible Grub is! And how smart are those who really know how to use it....

Many many thanks for all your help. I really appreciate it.

betula
 
Old 08-03-2009, 02:11 PM   #11
betula
Member
 
Registered: Aug 2008
Posts: 165

Original Poster
Rep: Reputation: 15
Well, it hasn't quite gone as it should.

I partitioned my disk using my cd of Gparted. I installed Mint in partition #1 with Grub. That distro booted okay. I then installed PcLinuxOS in #2 and installed grub in that partitions root.

I then opened a terminal in Mint and added, to Menu.lst,

pclinuxos
rootnoverify (hd0,1)
chainloader +1

Now when I boot up, I first get the Mint opening screen, followed by a screen giving me the options of PCLinuxOS first, followed by Mint. The trouble is that I can't get to Mint. No matter which I choose, I just get PCLinuxOS.

The Gparted cd shows that Mint is still flagged as 'boot'. I imagine that I'll have to change something in Mint's partition so how do I get to that from PCLinuxOS?

What did I do wrongly, please?
 
Old 08-03-2009, 02:44 PM   #12
johnsfine
Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,083

Rep: Reputation: 1110Reputation: 1110Reputation: 1110Reputation: 1110Reputation: 1110Reputation: 1110Reputation: 1110Reputation: 1110Reputation: 1110
Usually it is best not to use chainloader for Linux systems.

To use chainloader you would need to install into the sector boot partition something connected to grub or lilo for that copy of Linux.

Usually it is easiest to use a kernel and probably initrd command to load each Linux.

I never learned enough about kernel parameters nor about the use of initrd to set those up myself. So every time I install a Linux distribution, I tell it to install grub with that distribution, even if I tell it not to install the MBR portion of grub, or I later have some other Linux install overwrite that grub mbr.

So there is a /boot/grub directory for every Linux install, but only the one currently connected to the MBR actually gets used.

Then I find the block of grub commands for each Linux version in its own /boot/grub/menu.lst and I copy each of those blocks into the one /boot/grub/menu.lst that actually gets used.
 
Old 08-03-2009, 02:56 PM   #13
johnsfine
Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,083

Rep: Reputation: 1110Reputation: 1110Reputation: 1110Reputation: 1110Reputation: 1110Reputation: 1110Reputation: 1110Reputation: 1110Reputation: 1110
I guess I didn't read carefully enough earlier. I still think it is easier to not use chainloader at all. But it sounds like you already got the chainloader right and got something else wrong.

Quote:
Originally Posted by betula View Post
added, to Menu.lst,

pclinuxos
rootnoverify (hd0,1)
chainloader +1
I think the first line of that needs to be
title pclinuxos
not
just
pclinuxos

You also might have put it in the wrong plasce in your menu.lst.

If you post the entire menu.lst we can do a better job of advising you what to fix.

Quote:
a screen giving me the options of PCLinuxOS first, followed by Mint. The trouble is that I can't get to Mint. No matter which I choose, I just get PCLinuxOS.
Meaning those grub commands for pclinuxos work but are executed even if you choose Mint.

Quote:
The Gparted cd shows that Mint is still flagged as 'boot'.
Doesn't matter.

Quote:
I imagine that I'll have to change something in Mint's partition
Yes. IIUC, your active menu.lst file is still in Mint's partition, which is sda1.

Quote:
so how do I get to that from PCLinuxOS?
There are many ways to mount sda1 writable from with pclinuxos (which I assume has sda2 mounted as /)

Since I don't know pclinuxos and I always use konqueror for such things in Mepis (rather than command line), I can't tell you how. But maybe you just needed to know that you need to mount sda1 and you already know how to mount a partition.
 
Old 08-03-2009, 04:30 PM   #14
betula
Member
 
Registered: Aug 2008
Posts: 165

Original Poster
Rep: Reputation: 15
johnsfine,

I'm really struggling here in all respects so I'm going to start again. It's a bare computer so there's nothing to lose.

I really do like your first post as it makes good sense to me. It would be a great help if you could expand the last paragraph as I don't understand it. Perhaps an example, if you'd be so kind.

'Then I find the block of grub commands for each Linux version in its own /boot/grub/menu.lst and I copy each of those blocks into the one /boot/grub/menu.lst that actually gets used.'

What do the block of grub commands look like?

Whatever, as my brain is reeling with tiredness and it's 10.30pm where I am, I shall take this up again tomorrow morning. Hope you don't mind!

Thanks for your reply.
 
Old 08-03-2009, 05:01 PM   #15
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
betula I may have missed something in your prior post but it sounds like on your pclinux install you did not install grub to the pclinux root partition. All you have to do is bring up the grub prompt in prompt from either live cd and use the commands
root (hd0,0)
setup (hd0)
quit

This will direct your boot loader to look at your first partition for the menu.lst

Here is another article that you may find easier to understand

http://www.justlinux.com/forum/showthread.php?t=144294

Last edited by Larry Webb; 08-03-2009 at 05:10 PM.
 
  


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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Chainload an OS Ashrack Linux - Software 9 01-23-2007 07:14 AM


All times are GMT -5. The time now is 05:14 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration