LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 03-30-2013, 01:18 PM   #1
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Centos6.3/Debian
Posts: 2,126
Blog Entries: 1

Rep: Reputation: 316Reputation: 316Reputation: 316Reputation: 316
Creating a boot partition


Hi

I have a laptop which has 5 distros installed I,m just about to rebuild it.
If I was to create a seperate boot partition how do i go about this
so that if a distro is removed later on I can still boot the others,
WINDOWS BSD CENTOS LFS UBUNTU in that order, The windows install is on 1st partition not touching it,
If I was to run grub-install /dev/sda2(boot) from LFS and I was to remove LFS or Rebuild will I still be able to boot the other OS.
As I see it there are some kernels in centos /boot. As there are in Ubuntu /boot

When I have built LFS with a seperate /dev/boot the kernels all went in there.

How would I do this
 
Old 03-30-2013, 01:58 PM   #2
TroN-0074
Senior Member
 
Registered: Dec 2011
Location: Michigan USA
Distribution: OpenSUSE 13.2 64bit-Gnome on ASUS U52F
Posts: 1,444

Rep: Reputation: 340Reputation: 340Reputation: 340Reputation: 340
You can install the OSs you want, but the one you want to control the boot leave for last. You will be able to remove the others and still boot just fine. If you remove the one that control the boot then you wont be able to boot any of the others.
If you decide to remove any of the others and install something else make sure you select no to install a boot loader, just reboot into the one controlling the boot and upgrade GRUB or whatever boot loader you are using.


Good luck to you
 
1 members found this post helpful.
Old 03-30-2013, 02:05 PM   #3
DavidMcCann
Senior Member
 
Registered: Jul 2006
Location: London
Distribution: CentOS, Salix
Posts: 4,158

Rep: Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223
On this computer I have a permanent installation of CentOS and a guest partition for the distro I'm currently testing (number 96 coming up!). I have the CentOS grub on the MBR and the current guest has grub/lilo on its own partition, chain-loaded from the CentOS grub. If grub2 makes a fuss about being on a partition, I alter the CentOS grub to boot the guest directly.

So, I'd pick whichever Linux you intend to keep (CentOS) and put its grub on the MBR. Do you really need a /boot partition?
 
1 members found this post helpful.
Old 03-30-2013, 02:18 PM   #4
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Centos6.3/Debian
Posts: 2,126
Blog Entries: 1

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

I have got another machine chainloading. I wanted to have grub not depend on any distro
 
Old 03-31-2013, 12:12 PM   #5
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Centos6.3/Debian
Posts: 2,126
Blog Entries: 1

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

Thks gose to Larry Webb for Inspiration and direction

Well I have managed to build a stand alone grub2, I 1st created a 100mb partition /dev/sda2
Then I ran grub-install, to sda and sda2 I then made my own grub.cfg file and put that in /dev/sda2/boot/grub. As this setup stands it dosn't rely on any distro to boot OS,s.
 
Old 03-31-2013, 02:46 PM   #6
mreff555
Member
 
Registered: Sep 2011
Location: Philly
Distribution: Gentoo
Posts: 470

Rep: Reputation: Disabled
Quote:
Originally Posted by spiky0011 View Post
Hi

I have got another machine chainloading. I wanted to have grub not depend on any distro
That can't be done. Well, at least not in a very straightforward manner. The bootloader doesn't really do a lot other than loading a partition. In order for a bootloader to function there has to be an accessible partition containing grub. Technically you could probably keep a very small skeleton partition (maybe 200 mb) which houses grub and the kernels. That is essentially what windows does these days. This will require a bit of tweaking and will probably be easier to set up with grub 1.99, since the majority of the install is in the boot directory.
 
Old 03-31-2013, 03:11 PM   #7
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Centos6.3/Debian
Posts: 2,126
Blog Entries: 1

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

Yes it can be done no kernels are moved from OS.s. The grub I used was from my lfs which I then removed lfs from the pc and was still able to boot all the other distros. I will make a blog with how I did it.
 
Old 03-31-2013, 09:45 PM   #8
mreff555
Member
 
Registered: Sep 2011
Location: Philly
Distribution: Gentoo
Posts: 470

Rep: Reputation: Disabled
Did you remove the boot partition when your removed LFS? If not, then you effectively did what I mentioned above.

The grub software MUST be installed for grub to work.
 
Old 04-01-2013, 03:05 AM   #9
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Centos6.3/Debian
Posts: 2,126
Blog Entries: 1

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

No I didn't remove the grub partition, when removing the OS, There arn't any kernels in the boot partition either. I wanted a standalone grub that was independent.
The idea was If Example I had Ubuntu grub controling boot and removed Ubuntu I could still boot the other distros, It just seemed like a sensible way to multi boot
 
Old 04-01-2013, 08:49 AM   #10
mreff555
Member
 
Registered: Sep 2011
Location: Philly
Distribution: Gentoo
Posts: 470

Rep: Reputation: Disabled
Right. The kernel doesn't have to be on the same partition as grub, but grub itself has to be installed. I think I see what your are getting at now. I have had similar setups. My question is why don't you put the kernels on that partition. Keeping the kernels on a partition which isn't mounted at runtime is a good practice.

I used to have a system with crunchbang as my default os, and space for two more to play around with, this was my partition table

sda1 -> 400mb Boot partition for all distro's, Contained all of the kernels which is why I made it so large.
sda2 -> Crunch Bang root
sda3 -> 6GB swap
sda4 -> extended
sda5 -> distro 1 root
sda6 -> distro 2 root

Of course if you are in the habit of creating seperate partitions for each part of the file system then things will get more complicated. On a desktop boot, root, and swap is enough for me.

The only downside to this is that you have to be careful not to overwrite the boot partition when installing a new distro. What I usually do is install the new distro with everything in the root partition. Then I manually copy the kernels and systems maps over to the boot partition, adjust fstab, and update grub.conf
 
Old 04-01-2013, 09:02 AM   #11
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Centos6.3/Debian
Posts: 2,126
Blog Entries: 1

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

I didn't think about that the only other thing about that is if you remove a distro it leaves the kernals behind. So I hope this way remove "Example" centos all is gone in 1 go then replace with Fedora pick up the kernel just add to grub.cfg. This is my 1st go at this so maybe little things need ironong out.
 
Old 04-01-2013, 11:19 AM   #12
mreff555
Member
 
Registered: Sep 2011
Location: Philly
Distribution: Gentoo
Posts: 470

Rep: Reputation: Disabled
Removing an extra kernel usually isn't too much of a hassle. In my case I recompile nearly all my kernels, so they are pretty similar anyway. I could probably use them interchangeably and not notice a difference.
 
Old 04-01-2013, 01:45 PM   #13
colorpurple21859
Senior Member
 
Registered: Jan 2008
Location: florida
Distribution: slackware64-current, puppy, ubuntu
Posts: 1,900

Rep: Reputation: 261Reputation: 261Reputation: 261
I think this is what you are looking for.

Code:
grub-install --boot-directory=<your /boot on the boot partition> /dev/?
This should install the grub files to the /boot on the boot partition, Then make a custom grub.cfg file to suit your purposes. Chainloading will probably work best. when you delete a distro you won't loose the grub boot files.

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

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

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
 
Old 04-01-2013, 03:32 PM   #15
mreff555
Member
 
Registered: Sep 2011
Location: Philly
Distribution: Gentoo
Posts: 470

Rep: Reputation: Disabled
Quote:
Originally Posted by colorpurple21859 View Post
I think this is what you are looking for.

Code:
grub-install --boot-directory=<your /boot on the boot partition> /dev/?
This should install the grub files to the /boot on the boot partition, Then make a custom grub.cfg file to suit your purposes. Chainloading will probably work best. when you delete a distro you won't loose the grub boot files.
That should work but I fail to see why you need to chain load. To be honest I never really understood why you would chain load unless you:

1. had an inferior (windows) operating system which was only capable of booting with it's own boot loader.
2. have multiple physical drives containing root file systems.
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.

My philosophy is this. There is no reason to have more than one boot or swap partition on any system running a bunch of linux distros.
As I said above the only exception I can think of would be if you have root partitions located on different physical disks.
 
  


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 06:44 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