LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to boot many versions of linux on one HD? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-boot-many-versions-of-linux-on-one-hd-559093/)

zephyrcat 06-04-2007 12:58 PM

How to boot many versions of linux on one HD?
 
Hi!

I have an old dell system (p4 3-4ish years old) that I would like to use to install various linux distros. I understand, however, that I need a boot manager to choose which partition I want to boot each time I start up. When I tried to find boot managers though I was confused, because some said they could support a certain number of OSs and others did not specify. Do I need a boot manager for what I am doing and if so what boot manager should I use.

Note: I would like to be able to have 15-20 partitions.

Thanks!

slackhack 06-04-2007 01:04 PM

you should use grub. it will come with most distros and you will usually be able to install it during the OS install.

pljvaldez 06-04-2007 01:10 PM

What I typically do is to make a separate /boot partition (make sure it's a primary partition) for the first linux I install (that way if I nuke the first distro, I can still boot all the others). Install the first bootloader (which comes with each linux distro) to the MBR (master boot record). Anyway, what I do is then install each of the other bootloaders (grub or lilo, I prefer grub) into the / partition for that distro NOT in the MBR. Then I use the first grub to boot the second distro's grub/lilo.

So here's summary:
1) Install first linux distro with grub into the MBR and a separate /boot partition.
2) Install second linux distro with grub/lilo in the / partition for that distro.
3) Boot first linux and edit /boot/grub/menu.lst to chainload second linux's grub/lilo.
4) repeat for each distro

Also, for partitioning, I like to use GParted. It has a nice live CD you can split your drive up ahead of time. It's also included on many other live CD's.

Here's a link to booting tips for grub. There's a section on chainloading.

jay73 06-04-2007 01:27 PM

I'm afraid you won't be able to use more than 15 partitions before long. Already Linux can't recognize more than 14 usable partitions on a SATA drive and the most recent distributions are now imposing the same limit on PATA drives.

Installing multiple distros on a single disk should be easy enough. I always use GRUB and do it like this: install one distro, let it install GRUB. Then I copy the menu.lst file from /boot/GRUB, after which I install a second distro and again I let it install GRUB; this obviously overwrites the first one. If the newer GRUB didn't pick up the first distro, no problem, I can add it manually because I did copy out the data from my original menu.lst.

zephyrcat 06-04-2007 01:29 PM

Thanks so much for the responses.

So this is what I would do for the first distro (Ubuntu 7.04) I am installing?
1. Make a primary partition with /boot set (don't think "set" is the right word, but I know how to do this).
2. Later in the installer I will have a choice to include Grub (is that right?) and I install it to MBR

Second distro:
1. Install it in / partition and modify that file (will that be easy or is there a guide to doing that?)

Is this right?

Thank you very much!

jay73 06-04-2007 01:34 PM

Oooh, it seems like you're in for a carnage. Every distro has its own /boot, /, /home etc. partitions - if you install a second distro over the / partition of the first one, you simply kill it.

If you're new to this, you may want to download and burn the Gparted LiveCd first - it allows laying out partitions before you start installing any distros - it tends to make things a lot simpler.

zephyrcat 06-04-2007 01:41 PM

Got it. I will download that and make the partitions there. What type should I make them and how many can I make?

Thanks!

saikee 06-04-2007 01:56 PM

There is a howto for booting 145 systems in my signature.

I recommend one Linux per partition. In my case I wrote the menu.lst before installing any of the system. I hosted Grub in a data-only partition.

Yes the 2.6.20 kernel and later have abandoned the Pata disk convention and all hard disk/pen drives etc will not be able to have more than 15 partitions.

The major and minor numbers of a disk reference has 256 devices names. SCSI/Sata/USB disks can be daisy-chained to 16 disks so each have 16 devices name. Taking the whole disk itself like sda away and you are left with 15 partitions. As one of the primaries must be converted to an extended partition there could be a amximum of 14 systems in a future hard disk. This effectively means we could only have 3 primies, 1 extended partition (which is used to define the boundaries of the first and the last logical partitions) and 11 logical partitions.

I believe if one has to it is possible to install 44 systems in a Sata disk. So the race is on to see who gets there first.

The trick is you create 11 logical partition in the sda1, hide it, then the next 11 partition in sda2, hide it again and repeat the same procedure for sda3 and sda4. When you need to run any of them you unhide the relevant extended partition. To Linux when an extended partition is hidden it will be treated as foreign. This technique requires Grub to be host elsewhere.

pljvaldez 06-04-2007 01:58 PM

Quote:

Originally Posted by zephyrcat
Second distro:
1. Install it in / partition and modify that file (will that be easy or is there a guide to doing that?

Here's an example
Code:

/dev/hda1 -- /boot (Ubuntu 7.04, install Grub to MBR)
/dev/hda2 -- / (Ubuntu 7.04)
/dev/hda3 -- / (Debian 4.0, install Grub to this partition, NOT the MBR)
/dev/hda4 -- logical partition
/dev/hda5 -- / (PC LinuxOS, install Grub to this partition, NOT the MBR)
etc

After each install, boot Ubuntu and then do sudo cp /boot/grub/menu.lst /boot/grub/menu.lst.0 to make a backup (increment the 0 each time so you always have a working backup). Then do sudo gedit /boot/grub/menu.lst to edit the file. At the bottom add something like
Code:

title Debian Etch on hda3
rootnoverify (hd0,2)
chainloader +1

Then save and exit.

Then when you reboot, you'll get the Ubuntu grub menu with Debian Etch on it. Then when you select Debian here, it will boot to the Grub you installed with Debian and you select your kernel from that list and let it boot. By doing this, each distro's Grub will only have to handle the kernel's for that distro and won't even be aware other distro's are installed. That makes it easy to remove a distro if you don't like it. You just reinstall over the partition and then modify the "title" line of the Ubuntu grub menu.lst.

jay73 06-04-2007 02:18 PM

Three primary partitions; the first one for swap, which is twice the size of your RAM & needs to beformatted as Linux-swap. All the other partitions (primary and logical) will contain distributions. The fourth one should be an extended partition - you can then create logical partitions inside.

Partitions will be numbered; do not go higher than 15 - beyond that, they may become invisible to Linux for reasons I expained before.

As for the size of those partitions, those are up to you. If you want to maximize the number of distributions, you can reserve one partition per distribution and use a single partition to store your personal data - which can be accessed from any of distribution - pretty convenient.
So : fifteen minus one swap minus one data partition minus one extended partition (this is only a container for the logical partitions but it counts too) = a maximum of 12. Whether you really need that many is up to you - you can simply make a handful of partitions, then create a data partition and leave free space after that; then you can always add more partitions in the unallocated space whenever the need arises (a good idea - having plenty of empty partitions just sitting there isn't everything either).
Each partition (other than swap and data) should be anything from 7 to 12GB, depending on how much you want to install; 7 is for a basic system (already quite rich), 12 for a very complete one (not to say "bloated"). You can make a variety of sizes if you want to: some 10GB, some smaller, some larger. The data partition can be as large as you want it to be. Or you can take it step by step: create partitions for only one system, install a distro, then use Gparted to make more when you want to install another distro.
Each partition needs to be formatted as well. Swap as linux-swap, the rest as either ext3 or xfs. I prefer xfs (is somewhat faster) but it is not supported by all distros (Fedora and CentOS come to mind); ext3 is supported by all.

Of course, there are alternative layouts to installing everything within a single partition (in which case, during install, you select only one partition and select "/" as its mount point); you could also make separate partitions and mount them under "/home" (not really needed if you already have a shared data partition - just a waste of partitions) as well as other ones ("var", "tmp" etc) - but if you want to use as few partitions as possible, that too would be a waste.

Leave the data partition alone during install; the best thing is to add manually when everything is set up.

zephyrcat 06-04-2007 02:37 PM

Tryping Gparted now...
 
Ok... I burned the Gparted Cd and I am headed over to put it in right now. I post again when I have an idea what I am going to do.

Thanks for all the help, I will probley need more of it. :-)

zephyrcat 06-04-2007 02:41 PM

I chose the first option (something auto-configuration) so I hope I chose the right thing.

jay73 06-04-2007 02:44 PM

One last remark; if you choose xfs for your /partition, you may be limited to Lilo as a bootloader - many distributions refuse to install GRUB when the your /boot partition is on xfs. Not that it matters if you have no preference for either Grub or Lilo.

zephyrcat 06-04-2007 02:48 PM

Not have a lot of luck...

It could not start X so it told me to use Forcevideo. I tried that with vesa and 1024x768 it returned two cryptic errors. I have intel integrated graphics, if that helps. I am going to try a different mode on startup.

(Also, if I mess something up it does not matter, because there is nothing on this drive.)

EDIT: The less cryptic of the two is:

Fatal server error:
no screens found

Above that it says something about screens found, but none have a usable configuration.

pljvaldez 06-04-2007 02:51 PM

Quote:

Originally Posted by zephyrcat
I tried that with vesa and 1024x768 it returned two cryptic errors. I have intel integrated graphics, if that helps.

The cryptic errors are important to helping us diagnose...


All times are GMT -5. The time now is 01:30 AM.