Linux关闭开关机动画,centos7删除开机动画及修改启动菜单
刪除開(kāi)機(jī)動(dòng)畫(huà)
編輯vi /etc/default/grub 文件,找到 GRUB_CMDLINE_LINUX 一行,將“rhgb quiet” 改為 “quiet” (去掉rhgb)
修改前:
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet"
GRUB_DISABLE_RECOVERY="true"
修改后:
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap quiet"
GRUB_DISABLE_RECOVERY="true"
最后執(zhí)行命令:
grub2-mkconfig --output=/boot/grub2/grub.cfg
重啟就可以看到效果了
修改啟動(dòng)等待時(shí)間
編輯vi /boot/grub2/grub.cfg 文件,修改timeout屬性,如開(kāi)機(jī)等待5秒修改為2秒
修改前:
terminal_output console
if [ x$feature_timeout_style = xy ] ; then
set timeout_style=menu
set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
set timeout=5
fi
修改后:
terminal_output console
if [ x$feature_timeout_style = xy ] ; then
set timeout_style=menu
set timeout=2
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
set timeout=2
fi
注意: 這個(gè)文件是由模板/etc/grub.d和配置文件/etc/default/grub通過(guò)命令grub2-mkconfig生成的
刪除多余開(kāi)機(jī)菜單
編輯vi /boot/grub2/grub.cfg 文件,刪除menuentry開(kāi)頭的段落,menuentry后面的就是菜單名
修改前:
### BEGIN /etc/grub.d/10_linux ###
menuentry 'CentOS Linux (3.10.0-957.27.2.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-957.27.2.el7.x86_64-advanced-4e334e31-4461-4c13-9c08-93af5da320ea' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod xfs
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1' 9cffe801-9abf-4403-805e-e92b604005d2
else
search --no-floppy --fs-uuid --set=root 9cffe801-9abf-4403-805e-e92b604005d2
fi
linux16 /vmlinuz-3.10.0-957.27.2.el7.x86_64 root=/dev/mapper/centos-root ro crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap quiet
initrd16 /initramfs-3.10.0-957.27.2.el7.x86_64.img
}
menuentry 'CentOS Linux (3.10.0-957.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-957.el7.x86_64-advanced-4e334e31-4461-4c13-9c08-93af5da320ea' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod xfs
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1' 9cffe801-9abf-4403-805e-e92b604005d2
else
search --no-floppy --fs-uuid --set=root 9cffe801-9abf-4403-805e-e92b604005d2
fi
linux16 /vmlinuz-3.10.0-957.el7.x86_64 root=/dev/mapper/centos-root ro crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap quiet
initrd16 /initramfs-3.10.0-957.el7.x86_64.img
}
if [ "x$default" = 'CentOS Linux (3.10.0-957.27.2.el7.x86_64) 7 (Core)' ]; then default='Advanced options for CentOS Linux>CentOS Linux (3.10.0-957.27.2.el7.x86_64) 7 (Core)'; fi;
修改后:
### BEGIN /etc/grub.d/10_linux ###
menuentry 'CentOS Linux (3.10.0-957.27.2.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-957.27.2.el7.x86_64-advanced-4e334e31-4461-4c13-9c08-93af5da320ea' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod xfs
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1' 9cffe801-9abf-4403-805e-e92b604005d2
else
search --no-floppy --fs-uuid --set=root 9cffe801-9abf-4403-805e-e92b604005d2
fi
linux16 /vmlinuz-3.10.0-957.27.2.el7.x86_64 root=/dev/mapper/centos-root ro crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap quiet
initrd16 /initramfs-3.10.0-957.27.2.el7.x86_64.img
}
if [ "x$default" = 'CentOS Linux (3.10.0-957.27.2.el7.x86_64) 7 (Core)' ]; then default='Advanced options for CentOS Linux>CentOS Linux (3.10.0-957.27.2.el7.x86_64) 7 (Core)'; fi;
總結(jié)
以上是生活随笔為你收集整理的Linux关闭开关机动画,centos7删除开机动画及修改启动菜单的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: linux cp复制文件夹下的软连接,L
- 下一篇: linux unbuntu屏幕显示不完整