To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here

http://justlinux.com/   Tue, 09-Feb-2010 17:09:04 GMT
         internet.com

Go Back   JustLinux Forums > Community Help: Check the Help Files, then come here to ask! > Newbies Corner

Newbies Corner New to Linux? Have no fear, NO question is too simple to ask in this forum!

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 10-21-2007, 12:10 PM
saikee's Avatar
saikee saikee is offline
moderator
 
Join Date: Jun 2004
Location: Newcastle upon Tyne
Posts: 2,485
Multi booting in Linux explained

This is what I hope to be a simple tutorial of booting 3 Linux of Ubuntu, Slackware and Mepis. The principle applies to 300 Linux if you got them.

A Linux is typically installed in a Ext2, Ext3 or Reiserfs partitions. The first track of such partitions is always reserved as the boot sector so that each partition can have a rightful residence for its boot loader.

If the partition is the first one in the hard disk its first sector of 512 bytes, commonly known as the MBR, is always read by the Bios for the booting purpose. Therefore we can have as many boot loaders as we want but only one of them get read by the Bios as the MBR. To put it in another way if I install 3 Linux I can only nominate just one Linux to control the MBR and relies on this boot loader to boot the other two.

A Linux can be installed in any primary or logical partition in a hard disk and can still control the booting process by sending its first sector of 512 byes to occupy the MBR. This is usually done automatically when you install the first Linux because it needed to be booted.

Your problem starts only when you install the second Linux.

The easiest way to install the second and more Linux is to tell each installer to keep its boot loader inside its root partition. That forces each Linux places its boot loader in the boot sector of the partition it resides. This makes the Linux immediately chainloadable by another boot loader, be it a Grub, a Lilo or even a MS boot loader.

A Linux, with a boot loader inside its root partition, cannot boot itself. It must be booted by a boot loader occupying the MBR. A Linux with access to the MBR can boot other Linux by two methods.
  • Direct method by entering into the partition to load the kernel and initrd
  • Indirect method by booting up another boot loader and let it do the work, a technique known as chainloading

To explain the above I use a Grub configuration file menu.lst of the first installed Ubuntu and color the additions in color. I have removed all the lines which are irrelevant to condense the print out
Code:
title           Ubuntu 7.10 @ sda6 by direct booting
root            (hd0,5)
kernel          /boot/vmlinuz-2.6.22-14-generic root=UUID=80db91a1-b3f2-42b2-b3a2-9cb6e5f71b8b ro quiet splash
initrd          /boot/initrd.img-2.6.22-14-generic

title           Slackware 12 @ sda7 by direct booting
root            (hd0,6)
kernel          /boot/vmlinuz ro root=/dev/sda7

title           Slackware 12 @ sda7 by chainloading
root            (hd0,6)
chainloader     +1

title           MEPIS 6.0.4 @ sda8 by direct booting
root            (hd0,7)
kernel          /boot/vmlinuz root=/dev/sda8 nomce quiet vga=normal 

title           MEPIS 6.0.4 @ sda8 by chainloading
root            (hd0,7)
chainloader     +1
Any newbie wanting to multi-boot in Linux must be prepared to learn how to write the Direct booting instructions or the Indirect booting instructions but not both. The booting instruction for Grub is in /boot/grub/menu.lst but may be in /grub/menu.lst. grub.conf is used on Red Hat family distros. For Lilo it is always in /etc/lilo.conf.

You will see immediately that the Indirect method is simpler requiring you to know just the partition number, in Grub's notation, in which resides the Linux you wish to boot. You should also notice that Grub counts everything from 0 so the first disk is (hd0) and its 8th partition is (hd0,7), for example.

To boot a Linux by the Direct method requires you to know in advance the kernel name of the Linux, the kernel parameters to be passed on during boot time and the name of the ram disk file called "initrd.img". It so happens that I have picked the two easiest Linux that do not use initrd. Ubuntu, on the other hand, has a complicated kernel and initrd statement. Ubuntu is booting itself by the Direct method. This is always the case, , if its boot loader is occupying the MBR, because the Indirect method is just using one boot loader to boot another boot loader. The Indirect method does not work for Ubuntu because its Grub is already in the MBR, gets read by the Bios and will boot back to itself in a continuous loop.

Therefore if you boot 100 Linux you must have the one in the MBR booting itself directly and the rest of the 99 Linux booted indirectly. You could of course choose to boot every system directly but that is a lot harder when the number of system increases.

The the Indirect method does have the following advantages over the the Direct method
  • The original boot loader configuration, as created by the installer, is faithfully preserved.
  • The type of boot loader in each Linux is immaterial as the scheme works equally well for a Lilo or a Grub
  • It is a lot easier. The partition reference is the Linux.
  • The scheme requires the least amount of work.
  • It is very easy to switch boot loader in the MBR.
  • One can do relays with boot loaders, like one does 10 systems and its 10th Linux has a menu for the next 10 systems and so on.
  • Very complicated nested booting menu systems can be implemented.
To demonstrate I list the booting menu of Slackware which is a die-hard believer in Lilo. Its lilo.conf has been modified to boot Ubuntu and Mepis indirectly
Code:
# LILO configuration file in Slackware of sda7

boot = /dev/sda
message = /boot/boot_message.txt
prompt
timeout = 1200
# Override dangerous defaults that rewrite the partition table:
change-rules
  reset
vga = 773

other = /dev/sda6
  label = Ubuntu

image = /boot/vmlinuz
  root = /dev/sda7
  label = Slackware12
  read-only

other = /dev/sda8
  label = Mepis
Conclusion

When install the first Linux let its boot loader into the MBR.

From the second Linux onward tell the installer you want each boot loader to be place inside the root partition.

Amend the MBR's boot loader configuration file to boot other by chainloading

For Grub each additional Linux by inserting
Code:
title Linux in the (j+1)th partition of the (i+1)th disk
root  (i,j)
chainloader +1
To chainload a Linux in partition sda7 with Lilo insert lines
Code:
other=/dev/sda7
label=Linux_sda7
Lilo differs from Grub that each time its lilo.conf is altered then the command "lilo" must be issued to re-validate Lilo. Grub is easier as one can write all the booting choices in menu.lst even before the Linux are installed as Grub can be installed into a data-only partition without attached to a Linux.

--------------------------------------------------------

For more information see Just booting tips
__________________
Linux user started Jun 2004 - No. 361921
Using a Linux live CD to clone XP
To install Linux and keep Windows MBR untouched
Adding extra Linux & Doing it in a lazy way
A Grub menu booting 100+ systems & A "Howto" to install and boot 145 systems
Just cloning tips Just booting tips A collection of booting tips

Judge asked Linux "You are being charged murdering Windoze by stabbing its heart with a weapon, what was it?" Replied Linux "A Live CD"

Last edited by saikee; 12-15-2007 at 05:23 PM.
Reply With Quote
  #2  
Old 12-15-2007, 04:18 PM
dwr50's Avatar
dwr50 dwr50 is offline
New Linux User
 
Join Date: Dec 2007
Location: New Mexico
Posts: 13
Multiboot Order

If I'm Reading this right and I want to install ubuntu 7.04, kubuntu 7.10,LinuxMint4.0,gOS1.01,and Puppy Linux2.16.1, on the same drive, I should install Puppy first ?
__________________
Acer Aspire 5610z,Vista HP, No problems with Vista... so far, but I'm learning Linux, just in case.
Acer Aspire 5315-2153, $348 Walmart Special,Mandriva Linux 2008.1 Spring Edition.
Reply With Quote
  #3  
Old 12-15-2007, 04:42 PM
stumbles stumbles is offline
Registered User
 
Join Date: Jan 2003
Posts: 957
I only wish the man pages were written so clearly.... nice work saikee.
__________________
You can tuna piano, but you can't tune a fish.

http://www.lunar-linux.org/
It's worth the spin.

http://www.pclinuxos.com/page.php?7
Puts the rest to shame.
Reply With Quote
  #4  
Old 12-15-2007, 08:15 PM
saikee's Avatar
saikee saikee is offline
moderator
 
Join Date: Jun 2004
Location: Newcastle upon Tyne
Posts: 2,485
Things that worth to write always ending up too long and too much when I finish each one. I changed the tactic for the newbies forum by posting small bits and pieces which are short and can be easily read.

Just a small effort to help the newbies into Linux. Most the information aren't new but may be useful for the newcomers. Experienced Linux can always contribute by writing their own or point out improvements I could make to the thread.

Whatever I know I learn it in Justlinux.
__________________
Linux user started Jun 2004 - No. 361921
Using a Linux live CD to clone XP
To install Linux and keep Windows MBR untouched
Adding extra Linux & Doing it in a lazy way
A Grub menu booting 100+ systems & A "Howto" to install and boot 145 systems
Just cloning tips Just booting tips A collection of booting tips

Judge asked Linux "You are being charged murdering Windoze by stabbing its heart with a weapon, what was it?" Replied Linux "A Live CD"
Reply With Quote
  #5  
Old 12-16-2007, 01:37 PM
dwr50's Avatar
dwr50 dwr50 is offline
New Linux User
 
Join Date: Dec 2007
Location: New Mexico
Posts: 13
Grub Question

I just partitioned my drive sda1 - sda12, and installed PCLinux2007. When I looked at my Grub menu.lst file I noticed it listed my drive partition as (hd0,4) . I was expecting (sda0,4) , why is this ?

Upon closer examination I see root=/dev/sda5
resume=/dev/sda6

so some things are being called sda... even more confusing.
__________________
Acer Aspire 5610z,Vista HP, No problems with Vista... so far, but I'm learning Linux, just in case.
Acer Aspire 5315-2153, $348 Walmart Special,Mandriva Linux 2008.1 Spring Edition.

Last edited by dwr50; 12-16-2007 at 01:48 PM. Reason: closer look
Reply With Quote
  #6  
Old 12-16-2007, 03:23 PM
bwkaz bwkaz is offline
Moderator
 
Join Date: Apr 2001
Location: SF Bay Area, CA
Posts: 14,956
Quote:
Originally Posted by dwr50
When I looked at my Grub menu.lst file I noticed it listed my drive partition as (hd0,4) . I was expecting (sda0,4) , why is this ?
Couple reasons. First, your expectation is wrong: (sda0,4) would be the first sda disk (except that sda is already the first SCSI disk; you probably meant (sd0,4) instead).

Second, GRUB doesn't use the OS's disk devices except when it installs itself -- when it's running (which is the only time the menu is used), it has its own notation. And that notation treats all disks equally: they're all (hdX), and their partitions are all (hdX,Y).

Quote:
Upon closer examination I see root=/dev/sda5 resume=/dev/sda6
That's in the kernel command line. You use /dev names there because those parameters are interpreted either by the kernel or by an initramfs -- and both of those use the normal Linux device names. GRUB doesn't care what partition you tell your kernel to boot from, or resume from.
__________________
"Quando omni flunkus moritati" -- Possum Lodge motto -- Loose translation: "When all else fails, play dead."

Registered Linux User #219692
Please take a look at the Posting Guidelines, to help us help you!

Last edited by bwkaz; 12-16-2007 at 03:36 PM.
Reply With Quote
  #7  
Old 12-16-2007, 05:03 PM
dwr50's Avatar
dwr50 dwr50 is offline
New Linux User
 
Join Date: Dec 2007
Location: New Mexico
Posts: 13
2nd Grub Question

###############
# Grub menu.lst
###############
timeout 10
color black/cyan yellow/cyan
gfxmenu (hd0,4)/usr/share/gfxboot/themes/pclinuxos/boot/message
default 0

title PCLinux
kernel (hd0,4)/boot/vmlinuz BOOT_IMAGE=linux root=/dev/sda5 acpi=on resume=/dev/sda6 splash=silent vga=788
initrd (hd0,4)/boot/initrd.img

title linux-nonfb
kernel (hd0,4)/boot/vmlinuz BOOT_IMAGE=linux-nonfb root=/dev/sda5 acpi=on resume=/dev/sda6
initrd (hd0,4)/boot/initrd.img

title failsafe
kernel (hd0,4)/boot/vmlinuz BOOT_IMAGE=failsafe root=/dev/sda5 failsafe acpi=on resume=/dev/sda6
initrd (hd0,4)/boot/initrd.img

What does title linux-nonfb mean/do ?

I just figured out how to cut/paste and use Kjots to transfer screen info by pendrive to my Vista pc so I can post the info. The day hasn't been wasted.
__________________
Acer Aspire 5610z,Vista HP, No problems with Vista... so far, but I'm learning Linux, just in case.
Acer Aspire 5315-2153, $348 Walmart Special,Mandriva Linux 2008.1 Spring Edition.
Reply With Quote
  #8  
Old 12-16-2007, 09:28 PM
saikee's Avatar
saikee saikee is offline
moderator
 
Join Date: Jun 2004
Location: Newcastle upon Tyne
Posts: 2,485
Each boot loader has to inform the user what system he/she is booting to. Grub does this by the title command.

Various video may be difficult to match and the "linux-nonfb" is another choice to tune to video if the default doesn't come out satisfactorily
__________________
Linux user started Jun 2004 - No. 361921
Using a Linux live CD to clone XP
To install Linux and keep Windows MBR untouched
Adding extra Linux & Doing it in a lazy way
A Grub menu booting 100+ systems & A "Howto" to install and boot 145 systems
Just cloning tips Just booting tips A collection of booting tips

Judge asked Linux "You are being charged murdering Windoze by stabbing its heart with a weapon, what was it?" Replied Linux "A Live CD"

Last edited by saikee; 12-16-2007 at 09:32 PM.
Reply With Quote
  #9  
Old 12-17-2007, 11:24 AM
dwr50's Avatar
dwr50 dwr50 is offline
New Linux User
 
Join Date: Dec 2007
Location: New Mexico
Posts: 13
Video ?

Quote:
Originally Posted by saikee
Each boot loader has to inform the user what system he/she is booting to. Grub does this by the title command.

Various video may be difficult to match and the "linux-nonfb" is another choice to tune to video if the default doesn't come out satisfactorily
Do you mean the computer's monitor setup or are we talking divix, mpeg, ect.
__________________
Acer Aspire 5610z,Vista HP, No problems with Vista... so far, but I'm learning Linux, just in case.
Acer Aspire 5315-2153, $348 Walmart Special,Mandriva Linux 2008.1 Spring Edition.
Reply With Quote
  #10  
Old 12-17-2007, 11:57 AM
saikee's Avatar
saikee saikee is offline
moderator
 
Join Date: Jun 2004
Location: Newcastle upon Tyne
Posts: 2,485
linux = the default kernel, with framebuffer support

linux-nonfb = the default kernel, without framebuffer support

failsafe = single user maintenance mode, but with the root filesystem
mounted read-only

There is a generic, "works on most every display" graphics interface called
the "frame buffer" interface. The "linux" boot will use this interface for
your graphics.

However, if your video card doesn't support framebuffer, OCLinuxOS, which is based on Mandrake, offers a way to boot using the video-card specific graphics support. The "linux nofb" option uses this video-card specific support.

The two options are provided so as to permit you to get a GUI up, no matter
what the graphics card.
__________________
Linux user started Jun 2004 - No. 361921
Using a Linux live CD to clone XP
To install Linux and keep Windows MBR untouched
Adding extra Linux & Doing it in a lazy way
A Grub menu booting 100+ systems & A "Howto" to install and boot 145 systems
Just cloning tips Just booting tips A collection of booting tips

Judge asked Linux "You are being charged murdering Windoze by stabbing its heart with a weapon, what was it?" Replied Linux "A Live CD"
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Forum Jump


All times are GMT -4. The time now is 01:09 PM.

Help File Library
Software
Installation
Tools
Soundcards
Hardware
More



internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers




internet.commerce
Be a Commerce Partner












Linux is a trademark of Linus Torvalds.

Acceptable Use Policy


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

Powered by vBulletin® Version 3.7.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.