HOWTO: Fix Linux hang/freeze during reboots and restarts
Purpose: There are some machines on which Linux will freeze, after a restart or a shutdown command is issued, right at the very end of the process forcing you to do a hard reset – press the reset/power button the system or plug the cord which is not good.In this post we will see how you can resolve almost 99% of freeze/hang that occurs during shutdown or reboot.
Why this happens
There are many reasons why this happens – some times it is an BIOS issue or sometimes it’s just that your system has a different kind of hardware setup, for example no keyboard controller, and Linux (the kernel) does not understand how to tackle that situation. Most of the time if it is a BIOS issue it is not very easy to ask your system vendor to give you an immediate BIOS fix that will take care of the issue and hence you have to rely on some kernel parameters that you need to pass to fix the hang/freeze issue.
Let’s say you bought a new machine and you notice that your Linux distribution hangs at the very end of the reboot/shutdown process, upon giving any of the following commands:
# shutdown -r now
# shutdown -h now
# reboot
# halt
# poweroff
# Ctrl+Alt+Del
Solution
In order to fix the issue, you should try one-by-one passing the following parameter to the kernel, in the form of “reboot=<parameter>”, at the time of boot:
warm = Don’t set the cold reboot flag
cold = Set the cold reboot flag
bios = Reboot by jumping through the BIOS (only for X86_32)
smp = Reboot by executing reset on BSP or other CPU (only for X86_32)
triple = Force a triple fault (init)
kbd = Use the keyboard controller. cold reset (default)
acpi = Use the RESET_REG in the FADT
efi = Use efi reset_system runtime service
pci = Use the so-called “PCI reset register”, CF9
force = Avoid anything that could hang.
As per my experience, one of the parameters (in blue color above) should be able to resolve your hang (or freeze) issue 90% of the time:
reboot=bios
or
reboot=acpi
Once your system boots you can verify whether the parameter was correctly passed or not by issuing the following command:
# cat /proc/cmdline
Output:
root=/dev/sda ro vga=791 quiet reboot=bios
You can find the list of all the above parameters in the reboot.c file in the Linux kernel source.
By default, the Linux kernel uses the reboot=kbd method i.e. it tries to look for a keyboard controller and issue a reset/shutdown command to it. But there are some systems like some of the Intel Atom processor based machines that don’t have a keyboard controller and the above fixes are required. If you read the reboot.c file carefully there are some major main stream machines from Dell, Sony, HP, etc. that require the above “reboot=” fix. I guess sometime it is easier to fix the issue by using the kernel parameter rather than fixing in the BIOS.
Also you can also use the first letter (as denoted in the “[]” brackets) of each of the parameter:
reboot=b # for reboot=[b]ios
reboot= a # for reboot=[a]cpi
and you can pass multiple parameter at the same time and Linux kernel will try in order specified:
reboot=a,b,k,c # for reboot=acpi,bios,kbd,cold
Happy Reboot=’ing!


Email Subscription









August 5th, 2009 at 3:57 pm
thx to tip was new for me
Regards
Reply to this comment
September 23rd, 2010 at 10:14 pm
[...] [ A ] Read this : http://linux.koolsolutions.com/2009/08/04/howto-fix-linux-hangfreeze-during-reboots-and-restarts/ [...]
November 14th, 2010 at 6:16 am
Where and how do I issue this command reboot=…?
Doing reboot=asdf in Slackware 12 does not do anything, no response, just gets me directly back to the prompt.
Doing reboot just reboots the system with a hang at the end…
Reply to this comment
December 9th, 2010 at 9:48 am
Excellent article! The reboot=bios option worked for me! My work’s Dell Precision 490 would always hang during restart or halt (Debian 5). After modifying grub’s menu.lst file with reboot=bios this issue went away!
Reply to this comment
May 5th, 2011 at 3:16 am
thank you, very much.
option reboot=bios helped to resolve reboot issue with atom d525
Reply to this comment
May 20th, 2011 at 11:54 pm
[...] Resolve Linux freeze or hang issues during reboot, restart, shutdown | Debian Ubuntu Linux Solutions… – May 20th ( tags: linux reboot boot tips tricks hang freeze ) May 21st, 2011, @ 2:01 am | Tags: links | Category: delicious links | Comments are closed | Trackback this Post | 0 views [...]
May 26th, 2011 at 4:18 am
Great fix thanks,
Had issues with Dell latitude E6420 had to add reboot=pci to fix the issue
Reply to this comment
June 1st, 2011 at 1:59 am
[...] to get rid of this advertisement]'); Ok, I think I've solved it now (so far no hangs) using this: http://linux.koolsolutions.com/2009/…-and-restarts/ So I added 'reboot=force', and so far there have been no hangs. The other options don't [...]
June 16th, 2011 at 5:53 pm
Thank you for the great post! I also had issues with my Dell latitude E6420 (hanging during reboot). Adding ‘reboot=pci’ solved the problem.
Reply to this comment
July 15th, 2011 at 4:24 pm
[...] (fuente: linux.koolsolutions.com) This entry was posted on jul 15th, 2011 at 23:22 and is filed under Sin categoría.You can follow any responses to this entry through the RSS 2.0. You can Leave a response, or Trackback. [...]
July 24th, 2011 at 1:11 pm
[...] – to fix the hang-on-reboot issue that I’ve noticed I followed this and added “reboot=pci” as noted to /etc/default/grub (and then ran ‘sudo [...]
August 10th, 2011 at 9:10 am
In the ariticle, it says :bios = Reboot by jumping through the BIOS (only for X86_32)
It is a linux ubuntu system only:
Q1: How can i find out if I have X86_32
Q2: How to use the info in this article? What exactly do you enter in the terminal ? What to look out for?
Reply to this comment
August 15th, 2011 at 8:10 am
Thanks to you I solved the problem with my Atom based home server. To make it easier for other people you might add how to modify kernel parameters.
Reply to this comment
September 6th, 2011 at 10:21 pm
Thank you for this article! You saved my (Latitude E6520′s) life! :-)
Reply to this comment
September 8th, 2011 at 1:11 am
I beg your pardon! It was a mistake. :-(
Before trying these, I’ve switched off the VT-d support in the BIOS. After switching it back, the reboot hangs again. None of the reboot arguments can help me.
I’ve tried them one by one, and all together. Command poweroff works correctly, reboot freezes. I’m not too happy.
Reply to this comment
September 22nd, 2011 at 5:56 am
On HP acpi helped!
Reply to this comment
October 25th, 2011 at 6:35 am
Took me two days, but this how you do it in Ubuntu 10.04 (uses grub2):
Run in terminal> gksudo gedit /etc/default/grub
edit this line and save> GRUB_CMDLINE_LINUX=”reboot=bios”
Run in terminal> sudo update-grub
Setting takes effect next time os starts.
Reply to this comment
November 6th, 2011 at 2:55 pm
Thx for that fix. reboot=efi works on an acer aspire one d257.
Reply to this comment
January 9th, 2012 at 6:13 am
Thank you! I was getting a black screen when rebooting Ubuntu 11.10 on an Acer Aspire One Happy 2 netbook. I fixed it this way:
$ sudo nano /etc/default/grub
changed GRUB_CMDLINE_LINUX=”” to GRUB_CMDLINE_LINUX=”reboot=acpi”
Ctrl-O to save then Ctrl-X to exit
$ sudo update-grub
Reply to this comment
January 24th, 2012 at 2:04 am
Thank you! Using reboot=bios solved my problem with Ubuntu 11.04 and Ubuntu 11.10 unable to reboot an old computer with Foxconn 661FX-ME motherboard (SiS 661FX chipset).
Reply to this comment
March 11th, 2012 at 9:07 am
Thank you. reboot=pci fixed my Dell Precision M4600
Reply to this comment
April 18th, 2012 at 3:39 am
Thank you!
For Grub Users this might be helpful:
In Grub you need to edit /etc/default/grub and change GRUB_CMDLINE_LINUX=”" to GRUB_CMDLINE_LINUX=”reboot=bios” or whatever value. Afterwards you do update-grup.
Reply to this comment
April 28th, 2012 at 7:10 pm
@luni : I think that reboot=efi would correspond more to your hardware.
Reply to this comment
September 10th, 2012 at 10:24 am
worked for me
reboot=bios
fedora 16
3.1.7-1.fc16.i686.PAE
acer aspire one d610
Reply to this comment
November 19th, 2012 at 2:17 pm
[...] [Quelle: linux.koolsolutions.com] [...]
January 16th, 2013 at 11:33 am
Thank you, I’ve been trying to figure out my reeboot issues for a while. reboot=bios fixed it first try
Reply to this comment