Can't get grub2 boot menu via COM2 port

I want to connect my "CentOS Linux release 7.6.1810 (Core)" device via COM2 port,then I modify '/etc/default/grub':

GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="serial"
GRUB_CMDLINE_LINUX="console=tty0 console=ttyS1,115200n8"
GRUB_DISABLE_RECOVERY="true"
GRUB_TERMINAL="serial console"
GRUB_SERIAL_COMMAND="115200n8 serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"

then run:

grub2-mkconfig -o /boot/grub2/grub.cfg

as the result I could only get the output after "boot menu", not including the grub2.

PS: I'm using COM2(ttyS1) not COM1(ttyS0)


Solution 1:

Your GRUB_SERIAL_COMMAND is specifying to use serial port 0, but you specifically said you wanted to use serial port 1.

You specified --unit=0, which means serial port 0.

You should instead use --unit=1, to use serial port 1.


Also, your serial command begins with 115200n8 which is not valid and should not be present. It should instead start with serial.

Solution 2:

If you only need the second one, simply change the --unit=0 into --unit=1.

The serial unit 0 is usually called ‘COM1’, so, if you want to use COM2, you must specify ‘--unit=1’ instead. -- grub manual