|C H A P T E R 2|
Console Redirection Over Serial on a Linux System
Instructions for console redirection on a Solaris system can be found in the Sun Fire V60x and Sun Fire V65x Server Solaris Operating Environment Installation Guide.
Caution - Redirecting the console over serial is a procedure intended for advanced users of Linux only.
Redirecting the console interaction over the serial port allows the user another method to monitor the server. The goal of these configurations is to configure the bootloader to redirect its output, pass the kernel the proper parameters and configure a login session on the serial port.
This chapter specifies how to configure these options.
The BIOS redirects console output to serial by default (9600, 8N1, no handshake) until a bootloader program is run from the hard disk drive. The bootloader must be configured to support the serial console in addition to the keyboard, video and monitor (KVM) console.
Two common bootloaders are grub and Linux Loader (LILO).
Caution - Do not edit the working-image section of your configuration files directly.
If you use grub, there are three steps to enable console redirection over serial; these steps all involve editing the grub configuration file /etc/grub.conf.
1. Passing the proper console parameters to the kernel.
2. Configuring the grub menu system to redirect to the proper console.
3. Removing any splash images that would prevent the proper serial-console display.
For more information on the parameters, refer to the file kernel-parameters.txt in your kernel documentation.
For more information on grub, run the command info grub.
Note - If the arrow keys do not work through your remote serial concentrator, you can use the keystroke combinations of <CTRL+P> and <CTRL+N> work to highlight the Previous and Next entry, respectively. Pressing Enter then boots that entry.
The parameter console=ttyS1 tells the system to send the data to the serial port first. The parameter console=tty0 tells the system to send the data to the KVM second.
A working-image section in your file /etc/grub.conf should have an entry for the kernel image to boot. The stock kernel entry looks like:
kernel /vmlinuz-<kernelrevision> ro root=/dev/sda5
where <kernelrevision> is simply the kernel version that you are using.
You need to change the stock kernel entry of your image to include the console-kernel parameters, as follows:
kernel /vmlinuz-<kernelrevision> ro root=/dev/sda5 console=ttyS1,9600 console=tty0
Add the following two lines to the file /etc/grub.conf:
serial --unit=1 --speed=9600
terminal serial console
Adding these two lines sets up your serial port or your KVM as your grub console so that you can remotely or locally select a boot image from the grub menu.
Comment out or remove the following line from the file /etc/grub.conf:
Removing the splashimage line allows for greater compatibility during your serial connection; with this line removed, the splash image will not prevent the proper grub menu from displaying.
LILO uses the append feature in an image section in order to pass the kernel the proper parameters to use the serial console.
You can enter the consoles in the append statement of the file /etc/lilo.conf:
After modifying the file /etc/lilo.conf, the user must run lilo from the command line to activate the change.
For more information on LILO, run the commands man lilo or man lilo.conf.
You can run a service called getty to log out of idle shell sessions automatically on the serial interface.
To enable getty, append the following line to the list of gettys in the file /etc/inittab file:
7:12345:respawn:/sbin/agetty 9600 ttyS1
The list of gettys currently looks like the following:
# Run gettys in standard runlevels
If the default settings have been changed in the BIOS, the following procedure explains how to change the console-redirection settings.
1. Reset or power on the Sun Fire V60x server or Sun Fire V65x server.
2. As soon as the "SETUP" option appears on the monitor, press <F2> to enter the "SETUP" section.
3. Once in the main page of the Setup menu, use the arrow keys to select the "Server" menu.
4. Press Enter.
5. In the "Server"menu, select "Console redirection".
6. Press Enter.
7. In the "Console redirection" screen, view the following settings. Ensure that these settings match the settings at the remote terminal. Make any necessary changes.
8. To exit the "Setup" menu and save your changes, press <F10>.
For the new settings to take effect, you need to reboot the server.
Once the server reboots, the console redirection will work.
Note - You can navigate the portions of the Diagnostics CD and the System Setup Utility (SSU) with the mouse as well.
The Diagnostics CD or the Service Partition can run over the serial console if console redirection is enabled in the BIOS. For more information, see Enabling BIOS Console Redirection.
To run the Diagnostic functions from the Diagnostics CD or the Service Partition on the server's hard disk drive, you need to reboot the server.
Once the server reboots, the console redirection will work without any special configuration changes.
To view the SEL information:
1. From the Diagnostics CD, boot the Sun Fire V60x server or Sun Fire V65x server.
2. Insert the floppy diskette into the floppy diskette drive.
3. Once the Diagnostics CD has completed booting, use the arrow keys to select the "System Utilities" option from the top menu.
4. From the "System Utilities" drop-down menu, use the arrow keys to select "Run System Setup Utility (SSU)" and press Enter.
The SSU installs onto a ramdisk and takes a few minutes.
5. Once the installation is complete, press any key to continue into the SSU UI.
6. From the SSU task list, use the arrow keys to select "SEL Manager" and press Enter.
In the SEL Manager, a list of the SEL contents appears. You can page up and down through the listing to view the events.
7. To save the SEL to a floppy diskette:
a. Press <ALT+F>.
b. Select "Save As...".
c. Enter the filename for the SEL.
d. The 8.3 naming limitation in DOS applies (format: xxxxxxxx.yyy).
e. Use the TAB key to navigate to the "Drives" drop-down menu. Use the arrow keys to select "A: ".
f. Use the TAB key to navigate to OK button and press it.
g. Once the SEL information has been saved, press Enter to confirm.
8. To exit the SSU, press ESC several times and press Enter to confirm each step.
9. To exit the Diagnostics CD, use the arrow keys to select "Quit to DOS".
10. Select "Quit Now" and press Enter.
11. Eject the Diagnostics CD and remove the floppy diskette.
You can now reboot the server or power it off.