fails to deal with a serial console correctly

Bug #537849 reported by LaMont Jones on 2010-03-12
64
This bug affects 13 people
Affects Status Importance Assigned to Milestone
grub-installer (Ubuntu)
Undecided
Unassigned

Bug Description

Binary package hint: grub-installer

When I install lucid on a serial console, grub-installer fails to setup the kernel options correctly.

On the machine in question, console=ttyS1,38400 - this is not what grub-installer sets up.

After manually fixing default/grub and running update-grub, I still see:

error: bad unit number.
error: unknown terminal 'serial'
.
error: unknown command `terminal'.
error: unknown terminal 'serial'
.
error: unknown command `terminal'.

before the kernel boot proceeds.

lamont

Peter Szabo (szpeter80) wrote :

I have the same problem described above. I installed 10.04 from optical media, later i added serial console support for kernels and GRUB2. Kernel support works fine, but GRUB2 menu cannot be seen on serial console, just the error messages described above. I ran aptitude update & upgrade, but no changes. I have the deafult package repositories. Only "grub-common" and "grub-pc" is installed from the many grub packages.

Conclusion: in 10.04 LTS the bootloader's serial console is broken and not possible to use it, eg. to boot into safe mode.

kamuz (kamuz2000) wrote :

I also have this problem with 10.04 LTS and grub doesn't work.

On the other hand, I tried Debian Squeeze which I believe they share the same base according to lsb-release and Grub / Kernel works fine without any error.

theparanoidone (theparanoidone) wrote :

Experienced Same issue:

error: unknown terminal 'serial'
error: unknown command `terminal'.

Have been testing multiple configurations with limited success.

This command throws errors:
GRUB_SERIAL_COMMAND="serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1"

This command seems to stop the errors.. but I can't get the boot menu to appear or shift key to be recognized:
GRUB_SERIAL_COMMAND="serial --speed=115200"

I have also messed with toggling GRUB_TERMINAL vs. GRUB_TERMINAL_INPUT / GRUB_TERMINAL_OUTPUT... tried various combinations of the lines below...
GRUB_TERMINAL=serial
GRUB_TERMINAL_INPUT="serial console"
GRUB_TERMINAL_OUTPUT="console"

Basically been adjusting the following lines with little to no success... I have been unable to get the menu to display at all via serial port. (Prior GRUB 1 configurations in Ubuntu 8 have been deployed to many servers with no problems... so this is starting to feel like a GRUB2 error).

#GRUB_CMDLINE_LINUX_DEFAULT=""
#GRUB_CMDLINE_LINUX_DEFAULT="quiet"
#GRUB_CMDLINE_LINUX=""
#GRUB_CMDLINE_LINUX_DEFAULT=""
#GRUB_CMDLINE_LINUX="text console=tty0 console=ttyS0,115200n8"
#GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0,115200n8"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console
#GRUB_TERMINAL=serial
#GRUB_SERIAL_COMMAND="serial --speed=115200"
#GRUB_TERMINAL_INPUT="serial console"
#GRUB_TERMINAL_OUTPUT="console"
#GRUB_SERIAL_COMMAND="serial --unit=0 --speed=115200"
#GRUB_SERIAL_COMMAND="serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1"

Changed in grub-installer (Ubuntu):
status: New → Confirmed
theparanoidone (theparanoidone) wrote :

Feedback:
-------------
Apparently... *disabling* console redirection in the motherboard allows grub to function somewhat correctly. This was not a problem in Ubuntu 8.04 (I will be testing Ubuntu 11.04 in just a moment). I found the following footnote quote "If you're sure you've configured GRUB correctly, but the serial menu does not appear, try disabling serial console support in BIOS." -- https://help.ubuntu.com/community/SerialConsoleHowto#fnref-4630b2079d69e5d0212e584145e50a6c70a1491f

Opinion:
-----------
Having to diable motherboard serial console access is a limitation / hindrance to successful remote server administration... especially since this feature worked properly in prior distributions.

Notes:
---------
DELL R200 Server

Grub2 Config:
-------------------
GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=5
GRUB_HIDDEN_TIMEOUT_QUIET=false
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0,115200n8"
GRUB_TERMINAL=serial
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"

Observed Effects in Ubuntu 10.04
----------------------------------------------

- Disable motherboard console redirection (DISABLED, com1, vt100, 115200, redirect after console DISABLED)
-- serial console shift key *does not* work to display menu
-- serial console tapping ESC multiple times quickly will allow menu to be displayed

- Enable motherboard redirection (ENABLED, com1, vt100, 115200, redirect after console ENABLED)
-- error message(s) appears error: unknown command `terminal'.
-- serial console shift key *does not* work
-- serial console tapping ESC multiple times flickers the menu for one second then it disappears

theparanoidone (theparanoidone) wrote :

Comparison Between Ubuntu 10.04 and 11.04
---------------------------------------------------------------

Ubuntu 11 exhibits the same behavior as Ubuntu 10. However... a potential workaround may have been found for Ubuntu 11 as it appears to be working... Enable motherboard redirection
  -- (ENABLED, com1, vt100, 115200, redirect after console *****DISABLED*****) appears to fix the issues

Grub2 Config
-------------------
GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=5
GRUB_HIDDEN_TIMEOUT_QUIET=false
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0,115200n8"
GRUB_TERMINAL="serial console"
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"

Observed Effects in Ubuntu 11.04
----------------------------------------------

- Disable motherboard console redirection (DISABLED, com1, vt100, 115200, redirect after console DISABLED)
-- no motherboard serial access
-- serial console shift key *does not* work to display menu
-- serial console tapping ESC multiple times quickly will allow menu to be displayed

- Enable motherboard redirection (ENABLED, com1, vt100, 115200, redirect after console ENABLED)
-- yes / motherboard serial access
-- error message(s) appears error: unknown command `terminal'.
-- serial console shift key *does not* work
-- serial console tapping ESC multiple times flickers the menu for one second then it disappears

- ENABLED, com1, vt100, 115200, redirect after console *****DISABLED*****
-- yes / motherboard serial access
-- serial console shift key *does not* work to display menu
-- serial console tapping ESC multiple times quickly will allow menu to be displayed

I will be testing Ubuntu 10.04 again to see if the above solution works. For the record... Ubuntu 8 worked with - Enable motherboard redirection (ENABLED, com1, vt100, 115200, redirect after console ENABLED) settings

theparanoidone (theparanoidone) wrote :

Ubuntu 10.04 Re-Test
-----------------------------

- ENABLED, com1, vt100, 115200, redirect after console *****DISABLED*****

Grub (NON WORKING CONFIG)
--------------------
GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=5
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX="console=tty1 console=ttyS0,115200n8"
GRUB_TERMINAL="serial console" #### THIS FAILS ###
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"

>> root@fury:/etc/init# update-grub
>> Invalid output terminal "serial console"
... this is an error... it's supported in documentation and works in ubuntu 11

Partially Working Ubuntu 10.04 Config
----------------------------------------------------
GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=7
GRUB_HIDDEN_TIMEOUT_QUIET=false
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX="console=tty1 console=ttyS0,115200n8"
GRUB_TERMINAL_INPUT="serial console"
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"

*** Notice GRUB_TERMINAL was changed to GRUB_TERMINAL_INPUT

- ENABLED, com1, vt100, 115200, redirect after console *****DISABLED*****
-- yes / motherboard serial access
-- yes / serial grub console access
-- serial console shift key *does not* work to display menu
-- serial console tapping ESC multiple times quickly will allow menu to be displayed
-- no / no physical console displayable menu... BUT if you hit ESC it will appear on physical console
---- this is different than Ubuntu 8 and 11 which allows you to simultaneously control the grub menu from serial or console

In other words... it "kind-of" works. You can get serial administration working fairly well at the cost of slight physical grub console access being limited (but ultimately working).

Assuming you are running a remote server environment... one could argue this is acceptable as the majority of the administration is done remotely anyways... so as long as the remote serial administration is solid... this is a plausible solution.

theparanoidone (theparanoidone) wrote :

Update as of 2011-11-30
Some package update appears to have revert/changed. The above notes an comments no longer seem valid for Ubuntu 10.04

Below is the new configuration setting we have had to use to make Ubuntu 10.04 work with serial; it is still not 100% as physical console access to the grub menu will not work.

Here are the new settings:

Ubuntu 10.04 appears to be working with this now:
GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=7
GRUB_HIDDEN_TIMEOUT_QUIET=false
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX="console=tty1 console=ttyS0,115200n8"
GRUB_TERMINAL="serial"
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"

*** Notice GRUB_TERMINAL_INPUT was changed back to just GRUB_TERMINAL="serial"

- ENABLED, com1, vt100, 115200, redirect after console *****DISABLED*****
-- yes / serial motherboard access
-- yes / serial grub console access
-- serial console shift key *does not* work to display menu
-- serial console tapping ESC multiple times quickly will allow menu to be displayed
-- no / no physical console displayable menu... BUT if you hit ESC it will appear on physical console
---- this is different than Ubuntu 8 and 11 which allows you to simultaneously control the grub menu from serial or console

Michal (kismi2) wrote :

I have got the same problem.
HP ProLiant ML110 G6 with Lights-Out card. Ubuntu 10 LTS.
The card offers an independent system providing access over network (separate Ethernet interface) to serial interface (COM1).
I could setup BIOS access quite easily. I had no problems to provide login prompt and terminal access to the system.
The only issue was with GRUB and messages as stated above.
As far as I understand what is happening:
 - BIOS grabs the serial interface to provide console services there.
 - As the control is passed to grub the ttyS0 is still grabbed by BIOS service.
 - GRUB tries to setup the port with "serial" command and it causes "error: bad unit number." message.
With that observation I simply decided to "use" this redirection, so I let GRUB use the "console".
GRUB thinks he is writing on the screen, but BIOS redirects this output to ttyS0 (COM1).
Here is my config:
===============
GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=7
GRUB_HIDDEN_TIMEOUT_QUIET=false
GRUB_TIMEOUT=7
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
#GRUB_CMDLINE_LINUX=""
GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0,115200n8"

# Uncomment to disable graphical terminal (grub-pc only)
GRUB_TERMINAL=console
#GRUB_TERMINAL=serial
#GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"
===============
The only disadvantage is "jumping cursor" (it appears like crazy in various positions on the screen).
Apart of that you have 7 seconds to press ESC key to stop autoboot. If you press the key the GRUB menu appears.
So now I have remote access to all three stages - BIOS setting, GRUB menu and system console.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers