Linux.com

Home Learn Linux Linux Answers Systems Management What is "chainloading," and how do it do it?
Answers
  • Chainloading is not generally necessary for multi-booting linux distros. It is usually used for loading non-linux OS's using the linux bootloader ie. Windows.

    That being said, if you want to dual-boot or multi-boot linux distros you first need to know a bit about which bootloader you have installed as methods vary somewhat between bootloaders. Could be Grub-legacy, Grub2 or lilo. Not sure which one Ubuntu uses as I don't use Ubuntu.

    If you are real new to linux, I'd recommend using your package manager to find out which one you have installed then use your favorite search engine to find info on multi-booting with that bootloader. You could also read the man pages for your bootloader- open a terminal and type in 'man '.
    Example: man grub

    You could start by checking out tutorials on this site:
    https://www.linux.com/community/blogs/133-general-linux/10724
    https://www.linux.com/community/blogs/133-general-linux/435315
    https://www.linux.com/community/blogs/133-general-linux/32736

    Sorry couldn't be more helpful but step by step process depends on a few factors including but not limited to which bootloader you have installed and partition layout. Plus you'll likely learn it better if you do a little research on your own.

    Answered by harv42
    3 years ago
    0 0
  • Chainloading is when a boot loader loads another boot loader to begin the boot process. When using GRUB with a Linux distro and Windows dual boot, for example, with GRUB being installed on the Master Boot Record it must load the Windows Boot Loader to boot Windows.

    Boot to Grub
    |
    |---Boot Linux
    |
    |---Chainload Windows Boot Loader
    |
    |--Windows Boot Loader
    |
    |--- Boot Windows

    Now, if you have a Linux only system, GRUB can boot each of them directly without chainloading just by modifying the main distribution's grub configuration (installs typically take care of that automatically) and reapplying it. However, you can, if you so choose, elect to install GRUB in the root partition of each new install. In that case you would have to chainload from your MBR install of GRUB to the GRUB located on a specific root partition.

    Answered by jasonehoss
    3 years ago
    0 0
  • I forgot to answer part of your question.
    Chainloading is calling one bootloader from another one.
    An example would be calling the Windows bootloader from the linux bootloader in order to boot to Windows.

    This is not necessary when booting multiple linux distros since both Grub and lilo can be configured to boot any number of linux distros. This is known as a dual-boot or multi-boot configuration.

    Incidently, many- though not all- modern linux distros include scripts that look for other OS's and add them to the boot menu during install so that you don't need to do anything and your previously installed OS's will show up in your boot menu. A lot depends on your current harddrive/partition configuration, installed bootloaders and their configuration as to how well those scripts may work.

    Answered by harv42
    3 years ago
    0 0
  • Chainloading simple allows your bootloader (usually grub) to boot a second bootloader. In Linux, it's commonly used to use grub to dual boot a Windows install with a grub-1 entry like this (would load Windows from the second partition of the first hard disk device):

    title Doze
    rootnoverify (hd0,1)
    makeactive
    chainloader +1

    Chainloading can also load a second instance of grub. This is useful for times when you run a second Linux install and then choose to have the installation install it's bootloader to the partition of the install rather than to the disk's MBR. Remember, the MBR can only have one bootloader installed to it at at time, so second or third OS instances shouldn't over-write the MBR. If this is what you are wanting, then a grub-1 entry for chainloading Linux would look similar to above, with the exception of the not-required makeactive line:

    title Some other Linux
    root (hd0,1)
    chainloader +1

    That will simply bring up the bootloader installed from the second Linux install you did, assuming it is on sda2. Alternatively, you could select to use no bootloader during the second Linux install and simply use your first grub instance to load your second distribution by adding an entry in your menu.lst/grub.conf.

    Either way, the important thing to remember is when using multiple operating systems on one system, do not clobber the MBR entry with each install and do make sure that whatever bootloader you have on the MBR is capable of either chainloading additional bootloaders or can be configured to boot your additional operating systems directly.

    Answered by tdr
    3 years ago
    0 0
Please register/login to answer this question. Click here to login
Similar Questions Found
Questions from category Systems Management

Upcoming Linux Foundation Courses

  1. LFS230 Linux Network Management
    06 Oct » 09 Oct - Virtual
    Details
  2. LFD331 Developing Linux Device Drivers
    13 Oct » 17 Oct - Virtual
    Details
  3. LFS430 Linux Enterprise Automation
    13 Oct » 16 Oct - Virtual
    Details

View All Upcoming Courses

Community Answers - Search


Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board