1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Multiple-boot Linux tips?

Discussion in 'Linux and Unix' started by Bartender, Oct 9, 2006.

Thread Status:
Not open for further replies.
Advertisement
  1. Bartender

    Bartender Thread Starter

    Joined:
    Apr 27, 2006
    Messages:
    197
    I have a dual-boot Linux test box running W2K/Dapper. I want to set that HDD aside so nothing bad happens to it, plug in a 120GB Seagate, and experiment with multiple-booting 4 or 5 Linux distro's. No MS OS at all.
    I'm a newb. Does anyone know of a fairly comprehensible guide? Is it no harder than dual-boot? If I had to try it right now, I'd just plunk in the 1st distro, use the partitioning tool to make 4 partitions, install to the 1st partition, reboot, put in the next one, etc.
    It's not that easy, is it?
     
  2. Sponsor

  3. saikee

    saikee

    Joined:
    Jun 11, 2004
    Messages:
    3,812
    Got loads the booting information you need in my signature.

    If you can boot 2 systems I expect you can do 200 as the instructions don't get changed.
     
  4. Bartender

    Bartender Thread Starter

    Joined:
    Apr 27, 2006
    Messages:
    197
    HI, saikee -
    I was hoping you'd respond!! Will take a look at your links, thanks!
     
  5. fenderfreek

    fenderfreek

    Joined:
    Mar 14, 2006
    Messages:
    201
    Saikee's link hits the nail on the head. It really is no different to multiboot with Linuxes than with Window$, Except that Linux Distro's can share swap - a very nice feature. Also, they peacefully coexist and don't screw up each other's bootloaders, like Win...
    I've done it, and it's quite easy, so best of luck to you!
     
  6. Bartender

    Bartender Thread Starter

    Joined:
    Apr 27, 2006
    Messages:
    197
    Spent several hours yesterday with SimplyMepis, Ubuntu 6.06, and PCLinuxOS. Gave up trying to get 3 of 'em and woulda been happy to just get 2, but what I've got right now is a PC that's booting PCLOS and showing another partition that I thought was Ubuntu but might not be any more.
    It was easier dual-booting W2K and Ubuntu! But I just followed hermanzone's instructions like a trained rat. No comprehension what I was doing, just did it. I haven't found an illustrated, step-by-step guide for this...
    I've got some O'Reilly books and the Keir Thomas book for Ubuntu, so can sit in study hall for a while. As it stands right now I recognize the terms but don't really have a working knowledge - mount points, "/", primary vs. extended, etc.
    saikee's guides quickly went into "huh?" territory for me. Seems there oughta be an easy method to at least get 2 of 'em going
     
  7. fenderfreek

    fenderfreek

    Joined:
    Mar 14, 2006
    Messages:
    201
    Granted, it can be confusing at first, but once you understand how the nuts and bolts of the booting process works, it's a snap. For starters, what does your current hard drive layout look like? (Sizes, format, mount points, etc.) Once I see what you've got, we can go from there with as little rearranging as possible.
     
  8. Bartender

    Bartender Thread Starter

    Joined:
    Apr 27, 2006
    Messages:
    197
    I'm installing Ub 6.06 right now. Googling "multiple boot" gives about 603 different answers, ranging from "it's easy" to 50,000 word instructions written by someone who dreams in ext3.
    Gnome Partition Manager is right there under "System" when you're running the Ub CD Live, but gone when the OS is installed.
    Hey, wait a minute - I could run a "Live" session right on top of the Ubuntu install, couldn't I? Hadn't thought of that until just now. That would be one way to get to GParted or QTParted or whatever it is they call it so I can whittle.
    Oh, yeah, I don't have broadband, just a funky dial-up provider that kicks me off in about 20 minutes when I connect via Linux, so downloading huge programs is outta the question. Synaptic runs at about 5 kbps - pathetic.

    I'm not daunted by the terminal but not very good at it either. Entered sudo gedit /boot/grub/menu.lst and got what appears to be a small tutorial then at the bottom, after the "##" section, 2 Ubuntu entries (one recovery mode) and memtest.

    System>Admininistration>Disks>Partitions shows:
    Partition 1, /dev/hda1 ext3 109.99 GB
    Swap Partition /dev/hda5 Memory Swap 1.8 GB

    Most of hda1 is blank of course. I'd like to shoot for at least one other OS.
    -Should I re-install and partition first?
    -If not, can I make 2 or 3 partitions now?
    -Should they be logical instead of primary?
    -What is the "mount point"? I haven't gotten a mental picture yet.

    Seemed like each time I flailed around in GParted I felt a little better about it but still lots of mysteries - it wouldn't let me get rid of some partitions, wouldn't let me resize some, and I got confused w/ the whole "mount point" thing. Thanks for your patience & I'll try to not be helpless :)
    EDIT: I am writing things down in my notebook - perhaps I can write a newb friendly guide
     
  9. fenderfreek

    fenderfreek

    Joined:
    Mar 14, 2006
    Messages:
    201
    You mentioned running the Live CD over the standard install, and yes, you can do that. Just mount your local HDD and do a "chroot (yourlocaldrivemount)" to change the root to it. Then you can work on it from the live environment just the same.

    As far as your confusion about mount points, they are simply a way of dedicating and assigning a partition to a particular point in the file tree. For example, I typically set up a 100 Mb partition by itself, and use it for the '/boot' mountpoint where Linux stores it's boot/kernel info, that way if I need to recover or do kernel work, I'm not messing around near my data. Typically, though, you can make one large partition for everything and mount it to '/' (root). You can mount anything with mount points - /home, /var, /boot, whatever you like.

    You say you have most of hda1 blank, and that's understandable - The OS itself requires relatively little space. I generally make my Linux partitions like so:
    Each Distro -
    (1) 100 Mb partition that I set to '/boot' mount point
    (1) 20Gb partition that I set to '/' mount point(for everything else)
    For all of them-
    (1) 2Gb Swap partition (large, because I like to customize live CD's and things that require large blocks of memory, so unless you're doing the same, you might want something like 512Mb or so, but your 1.8 is fine.)

    The swap partition doesn't need to be repeated for each distro - they can share a swap space - or any space, really. Theoretically, you could set up a partition and mount it to '/home' and have your home directory shared across distro's, though I've never tried that myself. It's easier to just keep it simple and let each live in it's own logical space. Speaking of logical space, I usually set up a logical volume for each distro, just to keep it neat and together, but logical volumes are totally optional if you're keeping them confined to one disk. You can have a limited number of primaries, but many logical partitions, so I personally make only extended logical partitions just for flexibility.

    Your best bet is to install the distro's one at a time, and manually create the appropriate size partitions and their appropriate mount points. If you let it auto-configure, or worse, use the whole drive, you may or may not get what you wanted, or end up with nothing. I always opt for a manual configuration, because it's only a little more hassle, and I know exactly what I'm getting.

    Try using qtparted or gparted to resize that Ubuntu partition to something more reasonable, then continue happily installing all the distros you want, manually setting up partition and mount points. Just remember that your biggest mount point, where everything goes, is root(/) and optionally, you can mount boot(/boot) separately. If you want to keep it simple, just use a swap and a root.

    The most I ever did myself was WinXP + Ubuntu + FC5 and that wasn't bad at all, so having 3 *nix'es shouldn't be much trouble.
     
  10. saikee

    saikee

    Joined:
    Jun 11, 2004
    Messages:
    3,812
    Multi boot made easy

    Steps

    (1) Use a Live CD to chop up the hard disk in 10Gb partitions. Leave one 1Gb for swap (type 82). Using a Live CD the partitions created will be automatically Type 83. No need to format. Just click write, reboot and check everything is in order.

    (2) Install the first Linux in any partition, say this is hda1 and the swap is hda2. Tell the installer you like its boot loader in the MBR (only the first one). Boot up the system, make sure everything work. Choose a distro that uses Grub for the first installed Linux. See explanation later if it is a Lilo.

    (3) Edit the boot configuration file of the boot loader to include "future" Linux. The file is /boot/grub/menu.lst. Since hda1 and hda2 have been taken I assume hda3, hda5, hda6 and hda7 will have future distros or other systems installed. hda4 is assumed to be the extended partition which is a border for the logical partitions, meaning it has no storage of its own. Lines to be added are
    Code:
    title System in hda3
    root (hd0,2)
    chainloader +1
     
    title System in hda5
    root (hd0,4)
    chainloader +1
     
    title System in hda6
    root (hd0,5)
    chainloader +1
     
    title System in hda7
    root (hd0,6)
    chainloader +1
    (4) Install other distros in hda3, hda5, hda6 and hda7 but tell the installers you want each boot loader inside the root partition of each Linux. Use one partition per distro. Try not to be clever with multiple partitions for a distro as you only get aggravation. Why make life complicated when it can be simple?

    Every time you put a Linux inside any of the spare hda3, hda5, hda6 and hda7 partition it will boot immediately.

    So what is the big deal in booting? I put down 5 systems here but it is just the same if you want to boot 500. (need a lot of disks obviously)

    This system works for any of Dos, Windows, Linux, BSD, Solaris and Darwin except most of them prefer to reside inside primary partitions (hda5 and above are logical partitions).

    The above scheme also works for Lilo but the bugger checks every line in /etc/lilo.conf and won't have it if the partition is empty. Therefore you need to install all the distros before amending /etc/lilo.conf. Only two lines are needed in Lilo.

    Code:
    other=/dev/hda3
    label=system_in_hda3
     
    other=/dev/hda5
    label=system_in_hda5
    
    other=/dev/hda6
    label=system_in_hda6
    
    other=/dev/hda7
    label=system_in_hda7
    A little boring theory if you are insterested

    The above is called chainloading. All it means is one boot loader boots another boot loader. For obvious reason you need to have a boot loader in the root partition of every system. MS systems "always" place their boot loaders insde their root partitions "C-drive". We can do exactly the same with every Linux. Ever thought about what is the use of the installer allowing us to place the boot loader in the root partition? That is the ticket, mate!
     
  11. fenderfreek

    fenderfreek

    Joined:
    Mar 14, 2006
    Messages:
    201
    ^My method = pwnt.:p

    I never considered doing it so simply. I guess simple is better.:D
    I'll definitely go with a similar approach from now on.
     
  12. saikee

    saikee

    Joined:
    Jun 11, 2004
    Messages:
    3,812
    fenderfreek,

    You can round up all the MS systems, Linux, BSD .......etc and put them into the box and Grub will boot every one without losing a beat.

    Feel the power of Linux.
     
  13. Bartender

    Bartender Thread Starter

    Joined:
    Apr 27, 2006
    Messages:
    197
    Some things have come up and I won't be able to get to this for a few days. Will then print what has been written so far and try to make it happen. Thanks for the guidance; I'll be back.
     
  14. Bartender

    Bartender Thread Starter

    Joined:
    Apr 27, 2006
    Messages:
    197
    Hi, guys -
    First things first - saikee, what Live CD do you use to partition? Or do you have a partitioner on a CD independent of a Linux OS?
    Spent several frustrasting hours with the partitioners in my Mepis, PCLOS, & Ubuntu CD's. I tried 2 different PATA HDD's too. With the big 120GB Seagate, Ubuntu would not let me make logical partitions. I'd wipe the entire drive, then click on the map of the drive, then click on "New". The Logical and Extended options would be grayed out, so I started making Primary partitions. At the 4th one, GParted popped up saying I couldn't make more than 4, and I had to make some logical partitions. Or maybe it was extended. So I'd go back, but no matter what I tried the other options were grayed out so I couldn't make any.
    My copy of O'Reilly's "Running Linux" (4th Ed., pg. 42) claims you can create one logical partition, then create many logical partitions within. So I tried that, unformatting the whole drive, then making one big logical, then try to cut that up, but I'd get error messages saying the new partition was unreadable. I tried the Mepis partitioner, but almost all the options were grayed out across the entire toolbar area. That, and the Mepis partitioner window ran out about 3 screen widths, and would not pull back in to the left.
    The PCLinuxOS partitioner wizard gave me grief, too, trying to do stuff but coming up with errors.
    I don't know what I was doing wrong.
    I put in an old 30GB WD and tried again with the Ubuntu CD. This time was different. I was able to format the entire drive as logical, create a swap to the far right (labeled hda5) then created two logical partitions. Only got the choice of logical this time...primary was grayed out when I was making partitions! Went ahead and installed Ubuntu to the first logical, id'ed as hda6. Installed PCLOS to hda7. I never saw PCLOS ask me where to place the bootloader.
    Oh, yeah, I went into Ubuntu's /menu.lst and added the 3 lines that saikee describes. Since PCLOS ended up in hda7 I followed his exact wording for the hda7 menu.lst modification, telling grub to look at (hd0,6).
    Obviously, this didn't come out at all like saikee's instructions. Pasted in below are the menu.lst's for Ubuntu and PCLOS. I added the italicized lines...

    menu.lst in hda6 (Ubuntu):

    title Ubuntu, kernel 2.6.15-23-386
    root (hd0,5)
    kernel /boot/vmlinuz-2.6.15-23-386 root=/dev/hda6 ro quiet splash
    initrd /boot/initrd.img-2.6.15-23-386
    savedefault
    boot

    title Ubuntu, kernel 2.6.15-23-386 (recovery mode)
    root (hd0,5)
    kernel /boot/vmlinuz-2.6.15-23-386 root=/dev/hda6 ro single
    initrd /boot/initrd.img-2.6.15-23-386
    boot

    title Ubuntu, memtest86+
    root (hd0,5)
    kernel /boot/memtest86+.bin
    boot

    menu.lst in hda7 (PCLinuxOS):

    timeout 10
    color black/cyan yellow/cyan
    shade 1
    viewport 3 2 77 22
    splashimage (hd0,6)/boot/grub/mdv-grub_splash.xpm.gz
    default 0

    title linux
    kernel (hd0,6)/boot/vmlinuz root=/dev/hda7 splash=silent vga=788
    initrd (hd0,6)/boot/initrd.img

    title linux-nonfb
    kernel (hd0,6)/boot/vmlinuz root=/dev/hda7
    initrd (hd0,6)/boot/initrd.img

    title failsafe
    kernel (hd0,6)/boot/vmlinuz root=/dev/hda7 fail

    Even with all the errors I made (such as hda #'s are not as saikee instructed) Ubuntu boots. I think I understand the numbering - it started where it did because they're logical, not primary.
    With my old W2K/Ubuntu hard drive in place GRUB opens to a page where it asks which OS I want to boot and gives me 15 sec. to choose. With this setup I only get a short-lived GRUB note saying "Press ESC to enter boot menu". If I hit Esc real quick I see "System in hda7" just like saikee described. If I "Enter" I get "Error 13: Invalid or unsupported executable format". O.K., so something's wrong with the PCLOS install.
    However, if I go into Ubuntu's Disk Manager and browse Partition 7, it shows me an entire Linux file structure so it looks like PCLOS is there. In Disk Mgr. partition 7 is id'ed as Device: /dev/hda7, Filesystem: ext3, Access Path: /media/hda7 I tried changing "/media/hda7" to just "/", but still got Error 13. As you can see, I'm just guessing now. I suspect one prob is PCLOS didn't install the bootloader in root. How can I check that, and can it be changed now?
    I had no idea I was so unprepared to create a multi-boot Linux PC...
     
  15. saikee

    saikee

    Joined:
    Jun 11, 2004
    Messages:
    3,812
    Kind of thick myself and so I always stick to simple and basic stuff that is available in every Linux. "cfdisk" is the program I use for all partitioning work. It is a Bash command and available in every Live CD. However I know the Red Hat family uses "sfdisk" instead.

    The really most common partitioning tool is "fdisk" but I find "cfdisk" easier as I could see the partitions as they are being created.

    You would not have a problem in using "cfdisk". If it refuses to let you do it, like creating more than 4 primary partitions, it would have a good reason.

    The PC Bios reads the first 512 bytes of the first bootable disk for booting. That 512 btes is known as the MBR. Between the 447th to 512th bytes there are 4 positions of 16 bytes for defining each of the 4 primary partitions. If a user wants more partitions then one of them must be given up to change into an "extended partition". Inside an extended partition you can have about 60 logical partitions in an IDE but about 11 logical partitions in a Sata.

    In booting with Grub (same for any boot loader) there are two methods

    (1) Direct method - Grub needs to know the partition reference of the "root" of the Linux and this is provided by the "root" statement. A "kernel" statement to find the kerenel and the parameters needed to be loaded at boot time and then an "initrd" statement for loading the inird file. The last one is optional for some Linux as Slackware do use initrd. Please note inside the kerenel statement the partition reference is in Linux convention because it is for loading the kernel.

    (2) Indirect method - Grub needs "root" statement identical to that in the Direct method. A "chainloader" statement for to loader the Linux specified by the "root" command at the +1 sector position. All this means the Grub already inside the MBR will keep its first sector and "cut and paste" with the Linux to be booted at the 2nd sector.

    You will note that I have asked the first Linux sitting in the MBR to be booted by itself and that is "ALWAYS" by the Direct methods. All subsequent Linux can be booted by Indect method.

    Don't mixed the two methods together in booting one Linux.

    It is possible to boot every Linux by the Direct method which is a traditionally favoured approach. Indirect method is simpler and easier and it is the only single method that we can use universally for non-linux systems like Dos, Windows, BSD....
     
  16. Bartender

    Bartender Thread Starter

    Joined:
    Apr 27, 2006
    Messages:
    197
    I'm back to just Ubuntu on the 120GB. PCLOS was there, but I couldn't figure out how to get to it. For a second or third Linux OS, is it difficult to go back and place GRUB in the root partition if it wasn't placed there originally?
    Also, while scrounging around for ways to stand on other people's shoulders I came upon GAG and BUM, a couple of programs that are supposed to hold your hand while doing this sort of thing. Any reports on their effectiveness?
    How do I call up 'cfdisk' from the Live CD?
     
  17. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/508186