Skip navigation.
Home
Write anything I want to write...

GNU_Linux

Rescuing A Hung GNU/Linux System

My GNU/Linux box just hanged. It is actually my own fault as I tried to empty the swap partition (with sudo swapoff -a; sudo swapon -a) without realizing that I don't have enough RAM space! Anyway, if you have a hung X session, what can you do?

Note: I assume that you are using QWERTY keyboard. If not, convert the key sequence as described here [wikipedia.org].

  • Kill the X session. Do this with Ctrl-Alt-Backspace. This should bring you back to the X login window. You can't do this in Ubuntu anymore. If so, kill the processes in the current virtual console as described below.
  • Kill all processes on the current virtual console. Do this with Alt-SysRq-K if you fail to kill the X session as described above. This should bring you back to the X login window.
  • Reboot the system safely. Do this if you fail to reboot the system in the normal ways. To reboot a GNU/Linux system safely, use the following key combinations in sequence:
    1. Alt-SysRq-R. Take the control of the keyboard.
    2. Alt-SysRq-E. Send SIGTERM to all processes.
    3. Alt-SysRq-I. Send SIGKILL to all processes.
    4. Alt-SysRq-S. Sync all mounted filesystems.
    5. Alt-SysRq-U. Remount all filesystems in read-only mode.
    6. Alt-SysRq-B. Reboot!
  • You can memorize this magic sequence with "Reboot Even If System Utterly Broken", or simply "BUSIER" backwards.

  • Press the 'magical' reset button! Frankly speaking, you almost never need to do this with Linux. (Although you may do this very often in some other operating systems.)

Ubuntu Netbook Edition on Asus Eee PC 4G (701)

I have just installed Ubuntu Netbook Edition [www.canonical.com] 10.04 Lucid Lynx on my Eee PC 4G (701) (Hardware specification [wiki.eeeuser.com]). In short, it works perfectly and flawlessly out-of-box!

This is a 2-year-old laptop with a 'slow' 900MHz Intel Celeron processor and a 'small' 4GB SSD. What else besides a good GNU/Linux distro can resurrect it?

Installation

  • Base System. Download the CD Image of Ubuntu Netbook Edition [www.ubuntu.com] and prepare it on a USB stick. Install it.
  • Better web experience.
    • Adobe Flash and Java Applets. From the Ubuntu Software Center, install 'Adobe Flash plugin' and 'Standard Java or Java compatible Runtime' (default-jre).
    • Compact Themes for Firefox. There are several compact themes for firefox [addons.mozilla.org] which are more suitable for devices with small screen. Install one.
  • Complete Chinese support -- More Fonts and Input Methods. Chinese characters can be displayed correctly with the default installation. If you need more fonts and input methods, use System -> Language Support to do it. Support for other languages can be installed similarly.
  • Anti-Virus, Anti-Spyware, Filesystem Defragmentation, System Crash Monitor/Analyzer/Recovery, ... Not required and not available!

I have tested several laptop-specific features and they simply work perfectly out-of-box. E.g., the Wi-Fi, the webcam (use 'Cheese' to test it), and the Fn hotkeys (for controlling Wi-Fi, LCD, volume, etc.).

The PC was pre-installed with Xandros when I just bought it, but I was not used to its interface. I thus replaced the OS with Xubuntu. That time, Xubuntu worked fine but required some customizations to make the Wi-Fi and the Fn hotkeys to work properly. So I'm so glad that the latest Ubuntu Netbook Edition (10.04 Lucid Lynx) just works perfectly on it.

Ubuntu 10.04 Lucid Lynx: My Installation Notes

Things I have done to install my boxes with Ubuntu 10.04.

1. Installation

The installation steps for Ubuntu have been greatly and nicely improved and simplified over the years. Furthermore, its AMD64 version is very reliable and user-friendly too, so use it whenever possible.

  • Base Ubuntu System. Download the Ubuntu CD image and prepare it on a CD or a USB stick. Install it. Check this [www.ubuntu.com] for details.
  • Xfce. Xfce promises very responsive desktop experience. From the Ubuntu Software Center, install 'default Settings for Xubuntu' (xubuntu-default-settings), 'Meta-package for the Xfce Lightweight Desktop Environment' (xfce4), 'enhancements for the Xfce4 Desktop Environment' (xfce4-goodies).
  • Better web experience with Adobe Flash and Java Applets. From the Ubuntu Software Center, install 'Adobe Flash plugin' and 'Standard Java or Java compatible Runtime' (default-jre).
  • Google Chrome Browser. From the Ubuntu Software Center, install 'Chromium Web Browser'. If you hunger for the latest version (probably unstable), you can check this [ubuntuupdates.org] or this [code.google.com].
  • Python. From the Ubuntu Software Center, install 'Python (v3.1)'.
  • Wine for running Windows applications. Follow the instructions here [www.winehq.org].
  • Complete Chinese support -- More Fonts and Input Methods. Chinese characters can be displayed correctly with the default installation. But you may need more fonts and input methods. Use System -> Language Support to do it. Supports for other languages can be installed similarly.
    • Support of Chinese PDF files. From the Ubuntu Software Center, install 'Encoding data for the poppler PDF rendering library' (poppler-data), 'Portable Document Format (PDF) suite -- simplified Chinese language support' (xpdf-chinese-simplified), and 'Portable Document Format (PDF) suite -- traditional Chinese language support' (xpdf-chinese-traditional).
  • VirtualBox. Follow the instructions here [www.virtualbox.org] to add the repository and to install the package.
  • Anti-Virus, Anti-Spyware, Filesystem Defragmentation, System Crash Monitor/Analyzer/Recovery. Don't have them as you don't need them!
    • If you want to protect other platforms from virus infection, use ClamAV.
  • Other useful applications: Medibuntu, VirtualBox, GNU Emacs, Gimp, build-essential, manpages-dev, conky, mc, k3b, geeqie, etc.

Harddisk Failure? -- Part 2

(Part 1 is here if you haven't read it.)

Checked Again

A few hours ago, I connected my 'suspicious' Seagate 500GB harddisk to a motherboard of another computer. I fired up Palimpsest and checked the harddisk again. Oops, I got the same Last self-test FAILED (Read) error again. I repeated the test for a few more times and still got the same error.

I thought I couldn't do much with the harddisk already, so I started to shred [en.wikipedia.org] it. Why shred it? There were no sex videos on my harddisk, but these days you won't know how those weird people will make use of whatever irrelevant data you have in whatever ways beyond your imagination. So I just gave shred a few hours to do her job.

After shred-ing, I checked the harddisk again. I ran a self-test and re-ran both the short and conveyance self-tests for a few more times. Again and again, I got this:

Harddisk Failure? -- Part 1

Computer Hanged

My Linux box hanged yesterday! When a Linux box hangs, you normally blame (1) a memory-leaked program, (2) an I/O-hungry program, or (3) a hardware failure. Checked my Conky monitor, no program was swallowing my memory or I/O bandwidth. Hardware problem? I checked my /var/log/messages, and something really went wrong (I've highlighted those abnormal events):

  Mar 10 15:53:11 peace-desktop kernel: [ 2434.881018] ata3: hard resetting link
  Mar 10 15:53:18 peace-desktop kernel: [ 2442.392316] ata3: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
  Mar 10 15:53:23 peace-desktop kernel: [ 2447.400079] ata3.00: qc timeout (cmd 0xec)
  Mar 10 15:53:23 peace-desktop kernel: [ 2447.400092] ata3.00: failed to IDENTIFY (I/O error, err_mask=0x4)
  Mar 10 15:53:23 peace-desktop kernel: [ 2447.400110] ata3: hard resetting link
  Mar 10 15:53:24 peace-desktop kernel: [ 2447.940060] ata3: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
  Mar 10 15:53:24 peace-desktop kernel: [ 2447.943275] ata3.00: configured for UDMA/33
  Mar 10 15:53:24 peace-desktop kernel: [ 2447.943311] ata3: EH complete

Was it really a harddisk problem? Turned out that it's not that simple yet!

Conky as System Monitor

Last Updated (07-Mar-09): Added the monitoring of CPU fan speed.

I have recently discovered Conky, a very nice light-weight system monitor. A screenshot along with the current configuration file are attached below.

Restore Grub Boot Loader in Ubuntu

Sometimes, especially if you have just installed Windows operating system alongside with your Ubuntu, your precious Grub boot loader will be wiped out from the MBR (Master Boot Record) from your hard disk. How do you restore it?

The steps here have been tested with Ubuntu 9.10.

  1. Boot into the Ubuntu Live CD or USB stick.
  2. Open a terminal with 'Accessories' -> 'Terminal'.
  3. Find out the partition that correspond to your root /. If you have a separate partition for /boot, find it out too. The command sudo fdisk -l may help. Here we assume that the partitions are /dev/sda1 and /dev/sda2 (if any) respectively.
  4. Now mount your root partition with sudo mount /dev/sda1 /mnt. If you have a separate partition for /boot, mount it too with sudo mount /dev/sda2 /mnt.
  5. Restore Grub with sudo grub-install --root-directory=/mnt /dev/sda. (Assume that you want to install Grub to the MBR of /dev/sda.)

Reboot your computer and it should work fine now.

Syndicate content