<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>centriment &#187; kernel</title>
	<atom:link href="http://www.centriment.com/tag/kernel/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.centriment.com</link>
	<description>stories of the spirit living inside the computer</description>
	<lastBuildDate>Sun, 26 Jul 2009 12:29:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Raising Elephants Is So Utterly Boring!!!</title>
		<link>http://www.centriment.com/2009/03/20/raising-elephants-is-so-utterly-boring/</link>
		<comments>http://www.centriment.com/2009/03/20/raising-elephants-is-so-utterly-boring/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 22:28:01 +0000</pubDate>
		<dc:creator>Jan Dzik</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[features]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[os]]></category>

		<guid isPermaLink="false">http://www.centriment.com/?p=84</guid>
		<description><![CDATA[What do elephants have to with me? Ehmmm, nothing! This post is not about elephants, of course, but about a not so well known feature of the Linux kernel which has to do with safe system termination or reboot.
Suppose you do something silly, like load an unstable kernel driver, or you use unstable versions of [...]]]></description>
			<content:encoded><![CDATA[<p>What do elephants have to with me? Ehmmm, nothing! This post is not about elephants, of course, but about a not so well known feature of the Linux kernel which has to do with safe system termination or reboot.</p>
<div id="attachment_97" class="wp-caption alignleft" style="width: 220px"><img class="size-medium wp-image-97" title="elephant-clipart" src="http://www.centriment.com/wp-content/uploads/2009/03/clipart-cartoon-design-01-300x300.gif" alt="Raising Elelephants Is So Utterly Boring" width="210" height="210" /><p class="wp-caption-text">Raising Elelephants Is So Utterly Boring</p></div>
<p>Suppose you do something silly, like load an unstable kernel driver, or you use unstable versions of some applications or simply you stumble upon a weird bug, and suddenly your system appears to have hanged. Hmmm&#8230; what to do? If you were in a Windows environment, you would probably hit the notorious <em>Ctrl+Alt+Delete</em> key combo to get the task manager appear on screen. Then, you would either kill the process that&#8217;s causing all the fuss or you would hit reboot or shutdown to safely switch your system off without risking data corruption. I&#8217;m sure that everyone who uses windows has been in a situation where simply hitting <em>Ctrl+Alt+Delete</em> did not work, the task manager was nowhere and they were forced to hit the &#8220;evil&#8221; reset button in dreadful fear and guilt of doing something that could render precious data corrupted.</p>
<p>Unfortunately,  you cannot do anything else in that sort of situation. That is, if you are a <em>windows</em> user&#8230;</p>
<p>Linux users can feel a lot safer than their friends, the windows users, for their daily chores, because there is more to Linux than hitting a <em>Ctrl+Alt+Del</em> combo each time something becomes unresponsive. Healing a system that appears to be hanged is a series of actions, each action to be taken if the previous fails. Now, here&#8217;s what to do in such a case:</p>
<ol>
<li>If you are in a desktop session, running GNOME, KDE or any other window manager, press <em>Ctrl+Alt+F1 or F2 or F3&#8230; or F6</em>. In Linux user sessions run in virtual terminals. Virtual terminals 7 and above are reserved for graphical sessions running on X, and terminals 1 to 6 are for console sessions. A user can switch any time between any virtual terminal by hitting the<em> Ctrl+Alt+F#</em> key combo, where # is the number of the virtual terminal. So, hitting<em> Ctrl+Alt+F1</em> for example will switch to console mode and a login prompt will appear. Login, and use the standard shell tools, like <em>top</em> and <em>ps</em> to determine what process is causing the problem and kill it with the <em>kill</em> utility. Then logout and press<em> Ctrl+Alt+F7</em> to get back to you desktop session.</li>
<li>If the system refuses to switch to another VT (virtual terminal) try to kill the X session by hitting the <em>Ctrl+Alt+Backspace</em> key combination. This will effectively kill every graphical application and restart the X Server. In the end you should be brought back to the login screen.</li>
<li>If step 2 fails, then try pressing <em>Ctrl+Alt+Delete</em>. The system will beep and initiate the reboot sequence.</li>
<li>If you don&#8217;t hear a beep, or if you do hear it but the computer is not rebooting after some time, hit the <em>Ctrl+Alt+Delete</em> combo once more. <strong>CAUTION!</strong> This will do an <strong>unsafe</strong> reboot. If the system has not unmounted the filesystems in use <strong>skip to the next step</strong>.</li>
<li>Something went extremely, horribly wrong. 99% of the time step 1 should suffice. However, even if all of the above fail to give a result, don&#8217;t worry. <strong>DO NOT</strong> in any case hit the reset or power off button. The kernel has a small communications channel open at all times. Even if everything goes wrong you will be able to use this channel to send commands to the kernel.  These commands are sent by holding <em>Ctrl+Atl+PrintScrn/SysRq</em> and pressing a letter designating the command. What you need to do is to remember that <strong>Raising Elephents Is So Utterly Boring</strong>. The first letters of each word is the sequence of commands you must issue to trigger a safe reboot.  In other words, if everything else fails hold down <em><strong>Ctrl+Alt+PrintScrn/SysRq</strong></em> and press <em><strong>R E I S U B</strong></em> by waiting a few seconds between each key-press to allow the kernel to finish executing each command. <em>R E I S U B</em> is easily remembered through the mnemonic;<em> Raising Elephants Is So Utterly Boring</em>. Or, you can think <em>BUSIER</em> spelled backwards. I prefer the elephants though <img src='http://www.centriment.com/wp-content/plugins/tango-smileys-extended/tango/smile.png' alt='Smile' class='tse-smiley' />.</li>
</ol>
<p>The sequence of the commands executed are:</p>
<p><strong>Ctrl+Atl+PrintScrn/SysRq + R:</strong> Get control of the keyboard device.<br />
<strong>Ctrl+Atl+PrintScrn/SysRq + E: </strong> Send the SIGTERM signal to all processes except init (PID 1).<br />
<strong>Ctrl+Atl+PrintScrn/SysRq + I: </strong> Send the SIGKILL signal to all processes except init.<br />
<strong>Ctrl+Atl+PrintScrn/SysRq + S:</strong> Sync all mounted filesystems. This will flush any unwritten data to your devices and thus prevent data loss or corruption.<br />
<strong>Ctrl+Atl+PrintScrn/SysRq + U:</strong> Remount all mounted filesystems in read-only mode.<br />
<strong>Ctrl+Atl+PrintScrn/SysRq + B:</strong> Immediate system reboot.  The previous commands must be executed before this one to do a safe reboot.</p>
<p>There are also other commands you may send, but these are the ones needed to reboot in a system hang.</p>
<p>More info on these magic commands can be found <a title="The Magic SysRq key in Linux." href="http://en.wikipedia.org/wiki/Magic_SysRq_key" target="_blank">here</a>.</p>
<p>So, if you ever get into a tough spot when using your tux machine you won&#8217;t have to worry, remember the elephants <img src='http://www.centriment.com/wp-content/plugins/tango-smileys-extended/tango/grin.png' alt='Grin' class='tse-smiley' />.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.centriment.com/2009/03/20/raising-elephants-is-so-utterly-boring/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
