====== 42 CentOS7 シリアルコンソール ====== CentOS7でシリアル接続を行う場合の設定 ===== /etc/default/grubの修正 ===== # cp /etc/default/grub /etc/default/grub.`date +%Y%m%d` # diff /etc/default/grub.`date +%Y%m%d` /etc/default/grub 5,6c5,8 < GRUB_TERMINAL_OUTPUT="console" < GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quit" --- > GRUB_TERMINAL_OUTPUT="console serial" > GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1" > GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb biosdevname=0 net.ifnames=0" > GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0,115200n8" ==== HP DL360などS1のものは下記のようにする ==== GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS1,115200n8" ===== grub.cfg 再作成 ===== # grub2-mkconfig -o /boot/grub2/grub.cfg Generating grub configuration file ... Found linux image: /boot/vmlinuz-3.10.0-957.el7.x86_64 Found initrd image: /boot/initramfs-3.10.0-957.el7.x86_64.img Found linux image: /boot/vmlinuz-0-rescue-99469c9abf8849ffa1d9c35f64cbc711 Found initrd image: /boot/initramfs-0-rescue-99469c9abf8849ffa1d9c35f64cbc711.img done ==== UEFI ==== UEFIだと以下のようにする UEFI(Unified Extensible Firmware Interface)とは、マザーボードに保存されているプログラムです。 時代遅れとなった BIOS に代わり開発されたのが UEFI であり、UEFI は BIOS の後継です。 # grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg ===== gettyの設定 ===== # cp /lib/systemd/system/serial-getty@.service /etc/systemd/system/serial-getty@ttyS1.service # ln -s /etc/systemd/system/serial-getty@ttyS1.service /etc/systemd/system/getty.target.wants/ # systemctl daemon-reload # systemctl start serial-getty@ttyS1.service # systemctl enable serial-getty@ttyS1.service とりあえず1回だけシリアルコンソール表示したい場合、サービスを起動させればそれでOK # systemctl start getty@ttyS0 ===== securettyの追加 ===== # vi /etc/securetty ~ ttyS1 {{tag>centos7 ipmi}}