MinimalEtchSerialConsole

From Granizada

Jump to: navigation, search

This page is extracted and modified from MinimalEtchXen, and is similiarly intended as a teaching tool. The end result is a Minimal Debian Etch (v4.0) system, ready (for example) for something like Package List Cloning.

Contents

Minimal Etch Install

Boot a Debian Etch CD, if you have fast and cheap Internet then maybe the netinst.iso CD image. Step through the installer as usual then, at the Debian Software Selection screen make sure all options are deselected (by default, Desktop Environment and Standard System are selected. You don't want them.) Make sure you have specified a Debian package repository.

Turn on Serial Support in Firmware

Any decent server will have serial support in its firmware (a BIOS if you are using an x86 architecture, OpenFirmware for most others.) This means that you can connect to the server from the instant it is powered on and before there is any operating system. In order to do this you normally have a serial port connected to a networked serial server.

Installing Etch with Serial Support

Serial console is when you want to be able to access your server over a serial connection (that is, not over a network. Handy for when kernel upgrades or GRUB changes don't go as planned for example.) Serial access is not the default in Etch which is why we have to add it here. (For a slightly broader view, see these references to Linux serial support.)

After you've gone through the installation steps and before selecting Finish the Installation, exit to a shell prompt and make the following changes to make sure you have serial access after rebooting. Most of the following files will not be as full as you would expect in a normal Linux installation. That's because the installation hasn't quite finished, but you don't get a later opportunity to launch a shell before the installer exists and reboots, and if your machine is locked in a datacentre things might get difficult (but if your machine is local it doesn't make the job any harder.)

I have used the first serial port (/dev/ttyS0) in the following. You may need different port or speed settings.

edit the global section of /boot/grub/menu.lst to say:

serial --unit=0 --speed=115200
terminal --timeout=15 serial console

In the kernels section, append com1=115200 and console=ttyS0,115200 as follows:

kernel          /boot/vmlinuz-2.6.x.x-x.gz com1=115200
module          /boot/initrd-2.6.x.x-x root=/dev/md1 ro console=ttyS0

The com1= parameter is hardware-dependent, you may not need it.

In /etc/inittab, add :

S0:12345:respawn:/sbin/agetty 115200 ttyS0 vt100

The Debian installer will create a secure tty file when finishing the installation, so don't get worried if you notice it doesn't exist yet. Without an entry in /etc/securetty root will not be allowed to log on from the serial port.

When You Make a Mistake

What if you get it all wrong before rebooting into a new kernel? If you're doing a local install then you can just start again. If your server is in a datacentre and you have serial console access, use it :-) Some datacentres, including Bytemark, provide PXE boot servers. PXE also knows about serial terminals so you have the next-best thing to control at the BIOS level. If the PXE menu lets you boot Linux then mount your local drive and edit away :-)

Personal tools
Navigation