Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Is it possible to do a reboot, without actually rebooting? I have Ksplice, haven't had the chance to use it yet, but need something different. My desktop only will boot into the HD if I enter the bios during boot and tell it to boot from USB then it will boot to the HD, very odd and I have checked my BIOS and set it to default settings in case I may have changed something, but that did not solve it. So basically I do not want to do an actual shutdown/reboot. I added my Brother MFC-295CN and changed the script needed to scan but now I need to reboot to make it work. This is non kernel related so Ksplice will not do. Is there any other way? Would restarting lighdm do the trick? Is it possible?

Thank you for your time and answers

share|improve this question
    
Try playing around with kexec –  Another Googler Oct 29 '12 at 22:05
    
Care to elaborate on kexec? –  Dustin Oct 29 '12 at 22:06
    

1 Answer 1

up vote 2 down vote accepted

First, install the kexec tools using:

sudo apt-get install kexec-tools

Now, to reboot using kexec one needs to determine the version of the kernel you want to kexec into and also the the boot device and initrd you want to use.

For example, to find the current kernel you are running, use:

uname -r

and a quick and dirty way to find the boot device is to look for the root device in /boot/grub/grub.cfg, e.g:

grep "set=root" /boot/grub/grub.cfg

and look for the UUID of the boot device.

So, for my machine, my kernel is 3.5.0-17-generic, and my UUID is 69822458-67e5-437a-84ab-0c9e5c139d43, so I can load this kernel and initrd images into memory using:

sudo kexec -l /boot/vmlinuz-3.5.0-17-generic --append=" linux /boot/vmlinuz-3.5.0-17-generic root=UUID=69822458-67e5-437a-84ab-0c9e5c139d43 ro quiet" --initrd=/boot/initrd.img-3.5.0-17-generic

and then boot the kernel using:

kexec -e

One can kexec into a different kernel version; you don't need to use the one you are running.

share|improve this answer
    
awesome looks great I will try this soon as I can, thanks. –  Dustin Oct 30 '12 at 20:28

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.