Linux下载cfg命令,linux – 如何正确删除grub.cfg中的“搜索”命令?

我不希望grub“搜索”任何东西.我知道我的根文件系统在哪里,它总是在那里(/ dev / sda1),我不希望grub去查看所有连接的驱动器以找到其他根(它似乎总是发现错误)一).

我已经能够在内核加载行中禁用UUID:

GRUB_DISABLE_LINUX_UUID=true

在/ etc / default / grub中,但生成的/boot/grub/grub.cfg仍然包含以下行:

search –no-floppy –fs-uuid –set=root –hint-bios=hd0,msdos1 –hint-efi=hd0,msdos1 –hint-baremetal=ahci0,msdos1 3f8c2b36-5d8f-40ac-9b63-7d1445805925

而且我不想要那些.我根本不想搜索它.我进一步关闭了“os-probing”:

GRUB_DISABLE_OS_PROBER=true

这使得它无法在其他连接的磁盘上查找我的系统的备份副本,但我不想在grub中使用任何“搜索”命令的实例,更不用说我已经告诉它不要使用的UUID.

我讨厌grub.我只是希望我的机器能够使用root = / dev / sda1启动,而无需在我的系统中进行全面探测,而无需查找可能不存在的UUID,没有任何东西.就像1999年用LILO一样.

我实际上会使用LILO或syslinux或其他东西,如果它不是因为Ubuntu使用grub,因此如果我想能够跟上他们的内核更新,我几乎被迫使用它.我只是希望它是人类可能的最简单的配置(我知道它仍然会导致200行grub.cfg,但是很好).

解决方法:

这就是grub-mkconfig的工作原理:它会自动为它发现的每个内核创建GRUB菜单项.但是,如果您知道自己想要什么以及自己在做什么,则根本不需要使用Simple configuration,因为您可以直接编写grub.cfg.

grub-mkconfig does have some limitations. While adding extra custom

menu entries to the end of the list can be done by editing

/etc/grub.d/40_custom or creating /boot/grub/custom.cfg, changing the

order of menu entries or changing their titles may require making

complex changes to shell scripts stored in /etc/grub.d/. This may be

improved in the future. In the meantime, those who feel that it would

be easier to write grub.cfg directly are encouraged to do so (see

07001, and 07002), and to disable any system provided

by their distribution to automatically run grub-mkconfig.

在那里,你可以只用一个菜单项(禁用菜单),只需要你想要的简单设置.您可以告诉您要从此处启动此内核,就是这样.

单个menuentry {}可以是5行,而不是200行.

记住:

>首先通过将自定义菜单项添加到自定义条目来测试它.

>如果从系统中禁用grub-mkconfig,则需要在需要更新内核时手动更新grub.cfg.

标签:linux,ubuntu,grub

来源: https://codeday.me/bug/20190812/1642155.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值