CentOS7重新生成 /boot/grub2/grub.cfg
CentOS7重新生成 /boot/grub2/grub.cfg
CentOS7 is using grub2 and the generated /boot/grub2/grub.cfg
rather than the old grub.conf
format, which is why you can't find it. The new grub.cfg file is not intended for direct editing, instead you need to modify the source files that are used to generate it.
The files in question are /etc/default/grub
and the scripts in /etc/grub.d/
. In particular, if you are looking to add your own custom entries, then you will want to append a boot stanza to /etc/grub.d/40_custom
. The stanza will look something like this:
menuentry "My custom boot entry" {
set root=(hd0,1)
linux /vmlinuz-3.11-custom
initrd /initrd-plymouth.img
}
You can add the usual options to the linux
line to pass in custom options to the kernel. Once you have everything looking the way you want it to, you run:
grub2-mkconfig --output=/boot/grub2/grub.cfg
Then, if you want to alter the default boot entry, you change the GRUB_DEFAULT
option in /etc/default/grub
to point to the new stanza you added, by zero indexed position or by name (I prefer name), something like this:
GRUB_DEFAULT="My custom boot entry" 修改/etc/default/grub
GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/swap vconsole.font=latarcyrheb-sun16 rd.lvm.lv=centos/root crashkernel=auto vconsole.keymap=us rhgb quiet"
GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/swap vconsole.font=latarcyrheb-sun16 rd.lvm.lv=centos/root crashkernel=auto enforcing=0 vconsole.keymap=us rhgb quiet"
添加enforcing=0
存盘退出
执行 grub2-mkconfig --output /boot/grub2/grub.cfg OK
CentOS7重新生成 /boot/grub2/grub.cfg的更多相关文章
- fedora 28 重新生成 /boot/grub2/grub.cfg
使用情景: 之前电脑安装了windows 7/ fedora 28 双系统,由于特殊原因,需要删除 windows 系统.在格式化硬盘后,我们还需要跟新 grub2 的启动条目:删除grub 启动的界 ...
- 破解CentOS7的root及加密grub修复实战
破解CentOS7的root及加密grub修复实战 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.破解CentOS7的root口令方案1 1>.启动时任意键暂停启动 2& ...
- CentOS7 Linux中通过加密grub防止黑客通过单用户系统破解root密码
如何防止别人恶意通过单用户系统破解root密码,进入系统窃取数据? 给grub加密,不让别人通过grub进入单用户. 17.3.1 基于centos6进行grub加密 [root@63 ~]# gr ...
- CentOS7密码忘记解决方法&&GRUB菜单加密
CentOS7的root密码忘记怎么办 注意:该方法只适用于Linux7版本,可以用cat /redhat-release 查看 这里这里只介绍一种方法 1.启动的时候,在启动界面,相应启动项,内核名 ...
- centos7备份还原与grub2引导和rescue模式修改root密码
一.centos7备份1.su -2.cd /3.tar -zpPcvf backup.tgz --exclude=/sys --exclude=/mnt --exclude=/proc --excl ...
- Ubuntu grub2的启动配置文件grub.cfg,为了修改另人生厌的时间
文章转自http://hi.baidu.com/detax/blog/item/90f18b54a8ef5253d00906e4.html 升级到Ubuntu 9.10后,就要接触grub2了,它和以 ...
- linux下怎么修改grub.cfg
一.grub2的启动配置文件grub.cfggrub2的启动配置文件grub.cfg是/boot/grub/grub.cfg,而不是以前的memu.lst.如果你是多系统,有Ubuntu和window ...
- CentOS7 修复grub.cfg文件
为了达到实验目的,首先删除grub.cfg文件 重启后发现系统进不去了,这正是我们想要的 进入系统救援模式,通过输入以下命令修复grub.cfg文件 重启后发现能正常引导进入系统了
- grub.cfg文件编辑
grub2启动项里面找不到Windows的情况,这时候就需要自己去配置grub.cfg 在grub.cfg中加入如下代码: menuentry 'Windows Boot Manager (on /d ...
随机推荐
- 踩坑日志!viser-ng的使用
在ng-alian项目中使用viser图表库,在app.module中引用了viser-ng,然而,在具体的html项目中使用<v-chart>会报错,提示v-chart不是一个angul ...
- 函数定义和调用 -------JavaScript
本文摘要:http://www.liaoxuefeng.com/ 定义函数 在JavaScript中,定义函数的方式如下: function abs(x) { if (x >= 0) { ret ...
- tomcat的启动和部署
方法/步骤 1 一.安装JDK和Tomcat 1,安装JDK:直接运行jdk-7-windows-i586.exe可执行程序,默认安装即可. 备注:路径可以其他盘符,不建议路径包含中文名及特殊符号. ...
- 记录JQ-WEUI中滚动加载的一个BUG
最近写微信公众号,用到的技术栈是jq+vue的混合开发,采用的UI是移动端比较火的WEUI,在微信开发中应该较广泛.个人看惯了elementUI文档,相对于饿了么组件文档的详细,WEUI的文档还是比较 ...
- PHP数据库扩展 - PDO操作
PDO操作 PDO操作 描述:odp是php对数据库操作统一化的操作 语法:$pdo = new PDO("DB名:host=主机名;dbname=DB名","DB账号& ...
- MySQL - FIND_IN_SET 函数使用方法
SELECT * FROM xxxTableName x WHERE FIND_IN_SET(x.id, '1,2,3,4,5,6,7,8'); 如上查询,意为:xxxTableName 表中 x ...
- java的模运算
在学习某个加密算法的时候留意到模运算,仔细查了资料后才注意到Java中的 % 其实是取余而不是取模,但是百度的时候找到的很多文章都把Java的 % 直接当成取模来用了,为了少踩坑所以自己整理了一下写了 ...
- forEach 以及 IE兼容
语法 array.forEach(function(currentValue, index, arr), thisValue) 参数 参数 描述 function(currentValue, in ...
- python3 练习题100例 (十二)
题目十二:打印出所有的"水仙花数",所谓"水仙花数"是指一个三位数,其各位数字立方和等于该数本身.例如:153是一个"水仙花数",因为153 ...
- 1 > 2 and 3 < 4 or 4 > 5 and 2 > 1 or 9 < 8
a,b,c,d,e,f,g=1,2,3,4,5,8,9 m = a > b and c < d or c > e n = b > a or g < f x = m and ...