Holding down the power button when the systems freezes
Sam Varshavchik
mrsam at courier-mta.com
Tue Jan 29 01:31:38 UTC 2013
Paul Smith writes:
> Dear All,
>
> When the systems freezes, is it safe to hold down the power button to
> power off the machine? If not, what alternatives do you suggest?
>
> Thanks in advance,
There are two consequences to a hard poweroff, like that:
1) The hard drive does an emergency park of the R/W head. That does incur
some cost, in terms of wear and tear.
2) The filesystem state is inconsistent. That does not usually result in any
damage. The filesystem should get automatically re-fscked on the next
reboot. Still, after a forced poweroff, it is a good idea to "touch
/forcefsck" and reboot one more time, to force a full fsck on all
filesystems (which will take some time to complete).
As far as recovering, there are basically two things that can be tried,
before giving up and yanking the power.
A) Sometimes only X, or the UI is frozen, but the kernel continues to crawl,
to some extent, underneath. If you were connected to a network, you can try
ssh-ing in, and running 'poweroff'. Of course, this assumes that you had ssh
enabled. If you're able to ssh-in and execute 'poweroff', be patient, it may
take 5-10 minutes for a crippled machine to figure out how to kill off
everything, and reboot.
B) Execute:
echo 'kernel.sysrq = 1' >/lib/sysctl.d/99-sysrq.conf
sysctl --system
When the machine freezes, try pressing Alt-SysRq-b to force a reboot, if the
kernel is still alive, somewhere. This will still require a filesystem
repair, but at least it'll save wear/tear on the hard drives.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.fedoraproject.org/pipermail/users/attachments/20130128/3ace3862/attachment-0001.sig>
More information about the users
mailing list