User Tools

Site Tools


linux:boot

This is an old revision of the document!


Boot

Grub

  • Grub 2 - Setting default entry
    Open /etc/default/grub and ensure this line exists:
    GRUB_DEFAULT=saved
     
    Apply the change to grub.cfg by running:
    # grub2-mkconfig -o /boot/grub2/grub.cfg
     
    Now list all possible menu entries
    # grep ^menuentry /boot/grub2/grub.cfg | cut -d "'" -f2
     
    Now set the desired default menu entry
    # grub2-set-default <menu entry title>
     
    Verify the default menu entry
    # grub2-editenv list

grubby

# grubby --default-kernel
# grubby --set-default=/boot/vmlinuz-3.10.0-514.el7.x86_64 

Systemd

  • Enable rc-local in OL7
    cat >> /usr/lib/systemd/system/rc-local.service <<EOF
     
    [Install]
    WantedBy=multi-user.target
    EOF
    chmod +x /etc/rc.d/rc.local
    systemctl enable rc-local.service
    systemctl start rc-local.service
    systemctl status rc-local.service
     
    echo "systemctl restart network.service" >> /etc/rc.d/rc.local

Initramfs

# extract initramfs in RHEL7/Centos7
/usr/lib/dracut/skipcpio initramfs-3.10.0-229.el7.x86_64.img | zcat | cpio -idv

Debug

kernel cmd line: debug initcall_debug
serial console in grub:
serial --unit=0 --speed=115200
terminal --timeout=10 console serial
kernel cmd line: console=tty1 console=ttyS0,115200n8
linux/boot.1505520727.txt.gz · Last modified: 2017/09/15 17:12 by frank