Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to reboot from Linux to another system (a bootable CD for my current need).
I don't want to modifiy the current bootloader, nor to modify BIOS settings.

Some Linux CD can be run from Windows (Windows stops and the Linux is runned from the CD).
How can I do the same thing from Linux ?

share|improve this question
If you don't want to modify anything how is this supposed to work? – Ulrich Dangel Aug 10 '12 at 0:38
What's wrong with... rebooting? – Michael Hampton Aug 10 '12 at 2:31

You might be able to rig something with kexec.

Yes, kexec is intended to boot kernels, but nothing's stopping you from kexec'ing to any binary (a "statically linked" binary that doesn't depend on libraries or an existing running OS and is meant to run under preboot conditions) you want, whether a bootloader or even memtest86 - that page talks about some of the traps you may fall into. E.g., if it's a text mode bootloader, you should switch back to text mode before issuing kexec.

If you're using Debian the kexec-tools or whatever pretty much performs all the normal shutdown steps, including switching back to text mode, before issuing the kexec command.

What kexec won't do is boot a disk or disk image, but you could extract the bootloader from the CD and pass it to kexec. If the boot CD is in the drive I don't see why it wouldn't work but I haven't tried it.

Unpacking an .iso in RAM and getting the .iso's bootloader to run from it without the bootloader being aware of the situation would be technically possible, but extremely difficult. I don't know of any utilities capable of that and don't believe any exist.

share|improve this answer
kexec is designed to load a Linux kernel. I don't believe it's capable of loading anything else. – Michael Hampton Aug 10 '12 at 2:31
You can specify any binary for the payload IIRC. – LawrenceC Aug 10 '12 at 20:45
It will probably try to load any binary you give it, but the kernel will then not set up the library linking that userland programs generally require. I.e. if it wasn't written as a kernel, with its own implementation of things such as malloc and printf, it won't work. – Kevin Sep 24 '12 at 2:13
Edits made based on @Kevin's comment. Good point. – LawrenceC Sep 24 '12 at 3:10

You can run grub4dos using kexec:

    kexec -l grub.exe
    kexec -e

Grub4dos is then able to boot from CD:

    cdrom --init
    cdrom --hook
    chainloader (cd0)

Snippets are from the Grub4dos tutorial.

share|improve this answer

Your Answer


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.