OMV serial console access [putty | GNU screen ]
Intro
In NAS headless systems sometimes we loose network connectivity or the kernel boot stops in some error, for that purposes and having no monitor available we can always use the serial console available in every motherboard.
Prerequisites
Openmediavault 1.0
SSH access
Serial port in motherboard and USB to serial cable
Some mobo's don't have the DB9 port on the back, but they all have it inside, this is what it looks like:
mobo.jpg 8.jpg
That's a 9 pin header com
With the help of this accessory we can bring the header to the outside of the case with a nice DB9 male connector.
Then with a USB to DB9 (serial) cable, we can output the console text to a computer or if we want we can redirect it to a network socket. This is interactive, we can send commands also.
Start:
We are enabling the serial console for:
- grub boot menu
- boot sequence (kernel load and daemon starts)
- login tty, this is for login and command posting
We set grub options for serial, so we edit the default file
nano /etc/default/grub
This two lines are for grub boot menu, you will be able to select kernel or other OS
GRUB_TERMINAL=serial
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"
The following are kernel boot parameters, with these you will monitor the whole boot sequence, and press some ctrl-D if necessary
GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0,115200n8"
When you finish run update-grub2
Now for the login tty we edit inittab and add the ttyS0 (serial) line after the getty's runlevel set.
nano /etc/inittab
look for this line 6:23:respawn:/sbin/getty 38400 tty6, and after that add
this will give you a login tty prompt after the boot sequence is finished.
Connecting
The most common program for this is our old good putty, watch the COM port and check that at device management in windows is set correctly.
From a linux client you can access with GNU screen
screen /dev/ttyUSB0 115200
Notes
- I'd recommend to buy a good serial cable, one with an FTDI chip. The prolific ones are just pure sh*t, tons of fake chips coming from china, drivers won't load, gibberish in the screen.
-This is valid only for OMV 1.0, Debian Squeeze might have a slight difference in grub syntax, also never achieved 115200bps back then.
- If 115200bps doesn't work, start by setting a 9600bps speed, and keep increasing until you find the one that works for you.