Linuxdoc Linux Questions
Click here to ask our community of linux experts!
Custom Search

8.2. Re-create saved console settings

Log in as root from the serial console and send the console into single user mode. The modem may hang up whilst doing this and you may need to re-connect.

Without a /etc/ioctl.save containing the saved terminal settings, init assumes a directly attached terminal running at 9600bps with 8 data bits, no parity, 1 stop bit and no flow control. Configure your terminal with these settings.

remote.example.edu.au ttyS0 login: root
Password: 
sh# rm -f /etc/ioctl.save
bash# telinit 1Telling INIT to go to single user mode.
INIT: Going single user
INIT: Sending processes the TERM signal
sh# stty sane -parenb cs8 crtscts brkint -istrip -ixoff -ixon

As you use stty to alter the Linux's terminal settings remember to also alter the settings of the attached terminal.

Exiting from single user mode back to the default run level will save the serial console termnial configuration into /etc/ioctl.save.

sh# exitbash# ls -l /etc/ioctl.save
-rw------- 1 root root 60 Jan 1 00:00 /etc/ioctl.save

The terminal settings saved in /etc/ioctl.save will be used if the machine boots into single user mode for any reason.

If your attached terminal or modem cannot alter speed to 9600bps then the above procedure cannot be followed. ioctlsave has been written for this special case. It saves the current terminal settings to a file in the same format as ioctl.save. The procedure is shown in Figure 8-1.

Figure 8-1. Using ioctlsave to create /etc/ioctl.save without entering single user mode

remote.example.edu.au ttyS0 login: root
Password: 
bash# rm -f /etc/ioctl.save
bash# ioctlsave -t /dev/ttyS0 /etc/ioctl.save