Menu

General workflow for setting up multiple instances if linux "for everyone"

awado
2012-09-05
2012-09-12
  • awado

    awado - 2012-09-05

    Hello world!

    rEFInd is just what I was looking for - a great piece of software. A lot of people - including me - are searching for a simple multi boot setup. So I'm trying to create a workflow "for everyone" without struggling with grub or elilo. But I'm stuck with some basic issues. I'm trying to get several linux distros into my MacPro by creating a stanza for each partition, so I can just choose the icon of the system I want to boot in.

    Here's what I did so far:

    1. Use Disk Utility to create a GUID drive.
    2. Use gparted on a live CD to create a swap and several EXT3 partitions.
    3. Installed linux on each of the partitions with no MBR/EFI boot loader and no separate boot partition. That means the boot folders on the "/" mount point contain its kernel(s) and IMG files.
    4. Created a stanza in refind.conf:

    menuentry "CentOS" {
    Volume CentOS
    loader \boot\vmlinuz-....x86_64
    initrd \boot\initramfs-....x86_64.img
    options "root=/dev/sda6 ro"
    }

    But when I boot rEFInd says: "Starting vmlinuz-...x86_64 / Error: Not Found while loading vmlinuz-...x86_64 / Hit any Key". Where's the culprit?

    TIA

     
  • Roderick W. Smith

    rEFInd can only access files, including boot loaders and Linux kernels, that the EFI itself can read. In a normal Linux installation, the kernel exists on a Linux filesystem that the EFI can't read. Thus, if you want to use the Linux kernel with EFI stub loader as a boot loader, you must render that kernel readable by the EFI. You can do this by storing the kernel (and its initrd) on a FAT partition or by loading an EFI driver for the Linux filesystem you're using. (EFI drivers for ext2fs/ext3fs and ReiserFS are available, but not for any other Linux filesystem, AFAIK.) The rEFInd documentation includes information on both of these approaches. See in particular the "Using EFI Drivers" and "Options for Booting Linux" sections.

    Note also that the EFI, and therefore rEFInd, can only boot a Linux kernel if it includes the EFI stub loader code. This code was added with the 3.3.0 kernel, and some distributions use older kernels than this. Thus, if you're using one of these distributions, you'll need to either upgrade your kernel or use another boot loader, such as ELILO or GRUB.

     
  • awado

    awado - 2012-09-06

    Hi Rod!

    Thanks for pointing me to the right direction. It gets more complex the more I dig in, it seems. Let's say we create FAT partitions with grub1 files for chain loading from rEFInd, one for every distro. Will rEFInd see them all and will grub1 be able to load all kernels?

     
  • Roderick W. Smith

    Yes, rEFInd should detect all of those partitions; however, creating one partition per installation just for the boot loader is overkill. That's the purpose of the ESP, and as many OSes as you like can share a single ESP. Each OS creates its own subdirectory (such as EFI/redhat for Red Hat or EFI/ubuntu for Ubuntu) in which it places its own boot loader. Alternatively, for multiple Linux distributions you can install just one boot loader to handle them all (say, EFI/elilo for an ELILO installation) and manage it manually.

    GRUB Legacy (aka GRUB 1) is not officially EFI-enabled; however, Fedora has a version that is EFI-enabled, and it should load any Linux kernel (provided you're running on a supported architecture). See my page on EFI boot loaders for details.

     
  • awado

    awado - 2012-09-11

    Yes, that's true. Fedora works out of the box. But I'm trying to find a way suitable for every distribution and - that would be perfect - with config files on an HFS partition, that can be managed from OS X. To me it seems that EFI grub is not. You have to install it from the linux side.

     
  • Roderick W. Smith

    For "out of the box" configuration, using the boot loaders provided by your distributions is theoretically the easiest way to go. The boot loaders go on the ESP, as described earlier. There's nothing to preclude your managing a Linux boot loader whose configuration file resides on the ESP from OS X; you must just mount the ESP from OS X using "mount" or "mount_msdos". Alternatively, you could create an HFS+ partition to hold the Linux boot loaders, but that will require some mucking about in Linux to get it to work correctly.

    One method I've experimented with is to make separate HFS+ /boot partitions for Linux. This is weird, and Linux installers tend to refuse to accept this; but if you convert a separate /boot partition after the fact, they work fine with it. Creating the filesystem without a journal makes it easier for Linux to write to it. Overall, though, I don't see much advantage to this. Putting GRUB or ELILO on the ESP works fine, and it's the way the EFI spec says it should be done.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.