Aller au contenu
Infogérance Linux Debian en France

Infogérance Linux Debian en France

Kogitae : Ingéniérie de l'hébergement Internet

  • Accueil
  • Parcours
  • Presse
  • Portfolio
  • Blog

Debian Linux: Set a Serial Console

  • Accueil » Blog » Debian Linux: Set a Serial Console
DansGénéralités

Debian Linux: Set a Serial Console

Debian Linux: Set a Serial Console

by Vivek Gite on January 22, 2011 · 2 comments

How do I set up a serial console on Debian Linux HP server for troubleshooting and login purpose?

To setup a serial console you need to edit the following files under Debian Linux:

/boot/grub/menu.lst or /etc/default/grub (recommended for grub2)

/etc/inittab

/etc/securetty

Our Setup

You can list your working serial port under Linux as follows:

# setserial -g /dev/ttyS[0123]

Sample outputs:

/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4

/dev/ttyS1, UART: unknown, Port: 0x02f8, IRQ: 3

/dev/ttyS2, UART: unknown, Port: 0x03e8, IRQ: 4

/dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3

/dev/ttyS0 (COM1) is detected and working serial console under Linux. For testing purpose, I’m going to set baud rate to 19200 and terminal type to vt100.

Grub Configuration (Grub2)

Edit /etc/default/grub, enter:

# vi /etc/default/grub

Append / modify as follows:

GRUB_CMDLINE_LINUX=’console=tty0 console=ttyS0,19200n8′

GRUB_TERMINAL=serial

GRUB_SERIAL_COMMAND= »serial –speed=19200 –unit=0 –word=8 –parity=no –stop=1″

Save and close the file. Next run the following command to generate a grub2 config file /boot/grub/grub.cfg :

# update-grub

A Note About Grub Legacy (older version)

If you are not using GRUB2 update /boot/grub/menu.lst (grub legacy) with kernel line as follows with console port, and baud rate:

title Debian GNU/Linux, kernel 2.6.32-5-486

root (hd0,0)

kernel /boot/vmlinuz-2.6.32-5-486 root=UUID=b598f856-2a2a-46d5-b60a-95826cfc7bf6 ro console=ttyS0,19200 earlyprint=serial,ttyS0,19200

initrd /boot/initrd.img-2.6.32-5-486

Save and close the file.

/etc/inittab Configuration

Edit /etc/inittab, enter:

# vi /etc/inittab

You need put a getty on a serial line for a terminal:

T0:23:respawn:/sbin/getty -L ttyS0 19200 vt100

Save and close the file.

/etc/securetty Configuration

Edit /etc/securetty, enter:

# vi /etc/securetty

Make sure UART serial ports /dev/ttyS0 is listed:

ttyS0

Save and close the file. Now, you can reboot the server for testing purpose.

viaDebian Linux: Set a Serial Console.

ar-xv-c-linux-debian configure-uart-in-debian-linux debian debian-devconsole debian-grub2-grub_terminal debian-wheezy-uart grub2 grub2-serial-console grub2unknownserialportconsole how-to-change-default-console-serial-port-in-linux linux-serial-earlyprint linux-serial-terminal linux-set-xv linux-uart-terminal serial serial-console serial-console-linux serial-port-debian-grub2 serial-port-linux set-uart-debian terminal-here-debian

Étiquettes

administrateur-systeme-freelance (9) amazon (3) apache (14) asterisk (9) auth (3) bash (6) blog-administrateur-systeme (14) blog-administration-systeme (4) collectd (5) cpu (3) debian (30) dovecot (4) duplicate (3) f (6) freelance-asterisk (3) google (3) infogerance-linux (5) infogérance (4) ipv6 (7) kernel (4) kogitae (30) kogitae-com (3) kogitae-fr (6) lamp-or-linux-or-developpement-web-and-apache-or-php-or-mysql-or-adobe-or-eclipse-or-zend-or-mozilla-or-firefox (17) lenny (4) lighttpd (5) limit (4) linux (26) mail (7) mdadm (6) mysql (14) openvz (9) optimiser (4) php (5) postfix (11) privvmpages-openvz (3) pxe (3) raid (3) SEO (5) ssh (8) ssl (3) test (3) voip (4) wordpress (6) www-kogitae-fr (7)