![]() |
ubuntu.com - launchpad.net - ubuntu help
|
|
|||||||
|
Tutorials & Tips The place to find Ubuntu related Tips & Tricks. |
|
|
Thread Tools | Display Modes |
|
|
#1 | |||||||
|
Ubuntu Guru
![]() |
How to Multi-boot (Maintain more then 2 OS) ![]() Dual booting is fairly straight forward, but what happens when you would like to boot multiple (more then 2) operating systems ? If you are new to Ubutnu, or wanting "simply" to install Ubuntu and Dual boot with Windows, this is not the best tutorial, although you may find it informative. Please refer to this wiki page: https://help.ubuntu.com/community/GraphicalInstall In this how-to I will cover primarily booting multiple Operating Systems, primarily Linux Distributions (Versions), using GRUB. For other OS, see the following links : 1. Booting multiple versions of windows can be tricky as you need to "hide" the various windows installs from each other. http://users.bigpond.net.au/hermanzo..._MultiWindows_2. BSD can bee more cryptic : http://www.ubergeek.co.uk/howtos/gru...windowsxp.html3. NetBSD and OpenBSD : http://www.linuxselfhelp.com/gnu/gru...er/grub_4.html Note to Vista users: Please refer to this link (EasyBCD) http://neosmart.net/wiki/display/EBCD/Ubuntu Contents:
To automate maintenance, either chainload or configfile (not both). Prerequisites ~ "things you should already know" : You must have a solid understanding of partitioning and partitioning naming (both Linux and GRUB numbering schemes). While Windows letters partitions ( C:\) , Linux uses /dev/sdxy (or /dev/hdxy) and Grub numbers partitions starting with 0. If you need a refresher on partitioning terminology see this link : Partitioning basics For this tutorial, think of each installation as needing both a root ( / ) partition and a boot directory (or separate /boot partition if using XFS, LVM, or encryption). You will also find it helpful to have some understanding of grub configuration. Hermanzone is a great resource for grub. http://users.bigpond.net.au/hermanzone/p15.htmIf you understand partitioning and basic GRUB configuration, Mult-booting is not too hard. General overview of the boot process : The details of the boot precess are beyond this tutorial, but here is a nice summary from Wikipedia : Quote:
/boot The boot directory is normally on the root ( / ) partition and contains, amongst other things, your kernel(s), initrd (initial ram disk), and grub (particularly menu.lst). A separate /boot partition is required with GRUB if you use XFS, LVM, and/or encryption for your root partition. You can not share a /boot partition (the problem is that most distributions will overwrite your /boot partition when you install them). Partitioning : In general I allocate 512 Mb for a boot partition (if needed), 5-10 Gb for the root partition ( / ), and a separate /data partition for user data (40 - 100 Gb). Sharing partitions : You can not share a /boot partition with multiple distros. Swap Your swap partition can be shared between Linux distors and even BSD (you need only one swap). The problem may be that some distros will automatically format your swap space (during the installation), and if it is formatted, the UUID will change. In this event you will need to edit /etc/fstab (on any old OS) and update the uuid or mount swap using /dev/sdxy . If you use /dev/sdxy you not need to update fstab if swap is formatted again during a future install. How to fstab. Conflicts with a shared /home While the idea of sharing a /home partition may sound good, use caution in doing so. The potential problems include :
This problem can be "solved" by using different user names with each distro, or better a /data partition. Shared /data partition. I advise you make a shared data partition for data you wish to share across distros and leave /home (and the configuration files) on your root partition. You will likely still have permission problems, but this will eliminate conflicts with configuration files in a shared /home partition. You can minimize permission problems while maintaining security by making a new group, say "data", and giving ownership of the data partition to root.data with permissions of 770. As with a shared home, be careful not to format or overwrite your /data partition. (or add your data partition to /etc/fstab post-install). Install a new OS, manually configure GRUB : Normally, when you install a new OS, you will re-install GRUB to the MBR and GRUB will now point to your new OS when loading Stage 1.5. Many times your new OS will find and automatically add your old OS to the grub menu. If not, you will need to manually edit /boot/grub/menu.lst and add in your old OS. The "problem" with manually editing menu.list is that you will need to manually update the kernel line of the (GRUB) boot stanzas when you upgrade a kernel on the old OS. A typical grub stanza looks like this: Quote:
If you prefer to manually edit /boot/grub/menu.lst with each kernel update, you are done. You can automate the process if you make use of chainloading (see next section). Automate maintenance of GRUB with Chain loading : This section is optional, but makes maintenance much easier. To automate maintenance, either chainload or configfile (not both). You probably think of chainloader as a method of booting Windows or BSD, but you can boot Linux via chainloading. Quote:
http://www.dedoimedo.com/computers/grub.htmlThe advantage of chainloading includes :
The "trick" is you need to install GRUB into your (target) root partition. By far, the easiest way to do this is to install grub BOTH to the MBR and your root (or /boot) partition with each install. You can manually install grub (as root) like this : Code:
sudo grub
[ Minimal BASH-like line editing is supported. For
the first word, TAB lists possible command
completions. Anywhere else TAB lists the possible
completions of a device/filename. ]
grub> root (hd0,1)
grub> setup (hd0,1)
grub> quit
This greatly simplifies your boot stanzas. For each old OS edit the boot stanza to look like this : Quote:
Configure GRUB (on your old, chainloaded OS) Now when you boot, if you select your new OS, if you select the new OS on the grub screen it will boot directly into the new OS. If you select an old OS, however, you will get a second grub screen. Select the old OS a second time. If it is working, you can set the grub defaults for the old OS. First boot the old OS and edit the /boot/grub/menu.lst. You will want to make sure the "default" is 0 and set the "time out" to 0. Quote:
When you upgrade the old OS to a new kernel the second (chain loaded) GRUB will automatically be updated and no manual edit is needed. ====================== Example: Imagine dual booting Fedora and Ubuntu with the following partitions: /dev/sda1 = boot partition (for Fedora)Walk-through:
===================== Automate maintenance of GRUB with configfile : This section is optional and also makes maintenance much easier. To automate maintenance, either chainload or configfile (not both). I recently learned of this option and IMO it is by far the easiest method. It is similar to chainloading (which is why I left chainloading first), but takes a single line in /boot/grub/menu.lst. A sample entry looks like : Code:
title Ubuntu 8.04 configfile (hd0,0)/boot/grub/menu.lst title Fedora 9 configfile (hd0,1)/boot/grub/menu.lst
Reference : http://users.bigpond.net.au/hermanzo...#1._Configfile ================== Next install as many OS as you like, always installing grub into the root ( / ) partition (or /boot partition) of each OS. Hope this helps making multi-booting a little easier. Peace be with you, bodhi.zazen
__________________
A person with ubuntu is open and available to others, affirming of others, does not feel threatened that others are able and good, for he or she has a proper self-assurance that comes from knowing that he or she belongs in a greater whole and is diminished when others are humiliated or diminished, when others are tortured or oppressed. ~ Archbishop Desmond Tutu, 1999 ![]() Last edited by bodhi.zazen; May 23rd, 2008 at 05:41 PM.. Reason: Added information re: configfile |
|||||||
|
|
|
|
|
#2 |
|
Chocolate Ubuntu Mocha Blend
![]() Join Date: Jul 2006
Beans: 1,771
|
Re: How to Multi-boot (Maintain more then 2 OS)
To add a little tidbit you can also use the same procedure with a virtualized multi-boot if you need the space.
__________________
Creative Soundcard Tip |
|
|
|
|
|
#3 |
|
5 Cups of Ubuntu
![]() Join Date: Mar 2008
Location: Northern Virginia, USA
Beans: 41
Hardy Heron (Ubuntu Development)
|
Re: How to Multi-boot (Maintain more then 2 OS)
Bodhi: The guidance provided by you is too advanced. Could you or someone on this forum provide guidance as to how a newbie could install multiple operating systems? Here is my scenario:
I have two Sata drives. Vista is on first drive (sda 0,0) which has three partitions. Ubuntu is on the second Sata drive with its Swap and other partitions. Ubuntu installed the GRUB correctly (I do not know where). The GRUB menu list displays Ubuntu and Windows/longhorn and gives me the option to boot either. Now, I want to install SUSE (and then Fedora) alongside Ubuntu on the second Sata drive. What do I do? I want to leave Vista untouched on the first (0,0) mainly because I do not want anything to happen to it. Ideally, I would like to install Vista, Ubuntu, Suse and Fedora on the first drive. But I do not know how to chain install. When I go through the SUSE installation CD, it insists on deleting the Vista partition(s). When I direct it to one of the empty partitions along side Vista on the first Sata, it gives me error that it cannot find the root (/) and the boot -- mounts, When I try to install SUSE on the second Sata (which is currently occupied by Ubuntu), it insists on deleting Ubuntu's partitions. If I understand the guidance above, what you are saying is that Suse, for example, cannot be installed along side Ubuntu using the usual SUSE install disc? The only way out is installing it manually? Before I started to install Ubuntu on my second sata (160 gigs) I had created three partitions in the hope that I will install Ubuntu, Suse and Fedora. I started with my favorite Ubuntu. However, I could not install Ubuntu on the 50 gig partition that I had created because it kept asking me for the root partition and there was nothing in the graphic install program that gave me any guidance as to how that can be done. Finally, I just did a "guided" install. The result was Ubuntu wiped out the other two partitions and now occupies all of my second drive. Could you please, once again, try to provide guidance in understandable terms or direct me to relevant links? |
|
|
|
|
|
#4 | ||||
|
Ubuntu Guru
![]() |
Re: How to Multi-boot (Maintain more then 2 OS)
Quote:
You need to understand basic partitioning, and how both grub and linux refer to partitons. http://ubuntuforums.org/showthread.php?&t=282018 Next you need to understand how grub works. IMO the easiest is to use chainloader, as outlined above, as that will automate the process greatly. I advise you re-read my how-to and ask specific questions about what you do not understand. I (or others) can try to explain it better and I can update the how to if needed. If you like, here is another link using grub and chainloader to boot up to 145 OS: http://www.justlinux.com/forum/showt...282#post861282 The other option, of course, it to install away and hope it works (usually it does). You will likely need to sort out a number of pieces with this approach including how to manually update grub with kernel updates and adding grub entries for OS that are not automatically configured at installation of a new OS. Best grub guide : http://users.bigpond.net.au/hermanzone/p15.htm Quote:
Quote:
Quote:
http://tldp.org/HOWTO/Partition/fdisk_partitioning.html So again my best advice is to step back and do a little prep work. Again, if you get stuck feel free to ask questions, the more specific the question the better we can assist you. As an aside, personally I give each OS 10 Gb for the root partition and use a larger shared data partition.
__________________
A person with ubuntu is open and available to others, affirming of others, does not feel threatened that others are able and good, for he or she has a proper self-assurance that comes from knowing that he or she belongs in a greater whole and is diminished when others are humiliated or diminished, when others are tortured or oppressed. ~ Archbishop Desmond Tutu, 1999 ![]() Last edited by bodhi.zazen; April 2nd, 2008 at 05:48 PM.. |
||||
|
|
|
|
|
#5 | |
|
First Cup of Ubuntu
![]() Join Date: Mar 2008
Location: Rennes
Beans: 5
|
Re: How to Multi-boot (Maintain more then 2 OS)
Quote:
I have 2 Linux ( Gentoo/Ubuntu ), One Windows, one Mac os X and on external hdds I have Solaris and FreeBSD all working fine |
|
|
|
|
|
|
#6 | |
|
Ubuntu Guru
![]() |
Re: How to Multi-boot (Maintain more then 2 OS)
Quote:
/common-boot != /boot As a general warning (to others), if you create a partition and, during the installation(s), mount it at /boot there is a high chance it will be formatted and overwritten when you mount it as /boot during your second installation. This will leave your first installation un-bootable. I know it is a matter of syntax, but I would not call your method a shared /boot partition. As I have tried to warn you, mounting a shared partition at /boot will not work so smoothly.
__________________
A person with ubuntu is open and available to others, affirming of others, does not feel threatened that others are able and good, for he or she has a proper self-assurance that comes from knowing that he or she belongs in a greater whole and is diminished when others are humiliated or diminished, when others are tortured or oppressed. ~ Archbishop Desmond Tutu, 1999 ![]() |
|
|
|
|
|
|
#7 |
|
5 Cups of Ubuntu
![]() Join Date: Mar 2008
Location: Northern Virginia, USA
Beans: 41
Hardy Heron (Ubuntu Development)
|
Re: How to Multi-boot (Maintain more then 2 OS)
OK Bodhi here is some more specificity:
1. What program should I use to create partitions. Gparted does not work from inside Ubuntu. Therefore, should I get it on a disc or USB? 2. Assuming I am successful in creating two more partitions on my second drive (where Ubuntu resides), how do I begin the installation? Ubuntu, presumably, already has a boot and swap partition. So what do I do on the new partitions? 3. Installing Suse and Fedora: I have these on DVD. Is there another manual way of installing these OSs? Because if I follow the OS installers, they do not let me create /, boot, or a swap. That is my main dilemma. How do you finally install these OSs on the new partitions? As said I had three, roughly equal, partitions on my second drive. But when I started to install Ubuntu, it's install program wiped out my partitions. I could not (or did not know) how to create the / and swap on the first partition. Plus, keep in mind that Vista is already installed on the first drive's first partition and Ubuntu on the second drive. Right now Ubuntu's GRUB is working fine as it lets me boot Vista. If I understand you correctly, I should somehow install Suse and Fedora (after creating new partitions for them) and later do manual manipulation with GRUB. My only fear there is that nothing will boot so there will be nothing to manipulate. Unlike Ubuntu, both Suse and Fedora messed up my Vista installation and failed to boot from the hard drive. That is the challenge. Keep Vista and Ubuntu working while venturing to install Suse and Fedora without ending up having no boot. Or worse ending up having my boot loader completely destroyed. I know Bodhi, you have the solution. However, anyone is welcome to help and lead me through this process. I promise if I make it, I will write a step by step easy to understand procedures for multi operating system machines. |
|
|
|
|
|
#8 |
|
Ubuntu Guru
![]() |
Re: How to Multi-boot (Maintain more then 2 OS)
Sorry for the delayed response.
I think the main problem you have is that you need to set up your partitions (with gparted or fdisk) before you start the installer. I advise gparted, it is a common tool and will allow you to resize your Ubuntu partitions. Gparted Documentation So ... 1. Boot a live CD (you can not resize ubuntu while running from the hard drive). In general partitions should be managed from a live CD. 2. Unmount all hard drive partitions (including swap). 3. Resize your ubuntu root partition to make additional space. 4. In general, 5-10 Gb is sufficient for your root partitions. So make 3 - 10 Gb partitions, one for Ubuntu (resized), one for SUSE, and one for Fedora.
5. The complexity here will be Fedora. By default, fedora will want an additional partition for /boot (Fedora uses LVM). So make a 512 Mb partition for fedora /boot 6. Make a large partition for shared data. You should use ext3 and can share this space with ubuntu, fedora, suse, and windows. 7. After making all these changes you may need to update Ubuntu /boot/grub/menu.lst and /etc/fstab (with your partition changes). Here is a thread that shows the issues : http://ubuntuforums.org/showthread.php?t=316237 8. Reboot to hard drive, boot Ubuntu, save /boot/grub/menu.lst to your shared data partition for referance (in case you can not boot windows). Install grub to the Ubuntu root partition. 9. Boot SUSE , start the installer, install using manual partitioning, mount the target root partition as / , swap as swap, and the data partition as what you wish (/mdeia/data). Install grub to the suse root partition (after installing suse). 10. Boot Fedora, install as above (don't forget the boot partition as /boot). 11. Boot Fedora, edit /boot/grub/menu.lst Make sure the Windows stanza is "OK" (same as the Ubuntu stanza for windows). Then use these stanzas for Ubuntu / suse (make sure you replace "(hdx,y)" with the correct root partition in grub terminology): title SUSE root (hdx,y) chainloader +1 boot title Ubuntu root (hdx,y) chainloader +1 boot If at any point your swap partition is formatted you may to update /etc/fstab for your previously installed distros. The UUID changes if the partition is formatted and many distros mount with UUID=xxx.yyy.zzz in fstab. Use /dev/sdxy and you will not have this problem. http://ubuntuforums.org/showthread.php?&t=283131 If at any point you can no longer boot Windows or Ubuntu, it would be a matter of configuring grub and you can refer to the back up copy of /boot/grub/menu.lst you saved earlier. Installing additional OS, as long as you do not format old partitions, will not cause you to "loose" windows or ubuntu.
__________________
A person with ubuntu is open and available to others, affirming of others, does not feel threatened that others are able and good, for he or she has a proper self-assurance that comes from knowing that he or she belongs in a greater whole and is diminished when others are humiliated or diminished, when others are tortured or oppressed. ~ Archbishop Desmond Tutu, 1999 ![]() Last edited by bodhi.zazen; April 4th, 2008 at 07:30 PM.. |
|
|
|
|
|
#9 |
|
First Cup of Ubuntu
![]() Join Date: Apr 2008
Beans: 9
|
Hallo Bodhi,
thanks for the nice howto. I am planning to reinstall the OSes on my PC soon, and your guide comes handy. I have already checked some other ones on the net, but no-one is really tackling all the issues. Yours is good and easier to understand than most (after some pain with the partitioning basics), so I would like to ask you a couple of questions. 1) somewhere I read about the possibility of installing GRUB in a partition of his own, OS-agnostic and thusly independent of OS reinstalls: I like to reintall from time to time, and everything that makes it easier is a Godsend to me. Have you experience/suggestions/opinions on this? I was planning to make a GRUB partition of 100MByte and mount it as /GRUB on my Linuxes (Ubuntu and Gentoo). Whenever I reinstall Windows, the MBR will be brutalized and GRUB will be in need of a reinstall. Can I do it from any Linux release I fancy, independently from the one I choose the previous time? (I plan to follow your advice and chainload my grandma, too) 2) I have a fakeraid setup: southbridge Intel ICH9r, 2 SATA2 drives on mirroring. I know that Linux sotware raid is better but I just want a brute disk mirroring working from Windows, too. I managed to dual-boot Windows and Gentoo from it, but after the reinstall Ubuntu will be in, too. Do you recon I will have problems? How is the situation with hardware support on Ubuntu installation disks? |
|
|
|
|
|
#10 | ||
|
Ubuntu Guru
![]() |
Re: How to Multi-boot (Maintain more then 2 OS)
To keep this thread on topic I will first comment on a dedicated grub partition. This is very easy to accomplish, but a little terminology may help.
Lets start with a /boot partition. A /boot partition contains grub and your various kernel(s) and initrd , everything you need to boot your linux distro. If you want to have a dedicated grub partition, make a small partition ( 1 Gb is overkill here), install grub into it, but NOT the kernel or initrd. DO NOT mount the grub partition as a /boot partition (Each distro continues to maintain unique /boot partitions, typically on the root ( / ) partition). The grub partition will have (grub) stage 1.5, stage 2,and a menu.lst. You will need to continue to edit and update the menu.lst (on the grub partition) as you add/remove distros. Now you can either manually maintain the kernel/initrd in the boot stanzas : Quote:
Quote:
With a live CD : Code:
sudo grub Code:
grub > root (hd0,0) grub > setup (hd0)
HTH. Here are a few links for reference : Making a Dedicated Grub Partition Multiboot with GRUB Mini-HOWTO As to fakeraid, I am not sure. I would assume you will need a /boot partition outside of the raid and that setting up Ubuntu would be similar to Gentoo. You may wish to search these forums or start a new thread.
__________________
A person with ubuntu is open and available to others, affirming of others, does not feel threatened that others are able and good, for he or she has a proper self-assurance that comes from knowing that he or she belongs in a greater whole and is diminished when others are humiliated or diminished, when others are tortured or oppressed. ~ Archbishop Desmond Tutu, 1999 ![]() |
||
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|