Linux – How to chainload GRUB from syslinux

boot-loadergrub2linuxsyslinux

Due to the current state of my setup, I want to make Syslinux which is my main bootloader to chainload GRUB2. Google brings up plenty of info on how to chainload Syslinux from GRUB2, but nothing really useful for the reversed scenario, which is what I'm looking for.

Best Answer

I've never tried this myself but I found these details on the ArchLinux wiki. In a article aptly titled: Syslinux. There's a section titled: Chainloading other Linux systems.

excerpt

Chainloading another bootloader such as Windows' is pretty obvious, as there is a definite bootloader to chain to. But with Syslinux, it is only able to load files residing on the same partition as the configuration file. Thus, if you have another version of Linux on a separate partition, without a shared /boot, it becomes necessary to employ Extlinux. Essentially, Extlinux can be installed on the partition superblock and be called as a separate bootloader from the MBR installed by Syslinux. Extlinux is part of the Syslinux project and is included with the syslinux package.

So assuming you have a system with Grub2 like so:

  • /dev/sda3 (/)
  • /dev/sda2 (/boot)

You'd mount them like so:

$ mount /dev/sda3 /mnt
$ mount /dev/sda2 /mnt/boot (only necessary for separate /boot)

Then with extlinux installed you do the following:

$ extlinux -i /mnt/boot/syslinux
$ cp /usr/lib/syslinux/{chain,menu}.c32 /mnt/boot/syslinux

And create this file: /mnt/boot/syslinux/syslinux.cfg:

timeout 10

ui menu.c32

label Other Linux
    linux /boot/vmlinuz-linux
    initrd /boot/initramfs-linux.img
    append root=/dev/sda3 ro quiet


label MAIN
    com32 chain.c32
    append hd0 0
Related Question