Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question
    
Can you share your syslinux.cfg file please? –  slm Aug 2 '13 at 18:12
add comment

3 Answers

Assuming you have GRUB's files in /boot/grub, on the same partition as syslinux, you can chainload the first GRUB image, named boot.img, like this:

LABEL GRUB
  MENU LABEL Grub2 chainload
  COM32 CHAIN.C32
  APPEND file=/boot/grub/boot.img
share|improve this answer
add comment

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
share|improve this answer
add comment

There are several ways to do this. Unlike chainloading windows which does not have public source code for the bootloader, grub is available in a number of formats and it is not to difficult to add more. CostinStroie's approach uses variation of loading a boot sector and works fine assuming you have grub installed, have traditional bios and are not network booting. You can also use other grub images. I had at one time a grub legacy image that had a linux image header on it that could be loaded with syslinux's kernel keyword. You can (although I don't know of anyone that has) compile grub as a c32 image which is syslinux specific. other interesting ones include loading a pxe grub image from pxelinux, loading a grub floppy image with memdisk.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.