LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-01-2013, 03:41 PM   #16
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Centos6.3/Debian
Posts: 2,127
Blog Entries: 1

Original Poster
Rep: Reputation: 316Reputation: 316Reputation: 316Reputation: 316

Hi

Quote:
The problem with chain loading is that you can only write to boot sectors on primary and (technically extended) partitions. However if you are installing multiple distro's There is a good chance you have boot partitions on sda5+. These logical partitions can be booted from the MBR or sda1-4, but cannot be directly chainloaded.
That looks like it cleared up my chainloading worry.

Also the idea I Think is when a distro upgrades it,s kernel wont chainloading auto pick it up?

Last edited by spiky0011; 04-01-2013 at 04:03 PM.
 
Old 04-02-2013, 08:29 AM   #17
colorpurple21859
Senior Member
 
Registered: Jan 2008
Location: florida
Distribution: slackware64-current, puppy, ubuntu
Posts: 1,905

Rep: Reputation: 262Reputation: 262Reputation: 262
With chainloading you don't have to copy the new kernel to the boot partition every time a kernel update comes along with the other installed distros.

Last edited by colorpurple21859; 04-02-2013 at 08:42 AM.
 
Old 04-02-2013, 08:33 AM   #18
colorpurple21859
Senior Member
 
Registered: Jan 2008
Location: florida
Distribution: slackware64-current, puppy, ubuntu
Posts: 1,905

Rep: Reputation: 262Reputation: 262Reputation: 262
A chainloader entry will look something like this:
Code:
menuentry "Slackware Chainload" {
insmod part_msdos
insmod ext2
set root=(hd0,1)
chainloader +1
}

Last edited by colorpurple21859; 04-02-2013 at 08:41 AM.
 
Old 04-02-2013, 11:30 AM   #19
mreff555
Member
 
Registered: Sep 2011
Location: Philly
Distribution: Gentoo
Posts: 470

Rep: Reputation: Disabled
Quote:
Originally Posted by colorpurple21859 View Post
With chainloading you don't have to copy the new kernel to the boot partition every time a kernel update comes along with the other installed distros.
true, but then again you also wouldn't have to if you didn't put your boot filesystem on a separate filesystem.

regardless I don't see that being a huge obstacle.
 
Old 04-02-2013, 01:48 PM   #20
colorpurple21859
Senior Member
 
Registered: Jan 2008
Location: florida
Distribution: slackware64-current, puppy, ubuntu
Posts: 1,905

Rep: Reputation: 262Reputation: 262Reputation: 262
If you install a new distro and keep your boot filesystem on the same partition as the distro, you would still have to modify the /boot/grub//grub.cfg on the boot partition to boot the new distro. Most distro installers don't let one have the option of where to install the grub files to, just the option of which partition/mbr. This will cause problems later. Once you set up the boot partition with the grub files, and grub installed to the Mbr, regardless of what distro is install, as long as one installes tthe dostros grub to it's own partition you will be able to chainload without having to modifiy the boot partitions grub.cfg.

Last edited by colorpurple21859; 04-02-2013 at 01:49 PM.
 
Old 04-02-2013, 02:15 PM   #21
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Centos6.3/Debian
Posts: 2,127
Blog Entries: 1

Original Poster
Rep: Reputation: 316Reputation: 316Reputation: 316Reputation: 316
Hi

I have found that both Centos and Pcbsd give me an option about grub, Ubuntu on the other hand dosn't seem to give an option, So a kernel upgrade might give a problem.
 
Old 04-02-2013, 03:42 PM   #22
colorpurple21859
Senior Member
 
Registered: Jan 2008
Location: florida
Distribution: slackware64-current, puppy, ubuntu
Posts: 1,905

Rep: Reputation: 262Reputation: 262Reputation: 262
There are two parts to grub the 512 bytes installed to the Mbr or at the begining of a partition, and the grub files that are stored in /boot/grub located on some file system. I just tried a Centos iso on Vmware and it used grub legacy and only had an option as to where the 512 bytes is install too. Not an option as to where the /boot/grub files are installed, which for most installers is on the root partition of the distro being installed.
 
Old 04-02-2013, 04:13 PM   #23
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Centos6.3/Debian
Posts: 2,127
Blog Entries: 1

Original Poster
Rep: Reputation: 316Reputation: 316Reputation: 316Reputation: 316
Hi

You do get the option not install grub tho, Ubuntu there is know choice.
 
Old 04-02-2013, 04:29 PM   #24
colorpurple21859
Senior Member
 
Registered: Jan 2008
Location: florida
Distribution: slackware64-current, puppy, ubuntu
Posts: 1,905

Rep: Reputation: 262Reputation: 262Reputation: 262
okay I see what your talking about now. I just prefer chainloading, because I tend to forget to change the grub.cfg file when I do new installs and/or kernel upgrades
 
Old 04-02-2013, 04:35 PM   #25
Lennie
Member
 
Registered: Aug 2012
Location: Sweden
Distribution: LFS, built with pacman
Posts: 329

Rep: Reputation: 62
A separate partition for grub is defenately the best for multiboot system. Just copy the grub-folder to your grub partition, and after that install grub in mbr.
Quote:
Originally Posted by spiky0011 View Post
I have it up and running, That is the way I installed grub as well the only thing that wont work is chainloading Ubuntu and centos, although I copied from Ubuntu grub.cfg
Do you mean that your changes doesn't take effect? Are you sure grub is really using grub.cfg from your grub partition? When grub is installed in mbr it registers on what sector the next file it should load is located. Even if you have formatted that partition, as long as it is not overwritten grub can continue using it.

I never put the kernels on the grub partition. I prefer to keep all distros separate, with everything on each root partition.

I think Ubuntu has hidden the choice of if/where to install grub under "advanced". You need to use the "something else" install method to get that choice. Ubuntu also creates symlink to latest kernel under /, so if you don't have separate boot partiton for it you can just add that symlink to grub.cfg.
 
Old 04-02-2013, 04:45 PM   #26
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Centos6.3/Debian
Posts: 2,127
Blog Entries: 1

Original Poster
Rep: Reputation: 316Reputation: 316Reputation: 316Reputation: 316
Hi Lennie

I have never seen the option in Ubuntu advance section Saying that I never looked for it before, I will look some day.

The chainload idea makes sense to me but as mreff555 mention that chainloading dosn't work in logical partition which Centos and Ubuntu are, I have chainloaded on another machine but all were in primary Partition.

On another note/Q can windows be installed on /dev/sda2 primary partition? I have never tried it/thought about it till just now.

Last edited by spiky0011; 04-02-2013 at 05:07 PM. Reason: changed mistake pointed by Lennie
 
Old 04-02-2013, 05:03 PM   #27
Lennie
Member
 
Registered: Aug 2012
Location: Sweden
Distribution: LFS, built with pacman
Posts: 329

Rep: Reputation: 62
Chainloading does work on logical partitions. You have to use force to install grub to it. But if you delete one logical partition, then all logical partitions with higher number get changed partition number, and then you need to reinstall grub to those partitions before you can boot from their grub again.

But actually, you should not use 'chainloading +1' with grub2. You should put '/boot/grub/core.img' to the kernel line. I don't remember grub2-syntax for it, and don't have time to find out right now. The syntax for grub legacy is like this, maybe you can adjust it to grub2.

Code:
title Ubuntu 
root (hd0,2)
kernel /boot/grub/core.img
savedefault
boot
With this there is no need to install grub to the partition. You don't chainload to another grub, but tells the first grub which file to read next.

Edit: I'm tired right now, but I think you need to run a command to create the core.img if you don't install grub to the partition. I remember Archlinux wiki tells about this. I can check it out tomorrow if you don't find it.

Last edited by Lennie; 04-02-2013 at 05:05 PM.
 
Old 04-03-2013, 03:04 AM   #28
Lennie
Member
 
Registered: Aug 2012
Location: Sweden
Distribution: LFS, built with pacman
Posts: 329

Rep: Reputation: 62
From Arch's wiki
Quote:
Generate core.img alone

To populate the /boot/grub directory and generate a /boot/grub/i386-pc/core.img file without embedding any grub-bios bootsector code in the MBR, post-MBR region, or the partition bootsector, add --grub-setup=/bin/true to grub-install:

Code:
# modprobe dm-mod
# grub-install --target=i386-pc --grub-setup=/bin/true --recheck --debug /dev/sda
# mkdir -p /boot/grub/locale
# cp /usr/share/locale/en@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo
You can then chainload GRUB2's core.img from GRUB Legacy or syslinux as a Linux kernel or a multiboot kernel.
From Ubuntu-forums
Quote:
In order to load Grub 2 from another Grub 2 you have to use the command multiboot instead of linux or kernel or...

Code:
menuentry "sda5" {
        insmod ext2
        set root=(hd0,5)
        multiboot /boot/grub/core.img
}
I stopped using chainloading 1,5 years ago, whan I learned that
1. I could boot all distros from one grub, and
2. most (I think) distros creates symlinks always pointing to newest installed kernel. Usually those symlinks are in /boot. I really don't understand why Ubuntu put them in /, that makes them useless for people having separate boot partition, because nothing is mounted at the point when grub hands over to the kernel, and grub will only find a broken link.

Another good reason for direct booting instead of chainloading is that you can remove grub completely from the installed distros. Especially Ubuntu can otherwise cause problems. It happend twice with Xubuntu 12.04 last summer that it overwrote mbr when it got an update to grub - without even asking if I wanted to install grub in mbr. Second time it happened I realized I could just remove grub from Xubuntu, and since then no more problems with that.
 
Old 04-03-2013, 05:17 AM   #29
vigi
Member
 
Registered: May 2009
Location: australia
Distribution: slackware
Posts: 184

Rep: Reputation: 28
My multiboot system is setup as follows; my first partition is a primary boot partition of 100MB for grub legacy as the boot manager in mbr. Next partition win xp 50gb, then all the linux oses are in a divided up extended partion. Slackware 15gb, ubuntu 10gb etc. Each linux system is loaded with its standard boot loader and chainloaded from the grub manager. My data is on a common 60GB partion, so the profile it can be accessed from anylinux system i choose to use. Only one thunderbird profile. This way i can play with new distros and delete them, without much editing. Grub4dos also makes a good boot manager on its own partition.
 
Old 04-03-2013, 02:19 PM   #30
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Centos6.3/Debian
Posts: 2,127
Blog Entries: 1

Original Poster
Rep: Reputation: 316Reputation: 316Reputation: 316Reputation: 316
Hi

This started out as looking for help on standalone grub, as I was rebuilding the complete system. I have a few things to try out now.
On another note I think It's not possible but any way, can I boot the cd/dvd drive??
 
  


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
[SOLVED] Creating Boot CD to boot into a second partition without modifying MBR bgoodr Debian 8 09-23-2012 03:19 PM
[SOLVED] creating separate boot partition, issues Knightron Linux - Newbie 6 08-20-2011 07:22 AM
[SOLVED] Creating and booting from a separate /boot partition eldiener Linux - General 5 11-12-2006 07:13 PM
creating new partition before boot partition?? rose_bud4201 Linux - General 17 02-07-2003 01:25 PM
Creating boot partition during Slack install bleach Linux - Software 5 11-30-2001 02:05 AM


All times are GMT -5. The time now is 04:22 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration