Skip to content

Instantly share code, notes, and snippets.

@naftulikay
Created October 2, 2016 20:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save naftulikay/757d97423f637a7ff6a1490d04b64fcb to your computer and use it in GitHub Desktop.
Save naftulikay/757d97423f637a7ff6a1490d04b64fcb to your computer and use it in GitHub Desktop.
Reboot a machine using kexec.
# tell kexec that when we reboot, we want the given kernel image and the given
# initramfs, and that we want to use the exact same kernel command line as was
# used to boot previously
kexec \
-l /boot/vmlinuz-4.7.5-200.fc24.x86_64 \
--initrd /boot/initramfs-4.7.5-200.fc24.x86_64.img \
--reuse-cmdline
# the above doesn't actually do the reboot, so we need to tell kexec to start
# rippin' via systemd
systemctl kexec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment