Triple booting Linux distros with a mix of GRUB2 and GRUB legacy, Part 2

Home / Linux / Triple booting Linux distros with a mix of GRUB2 and GRUB legacy, Part 2

Triple booting Linux distros with a mix of GRUB2 and GRUB legacy, Part 2

Instructions on how to multi-boot with a mix of legacy and 2.

DISCLAIMER: this method erases your entire hard drive and repartitions it. If you are uncomfortable mucking about with partition tables, go look at some beginner resources and tutorials on fdisk, gparted, and disk partitioning in general. This is not a method or tutorial intended for n00bs; there are some advanced concepts here. Be prepared to start from the beginning a few times if you mess up; since you’re wiping and repartitioning from the start, you won’t have lost anything but time. I restarted this a couple of times before I got it right.

THEN I wrote it down so I could look all smart and stuff.

DID YOU BACK UP AND REMOVE ALL DATA FROM THIS DRIVE? If so, proceed.
_______________________________________________________

    (1) Determine in advance which distros use legacy and 2.

    (2) Pick the legacy distro which has the easiest, most
    attractive boot screen. In my case, it was openSUSE.

    (3) Get ready to use that one first.

    (4) Use an Ubuntu LiveCD (even if you’re not planning on installing this distro, since the Ubuntu LiveCD is the most intuitive and useful) to boot from CD. Do not install anything at this time.

    (5) Using your favorite disk partitioning tool (gdisk, fdisk, gparted, etc), partition your hard drive into: (1) a teeny boot partition; (2) swap area; (3) root partitions for each of your distros that are at least 10GB in size; (4) home partitions for each of your distros that are at least 10GB in size; (5) a mega big data partition.

    (5a) To install and use gdisk from the Ubuntu LiveCD, open a browser, go here: http://sourceforge.net/projects/gptfdisk/files/gptfdisk/0.6.10/gdisk_0.6.10-1_i386.deb/download, download it to any folder (the default will be /Desktop), open a terminal shell, navigate to that folder, and use this command: sudo dpkg -i gdisk_0.6.10-1_i386.deb.

    (5b)
    Instructions on using gdisk (with thanks to srs5694 from the Ubuntu Forums) if necessary:

    (5c) Boot an Ubuntu installer or an emergency disc, like Parted Magic or System Rescue CD. If using an Ubuntu installer, boot it into a recovery mode so that you can get a shell rather than booting straight into the installer.

    (5d) Launch a text-mode shell. If you’re using an Ubuntu installer, type “sudo apt-get install gdisk” to obtain and install GPT fdisk (gdisk). If this doesn’t work, use the method I described above to get gdisk.

    (5e) Type “sudo gdisk /dev/sda” (you can omit “sudo” on some emergency disks).

    (5f) Type “o” and answer “y” to the verification prompt to create a fresh partition table. Note that this will wipe out all your existing partitions.

    (5g) Type “n” to create a new partition. Give values of: partition #1, start sector 2048, end sector +1M, hex code of EF02. This creates the BIOS Boot Partition.

    (5h) Type “n” to create another new
    partition. Give values of: partition #2, hit enter for the default start sector, end sector +20G (or however big you want the Ubuntu main installation to be, minus space for your user files), hex code of 0700 (the default). This creates what will be the Linux root (/) partition.

    (5i) Type “n” to create another new partition. Give values of: partition #3, hit enter for the default start sector, end sector +2G (or however big you want to make your swap space), hex code of 8200. This creates a Linux swap partition.

    (5j) Type “n” to create another new partition. Give values of: partition #4, hit enter for the default start sector, hit enter for the default end sector (to use the whole disk), hex code 0700 (the default). This creates what will be the Linux /home partition. If you want other partitions, you should set some other end value and create additional partitions at this point.

    (5k) Type “p” to review your partition table. It should have an EF02 BIOS Boot Partition, two
    Linux/Windows data partitions, and a Linux swap partition. If it doesn’t, correct the problems or quit by typing “q” and start again.

    (5l) Type “w” to save the partition table.

    (5m) If necessary, reboot into the Ubuntu installer; or just launch the installation process. When you get to the disk partitioning section, tell the system to do custom partitioning, but do not start from scratch. Instead, tell it to use /dev/sda2 as root (/), /dev/sda3 as swap, and /dev/sda4 as /home. (Adjust these partition IDs as necessary, if you deviated from the numbers I specified earlier.) The installer will create new filesystems or swap space on these partitions. You should not tell the installer to do anything with /dev/sda1; when the system installs GRUB, the GRUB installer should use /dev/sda1 automatically.

    (6) Now, install your chosen legacy distro to the first root partition you want, with its data at its own home. Mount the big data partition as /data or whatever you want. Do not mount
    the other partitions; those are for your other distros.

    (6a) When installing the bootloader, specify that it’s to be installed to the hard disk. Grub legacy will find the mini partition and do its thing.

    (7) Check to find out if the BIOS partition has its boot flag flying.

    (7a) Boot a live disk of some kind; Ubuntu LiveCD works.

    (7b) Launch a shell.

    (7c) Type “sudo fdisk /dev/sda”.

    (7d) Type “p” to view the MBR partition table. It should show one partition, with “ee” in the “Id” column. This is normal, even though you created several GPT partitions. Is there a ” * ” under the Boot column? If not, proceed with steps 7e-7h.

    (7e) Type “a” and enter “1” (or whatever the partition number is) when prompted.

    (7f) Type “p” again. You should now see an “*” under the “Boot” column.

    (7g) Type “w” to save the changes.

    (7h) Remove the emergency CD and reboot. You should not need to re-install.

    (8) Install the other
    distros to their own root partitions; the legacy ones first. You may need to reflag the BIOS boot partition after each install; you DEFINITELY need to specify that each distro’s bootloader is to be installed to its own root partition. IF YOU DO NOT DO THIS, YOU MAY OVERWRITE THE BIOS BOOT PARTITION AND NEED TO START FROM THE BEGINNING.

    (9) Install any Grub 2 distros, also specifying the bootloader installation to their own root partitions.

    (10) Run sudo update-grub from your first distro. After booting, check to make sure that you have boot options for each of your other distros. If not, you may need to add chainloading boot entries.

    (10a) For further discussion on chainloading (dead simple and requires minimal editing of your /boot/grub/menu.lst file), see here: http://www.linuxquestions.org/linux/answers/Applications_GUI_Multimedia/Chainloading_in_Linux

After each install, I checked, updated grub, added the relevant entries, reflagged the boot partition,
and by the time I was done, I was triple booting.

Any questions?

4 Comments

  • Ken September 30, 2010

    Hiya Tarah

    As I noted in a post elsewhere, when I tried using fdisk /dev/sda1 I an error that fdisk doesn't support GPT.

    gdisk is supposed to extend what fdisk does, but 'a' – is not an option in gdisk on SystemRescueCD (latest)

    I don't really need to multi-boot, I just need to get Ubu booting on a 2TB disk.

    regards
    Ken

  • Tarah September 30, 2010

    Then use Ubuntu LiveCD. It gives you all the support of a full distro, provides you with the option to install apps to assist you, and works best with the instructions for gdisk. Simply open a terminal shell after booting from CD; you have all the access you need, a browser if you need to look stuff up—it's the best method I've ever found for repair issues.

  • Ken September 30, 2010

    Hiya Tarah

    been there, done that, thanks anyhoo.

    regards
    Ken

  • Pingback:Tweets that mention Triple booting Linux distros with a mix of GRUB2 and GRUB legacy, Part 2 « The Cowgirl Coder -- Topsy.com

LEAVE A COMMENT