在开机时跳过Grub

我在一台UEFI机器的空磁盘中安装了Ubuntu,直到上周的软件更新,它一直在没有任何菜单或超时的情况下直接启动。 我想保持简单的启动,就像以前一样。

我所做的相关更改是使用旧的Linux Deepin安装从使用Ubuntu销售到同一台计算机的PC上移动磁盘。 所以现在我在同一台PC上有2个磁盘。

当然,在启动时我现在有一个grub菜单可以在Ubuntu和Deepin之间进行选择。 我不需要这个菜单,因为我总是使用Ubuntu,Deepin磁盘有自己的grub,我可以选择从BIOS选项启动哪个磁盘。

如何返回旧的启动顺序? 我真的不想断开我的Deepin磁盘。

在阅读完这个问题后,我在/etc/default/grub文件中更改了一些内容,现在它看起来像这样:

 # If you change this file, run 'update-grub' afterwards to update # /boot/grub/grub.cfg. # For full documentation of the options in this file, see: # info -f grub -n 'Simple configuration' GRUB_DEFAULT=0 GRUB_HIDDEN_TIMEOUT=0 GRUB_HIDDEN_TIMEOUT_QUIET=true GRUB_TIMEOUT=0 GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" GRUB_CMDLINE_LINUX="noprompt" # Uncomment to enable BadRAM filtering, modify to suit your needs # This works with Linux (no patch required) and with any kernel that obtains # the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...) #GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef" # Uncomment to disable graphical terminal (grub-pc only) #GRUB_TERMINAL=console # The resolution used on graphical terminal # note that you can use only modes which your graphic card supports via VBE # you can see them in real GRUB with the command `vbeinfo' #GRUB_GFXMODE=640x480 # Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux #GRUB_DISABLE_LINUX_UUID=true # Uncomment to disable generation of recovery mode menu entries #GRUB_DISABLE_RECOVERY="true" # Uncomment to get a beep at grub start #GRUB_INIT_TUNE="480 440 1" 

然后运行sudo update-grub没有问题。 但grub菜单和10秒超时仍然在启动时出现。

在Ubuntu磁盘上发布分区可能是相关的,因为它不是默认值:

分区 – 挂载点 – 标志

/dev/sda1bios_grub

/dev/sda2/boot/efiboot,esp

/dev/sda3/

/dev/sda4/home

/dev/sda5swap

如果出于任何原因你只想要Ubuntu,你可以关闭os-prober。 如果需要,可以将自己的条目添加到40_custom,但随后会再次出现grub。

如果其他安装未找到菜单只有grub,应该直接启动。

将其添加到/ etc / default / grub:

 GRUB_DISABLE_OS_PROBER=true 

或者关闭os-prober上的执行位:

 sudo chmod ax /etc/grub.d/30_os-prober 

然后再次运行更新grub sudo update-grub

通常,如果只有一个OS运行,则选项GRUB_TIMEOUT=0将起作用。 如果GRUB 2的os-prober在运行/etc/grub.d/30_os-prober脚本时识别其他操作系统,则条件语句将禁用隐藏菜单超时function。 这也会禁用在启动过程中使用Shift键显示菜单的function。