close

RHEL/CentOS 8 更改grub的方法,與設定Serial Port的方法:

                試驗OS: RHEL 8.x,以過往的經驗CentOS 8的設置方式會和RHEL 8相同。

RHEL/CentOS 顯示GRUB當前設定:

$grub2-editenv list 顯示目前GRUB的設定

修改方法

RHEL/CentOS 7.x,以下稱呼: el7RHEL/CentOS 8.x,以下稱呼: el8

 

先前el7的/etc/default/grub內容為紅字藍字的部分,修改完成後grub2-mkconfig -o /xxxxxxxx/grub.cfg(Legacy / UEFI OS位置不同,選擇對應的位置);修改vi /etc/securetty,增加ttyS1

GRUB_CMDLINE_LINUX="crashkernel=auto resume=UUID=d7e63527-7bc2-4dcc-84f9-4b065ab8a21b rhgb quiet console=tty0 console=ttyS0,9600n8"                       

GRUB_DISABLE_RECOVERY="true"

GRUB_ENABLE_BLSCFG=true

GRUB_SERIAL_COMMAND="serial --unit=0 --speed=9600 --word=8 --parity=no --stop=1"

GRUB_TERMINAL="console serial"

#備註1: n8rhardware flow control所使用

#備註2: quiet 隱藏開機過程的訊息(指進入OS過程中,螢幕出現GUI的畫面這個階段)

#備註3: rhgb Red Hat Graphical Boot的縮寫,顧名思義是圖形UI開機的意思,主要是隱藏kernel與初始化的開機訊息。

官方archives上解釋:

rhgb = redhat graphical boot - This is a GUI mode booting screen with most of the information hidden while the user sees a rotating activity icon spining and brief information as to what the computer is doing.

quiet = hides the majority of boot messages before rhgb starts. These are supposed to make the common user more comfortable. They get alarmed about seeing the kernel and initializing messages, so they hide them for their comfort.

延伸閱讀

#備註4: 同時移除rhgb quiet時,就可以看到更多的開機訊息。

#備註5: ttyS0為第1個serial portttyS1為第2個serial port。例如channel專案,第一個serial port為主板的實體COM,第二個為BMC所使用的SOL的虛擬COM

#備註6: (el7)  #grub2-mkconfig -o /boot/grub2/grub.cfg                    /*(Legacy configurations)*/

#grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg       /*(UEFI configurations)*/  RHEL=redhat, CentOS

 

因為el8修改Grub的方式,不適用el7的方法,經由更改檔案/boot/grub2/grubenv,更改完直接重新開機後,修改的內容有起作用!

所以因應el8更改grub的方式有所改變,簡易更改的方式為:修改/boot/grub2/grubenv

#

kernelopts=root=UUID=4c5d33cb-8ac1-409c-a552-9e3340088786 ro crashkernel=auto resume=UUID=d7e63527-7bc2-4dcc-84f9-4b065ab8a21b rhgb quiet console=tty0 console=ttyS0,9600n8

#

 

$grub2-editenv list 顯示目前GRUB的設定

檔案在/boot/grub2/grubenv  直接vi修改有用!

 

grub2-editenv

https://www.golinuxcloud.com/update-grub2-grubby-grub2-editenv-rhel-8/

 

最快速簡單開Port的方法:

If you DONT WANT to make serial console as default console:

Enable getty on your serial port

# systemctl enable getty@ttyS0 Created symlink from /etc/systemd/system/getty.target.wants/getty@ttyS0.service to /usr/lib/systemd/system/getty@.service.

And reboot (or use systemctl start for same service)

arrow
arrow

    吾給力 發表在 痞客邦 留言(0) 人氣()