LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Bootloader with 3 or more OS (https://www.linuxquestions.org/questions/linux-newbie-8/bootloader-with-3-or-more-os-423408/)

ServalSoft 03-10-2006 02:16 AM

Bootloader with 3 or more OS
 
I am trying to install Win and 2 flavours of linux onto the same harddrive. my problem is installing the bootloader in order to choose which OS to load. As what tends to happen is when installing it, the later tends to erase the previous. Is creating a separate small partition to install all bootloaders on likely to fix this problem??? PS i do not have a floppy disk as i did think this could have been and option. I am using a laptop. Compaq presario 2500 series

Thanks

jomen 03-10-2006 02:46 AM

Quote:

Is creating a separate small partition to install all bootloaders on likely to fix this problem???
Not by itself...
Make a small partition to be your /boot partition.
Then, when installing the different OS'es, mount this partition to /boot on the OS you are just installing.
Actually you only have to do the "install bootloader" once - and for the others just skip the "installing the bootloader" step.
Instead, add the OS manually to the - after the first install already existing - grub-configuration file.

This applies if you are using grub, if you use lilo this is a little different and not as easy to manage, because lilo has it's config-file in /etc/lilo.conf - but this can be changed...grub is easier.
Install Windows first, because it WILL overwrite the MBR in any case. After you installed the first linux, you can boot to Windows again using grub.

ServalSoft 03-10-2006 03:00 AM

?????
 
So if i got it right, what I need to do is:
# Install Win
# Create a partition for my boot loader, labeled /boot
# Install my first linux OS, and install grub on to /boot
# Install the 3 rd OS n skip the bootinstall option
# add the boot manualy onto grub.

Now the question is, how do I add that option manually onto grub.

Thanks

titopoquito 03-10-2006 03:16 AM

Another solution is to use xfdisk (http://www.mecronome.de/xfdisk/index.php) and install it in the windows partition -- I guess it's your first primary partition. Then install Grub or Lilo to the superblock of the Linux partition (for example /dev/hda2). It is able to boot Linux and *BSD systems.

AwesomeMachine 03-10-2006 03:19 AM

You do have to mess around a little to do this. You need to install MS Windows first. You need partitions for each os. You do not need a seperate partition for the boot loader. Do not make the Windows partition the first partition. You can use a partitioning utility like Partition Magic to make the partitions. You can boot PM from the CD. I don't think there are any linux utilities to make NTFS formats. At worst, you can use a live linux cd to make all the partitions, and let MS Windows format its own partition. What I do is make two small primary partitions for the two linux installations, say five or ten GB each. A large install of linux uses about five GB, but you really need about eight GB for future expansion. Then I make an extended partition and make logical partitions inside of it for linux swap, about 1 GB, partition for MS Windows, and a partition for linux /home. That way, if you want it different later, you don't have to wipe out /home and MS Windows.

When you partition, you assign mount points. Every partition needs a mount point, unless you use PM. You can only make one partition root, so choose the first partition. Assign some random mount point(make one up, like "local") to the other primary partition, and when you install the second linux you can make it another root partition.

Install windows in the logical partition you made for it. Just tell Windows to go there in setup. Windows will put boot loader files in the first primary partition, and the rest of itself in the logical partition.

Now, install the first linux. This will go in the first partition you made, the first primary partition. There should be a place in the install program where you can specify to use the logical partition "/home" as /home. Linux won't always do this right, and you have to actually check it is using the partitions the way you want. Ok, let it install.

Now, the problem with the second linux is that it wants to use its own /boot/grub/menu.lst file, and it fails to retrieve the entries from the the one in the first linux install. So, when you boot after the second linux install, the first one doesn't show up anymore. Boot the second linux. Take everything in the first linux /boot/grub/menu.lst file, and everything that isn't in the second /boot/grub/menu.lst file must be added. That is usually one entry, for the first linux. Then everything will show up on the boot menu. The idea is you can only use one /boot/grub/menu.lst file, and everything has to be in that file that you want to boot.

When you installed the first linux, grub relocated the MS Windows boot loader to the Windows partition, and made a pointer that grub uses to find it. Grub took over the MBR, and controls it. Windows is all gone from there.

Here are some sample menu.lst entries:

title linux 1
root hd(0,0) or (hd0,0)
kernel /boot/<kernel-2.6.8-xyz> options(i.e. acpi=off root=/dev/sda1)
initrd /boot/<initrd-2.6.8-xyz>
savedefault
boot

title Windows 95/98/NT/2000
root (hd0,3)
makeactive
chainloader +1

jomen 03-10-2006 03:29 AM

Looks quite right :)
Maybe clear up a possible misunderstanding right here.

When saying: "grub is installed" there can be two different meanings to it.

When the grub-package is installed - like any other on the system - some files get copied to some places.
In the case of grub: the binary goes to /sbin/grub and the other files go into /boot/grub (the stage... files and the config file.

after this is done, you can "install grub" to the MBR - this is what the command:
Code:

grub-install /dev/hda
does.

So - you need to install grub to MBR - not to /boot

Only its files need to be in /boot - which translates to the partition you made, mounted to /boot

If you would do this multiple times - you would end up with the last distributions grub-files and with a configuration-file wich only has one entry - the last one...
You can still do it this way - but in the end you need to edit the configuration-file to have entries for all systems.

And for convenience - copy all the different kernel-images to /boot, and give them distinguishable names - but this should not be neccessary, when the partition was mounted to /boot during every OS install.

ServalSoft 03-12-2006 07:30 AM

Quote:

Originally Posted by titopoquito
Another solution is to use xfdisk (http://www.mecronome.de/xfdisk/index.php) and install it in the windows partition -- I guess it's your first primary partition. Then install Grub or Lilo to the superblock of the Linux partition (for example /dev/hda2). It is able to boot Linux and *BSD systems.

Ive tried to download that program but it doesnt work when i install. If i download a boot manager like osl2000, install it on to win, then install linux and install their bootloader onto the superbook ie /dev/hda2 or /dev/hda3, will this solve the problem. thanks

pixellany 03-12-2006 08:26 AM

Quote:

Originally Posted by ServalSoft
So if i got it right, what I need to do is:
# Install Win
# Create a partition for my boot loader, labeled /boot
# Install my first linux OS, and install grub on to /boot
# Install the 3 rd OS n skip the bootinstall option
# add the boot manualy onto grub.

Now the question is, how do I add that option manually onto grub.

Thanks

You do not need a separate partition for /boot, although many people do it.

grub goes in the mbr---not in /boot. This is taken care of automatically when you use your Linux installer.

When setting up multi-boot with Linux and Windows, I suggest having a data partition--formatted FAT32. this is easily accessible by both OSes.

ServalSoft 03-12-2006 06:24 PM

Quote:

Originally Posted by pixellany
You do not need a separate partition for /boot, although many people do it.

grub goes in the mbr---not in /boot. This is taken care of automatically when you use your Linux installer.

When setting up multi-boot with Linux and Windows, I suggest having a data partition--formatted FAT32. this is easily accessible by both OSes.

I do understand that grub goes straight in the MBR. but I dont want that. im using a laptop with no floppy and would like to be able to have 3 or more OS on it. When i install the second OS it works no problem, but if i would like to install the 3rd one, then everything gets erase and i can only see the windows and last linu partition. I would like to be able to have something like a menu that give me a choice to select which OS i would like to boot. and im not to sure either on how to manipulate the grub config file or manually change it.

Randux 03-12-2006 08:49 PM

You can do this in lilo without difficulty. I multiboot 4 OSs (it would be more but I don't have enough HD space) including Windows and 3 linuxes.

Install lilo in the MBR. In your config, just define all the OSs you want to boot. As somebody pointed out, install Windows first, in the first partition.

See the last post in http://www.linuxquestions.org/questi...d.php?t=420172

There are beaucoups threads on this topic already.

pixellany 03-12-2006 10:54 PM

Not really clear on what you are saying...

First, there must be boot code in one of 3 places: floppy, CD, mbr of drive 1. If you don't want grub in the mbr, where were you going to put it?

When you installed the 3rd OS, did you have empty space on the drive? Did it make new partition(s) during the intstall? If you say that everything got erased, tehn you likely took an existing partition and gave it to OS #3.

jomen 03-13-2006 12:57 AM

Quote:

...im not to sure either on how to manipulate the grub config file or manually change it.
The file is located here:
Code:

/boot/grub/menu.lst
here you add the OS's you have installed - look at it and edit it with any editor you like.
The structure is simple:
-a title line
-a kernel-line which describes, where the kernel is, what its name is, where the root filesystem (the OS...) is which you want this kernel for
-maybe a third line for a initial ramrisk - some distributions use one.
Grub needs to be in MBR, if there is no bootloader there, the machine simply does not boot.
Quote:

but if i would like to install the 3rd one, then everything gets erase and i can only see the windows and last linu partition
nothing gets erased - maybe the menu.lst is overwritten by the new installed OS - if you do not skip the bootloader-installation step as I suggested.
The easy fix is: edit the file and put the entry for the OS back in.
Everything else has been said.


All times are GMT -5. The time now is 06:48 PM.