This is a weird situation which I found myself in recently. One of the ubuntu servers were having issues and was unable to launch any process for unknown reason (kernel issue/disk or filesystem failure/etc). Puzzled, I tried to reboot the machine using
reboot, but the system did not allow me to. It also failed to run utilities such as
After some googling, here is the magic (“magic SysRq key”):
echo 1 >/proc/sys/kernel/sysrq
echo s > /proc/sysrq-trigger (optional, sync mounted filesystems)
echo u > /proc/sysrq-trigger (optional, remount filesystems as read-only)
echo b > /proc/sysrq-trigger
echo is a bash shell builtin command and does not have to be a new process. Reboot now!
Linux Magic System Request Key Hacks
Quassel is a cool IRC client and server. From its homepage:
Quassel IRC is a modern, cross-platform, distributed IRC client, meaning that one (or multiple) client(s) can attach to and detach from a central core — much like the popular combination of screen and a text-based IRC client such as WeeChat, but graphical.
One can choose to install quassel from the distro’s repo, or use the statically linked binary provided by the author. The advantages of the statically linked binary are: it does not require Qt or SSL to be installed, and is probably a newer version than what is in the repo.
The download provided is a 32-bit binary. To run it in 64-bit Ubuntu, we need to satisfy its dependencies:
apt-get install zlib1g:i386
Extract and run:
Blogs | Quassel IRC
Downloads | Quassel IRC
Certain routers like the Asus RT-N66U have built-in network print server capability, which is an under-appreciated feature IMHO. But the settings > add printer dialog in Ubuntu 14.04 left much to be desired when it could not add the printer running behind the Asus router.
As a workaround, run the following command to get a better add-printer facility:
LPD/LPR Host or Printer.
Enter router IP (commonly
192.168.1.1) in “Host”, and
LPRServer in “Queue”, and select
Choose the driver that matches the printer to add it to the system. You can now print from other applications.
ASUSTeK Computer Inc.-Forum- How to setup network printer in Ubuntu 12.04
1. Add redundant repo
In /etc/apt/sources.list, add:
deb http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
deb http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
2. Set timeout
Create /etc/apt/apt.conf.d/99timeout, add:
apt – How to lower wait time for repository updates – Ask Ubuntu
As I was trying out zfs (on Ubuntu) on our HP server, I realised the RAID card that came with the server, HP Smart Array P410i, does not have a JBOD (Initiator-Target) mode. Now this is a First-world-problem – the card can support RAID 0, 1, 10, 5, 6, 50, 60, but not JBOD (?!).
Moving on, the next best thing is to configure every disk (we have 8 SSD) to be a 1-disk RAID 0 array to “simulate” a JBOD setup. Inside Ubuntu, there is now a 1-to-1 mapping of device to drive (sda – sdh), which is what is recommended by zfs.
Creating the zfs pool and setting some options:
zpool create tank sda sdb sdc sdd sde sdf sdg sdh
zfs set atime=off tank
zfs set sharesmb=on tank
But this is not the crux of this article. The problem is that random write performance is not as good as we expected out of zfs. The ideal setup would be to expose individual disks to zfs, but we could only expose the disks through the RAID card. After some tinkering, we found that the drive write cache was disabled, probably due to the fact that there is no battery unit on the RAID card.
To enable drive write cache:
hpacucli controller slot=0 modify drivewritecache=enable
IIRC there was some warnings, but I ignored them as what I want is a JBOD setup to hold non-mission critical data. A raidz pool can be setup if need be for redundancy, but at this point I lost myself looking at the 2x increase in write bandwidth. Next up, trying to saturate the pipe 😀
We got a couple of HP ProLiant DL380 G7 servers, and this is what HP has to offer for being certified for Ubuntu: Management Component Pack (on its Software Delivery Repository).
And here’s how to set it up on Ubuntu 12.04 LTS.
Add the repo:
add-apt-repository 'deb http://downloads.linux.hp.com/SDR/repo/mcp/ubuntu precise/current non-free'
And the repo keys:
wget -qO - http://downloads.linux.hp.com/SDR/repo/mcp/GPG-KEY-mcp | sudo apt-key add -
Finally, get the list of packages from the repo and install whichever packages required (
hpacucli to configure the disk array controller):
apt-get install hpacucli
This is likely to be the shortest post yet. Objective is as above. In Linux, run Chrome using: