Please note : This article is based on RHEL5 and grub.
Below shows the 2 methods you can use to ensure serial connectivity when booting into single user mode.
You may find without changing this setting your connection is lost just after Redhat starts booting.This configuration change can be via the grub.conf or via the kernel line via the grub menu at boot.
Via the grub.conf
Edit the grub.conf file so that the console setting is equal to ttyS0. (Lines have been omitted with !)
[email protected]:~$ vi /boot/grub/grub.conf
!
serial –unit=0 –speed=9600
terminal –timeout=5 serial console
!
!
timeout=5
title Red Hat Enterprise Linux Server (2.6.18-92.el5PAE)
root (hd0,0)
kernel /vmlinuz-2.6.18-92.el5PAE ro root=/dev/vg0/root console=ttyS0
initrd /initrd-2.6.18-92.el5PAE.img
title Red Hat Enterprise Linux Server-base (2.6.18-92.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-92.el5 ro root=/dev/vg0/root console=ttyS0
initrd /initrd-2.6.18-92.el5.img
Via the Grub Menu
When booting a server into single user mode the serial console which is normally supplied via the mingetty
- From the GRUB menu
- Press “p”
- Enter the password if there is one.
- Select the necessary kernel
- Type “e”
- Select the Kernel line (which begins with Kernel)
- Type “e”
- Ensure that the line includes “console=ttyS0” if not make the required changes
- Press Return
- Type “b”
Additional Notes
The tty settings equate to :
- /dev/tty0 – current virtual console
- /dev/tty1 – first virtual console
- /dev/tty63 – 63rd virtual console
- /dev/ttyS0 – first serial port
- /dev/ttyS63 – 64th serial port
If using LILO you will need to change settings in /etc/lilo.conf.
This document doesn’t include the steps to get into single mode. Which are :
- Run the command `init 1` from the shell when in run level 3.
- Edit the inittab.conf file to so the necessary line reads “id:1:initdefault:” and reboot.
- How to Configure a BIND Server on Ubuntu - March 15, 2018
- What is a BGP Confederation? - March 6, 2018
- Cisco – What is BGP ORF (Outbound Route Filtering)? - March 5, 2018
Want to become a Linux expert?
Here is our hand-picked selection of the best courses you can find online:
Linux Mastery course
Linux Administration Bootcamp
and our recommended certification practice exams:
AlphaPrep Practice Tests - Free Trial