Yearly Archives: 2011


A note on installing a Linux based system on a two hard disks machine

The Filesystem Hierarchy Standard (FHS) defines the main directories and their contents in Linux operating systems and according to that, there should be a directory called /var/ where variable files, files whose content is expected to continually change during normal operation of the system, such as logs and spool files should be stored there.

It might be a good idea to have this directory on a separate disk from / and /swap since all these folders have lots of I/O operations and it is a known fact that hard disks have limited capabilities and usually hard disk are slowing down a system. By having /var on another disk it should help increase the I/O capabilities of the system drastically and improve system performance.


How to change hostname (computer name) in Ubuntu (or Ubuntu Server)

If you do not have Unity/Gnome/KDE/or some other window manager, to do this you need to be familiar with a command line text editor like vi/emacs/nano.

To change your hostname simply edit /etc/hostname and restart the machine.

The /etc/hostname file should only contain the actual hostname, which makes editing it quite simple since you will just replace the hostname in the file with the one you want to assign.

NOTE: Elevated privileges are required, only administrators can edit this file.


bash: killall: command not found — A solution 1

On some systems like the JeOS version of Ubuntu, some commands that we consider trivial are not installed and usually there is an alternative that we are not aware of (e.g instead of nano there is vi).
In this case there is the pkill command that will send a specified signal (or SIGTERM if not specified) to all processes that match the name (more options are available).
For example instead of

killall badProcess

you can use

pkill badProcess

which is also pretty easy and straightforward.

Another solution,

would be of course to install it. If you have enough access you can install the package psmisc using the following command (in Ubuntu / Debian):

apt-get install psmisc

For RHEL – Red Hat / Fedora:

yum install psmisc

This package contains the following useful programs:

  • fuser – identifies what processes are using files.
  • killall – kills a process by its name, similar to a pkill Unices.
  • pstree – Shows currently running processes in a tree format.
  • peekfd – Peek at file descriptors of running processes.