A common problem with remotely managed Linux servers is console access. Not everybody is lucky enough to have KVM-over-IP readily available, but for most uses a simple serial console on a hardwired line to a suitable box nearby suffices.
The configuration is simple enough.
First, to run a login prompt on the serial line, add this to /etc/inittab:
T0:23:respawn:/sbin/getty -L ttyS0 115200 vt100
Second, to run both the VGA and serial console, add this to /boot/grub/menu.lst (on Debian, for other distros, take your pick):
serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1 terminal --timeout=10 serial console timeout 10
This will set up the VGA and serial consoles and prompt on both for attention and once that timeout expires, the grub boot timeout will commence. In a nutshell, this setup gives an operator on either the VGA or serial console a chance to intervene and interact with grub (to pick the kernel to boot, say); failing any interaction, the server will (try to) boot unattended.
To make the kernel aware of all of this, an additional edit in menu.lst is required. Append console options to grub’s default kopt line
# kopt=root=/dev/mapper/server-root ro console=tty0 console=ttyS0,115200n8
and then run update-grub (on Debian).
Posted by markus on Sunday, June 01, 2008