CentOS7引导的更新与管理
2015-05-04 09:54
405 查看
最近新装了CentOS7,很多地方都不一样了。先装了windows7再装linux发现windows不能自动识别出来,只能到linux下修改了。
1.首先登入root账户,进入/boot/grub2中查看文件,(grub2和CentOS6用的grub不太一样,以前的方法已经不管用了)。
2.使用gedit grub.cfg打开文件,grub.cfg可以说是centos7的引导配置文件,看下面
这个文件是用模板/etc/grub.d和设置/etc/default/grub生成的。既然是生成的,那就有命令可以再重新生成引导。
3.进入目录 ls /sbin查到类似命令grub2-mkconfig,试了一下生成内容和grub.cfg大体相同。用man grub2-mkconfig查询命令的用法,得到如下解释:
4.现在开始生成。首先保存原始文件,用命令cp grub.cfg grub.cfg.bak ,然后依照3中提示打入命令grub2-mkconfig -o /boot/grub2/grub.cfg,如下图所示
现在重新启动一下,发现引导没有改变。继续
5.在/sbin里发现一个命令grub2-install,用man查询一下用法,之后键入命令grub2-install /dev/sda。
好了,下面要把windows设置成默认启动项。
先找到/etc/grub.d中,看README写了什么(这里我就不翻译了)
All executable files in this directory are processed in shell expansion order.
00_*: Reserved for 00_header.
10_*: Native boot entries.
20_*: Third party apps (e.g. memtest86+).
The number namespace in-between is configurable by system installer and/or
administrator. For example, you can add an entry to boot another OS as
01_otheros, 11_otheros, etc, depending on the position you want it to occupy in
the menu; and then adjust the default setting via /etc/default/grub.
再看看我的文件夹里都有什么文件
试一下把30_os-prober修改成01_os-prober,命令为mv 30_os-prober 01_os-prober,再重新生成grub2.cfg文件,发现windows启动项已经排到前面了
参考资料:http://blog.sina.com.cn/s/blog_64d57e710100mjuk.html
1.首先登入root账户,进入/boot/grub2中查看文件,(grub2和CentOS6用的grub不太一样,以前的方法已经不管用了)。
2.使用gedit grub.cfg打开文件,grub.cfg可以说是centos7的引导配置文件,看下面
这个文件是用模板/etc/grub.d和设置/etc/default/grub生成的。既然是生成的,那就有命令可以再重新生成引导。
3.进入目录 ls /sbin查到类似命令grub2-mkconfig,试了一下生成内容和grub.cfg大体相同。用man grub2-mkconfig查询命令的用法,得到如下解释:
4.现在开始生成。首先保存原始文件,用命令cp grub.cfg grub.cfg.bak ,然后依照3中提示打入命令grub2-mkconfig -o /boot/grub2/grub.cfg,如下图所示
现在重新启动一下,发现引导没有改变。继续
5.在/sbin里发现一个命令grub2-install,用man查询一下用法,之后键入命令grub2-install /dev/sda。
好了,下面要把windows设置成默认启动项。
先找到/etc/grub.d中,看README写了什么(这里我就不翻译了)
All executable files in this directory are processed in shell expansion order.
00_*: Reserved for 00_header.
10_*: Native boot entries.
20_*: Third party apps (e.g. memtest86+).
The number namespace in-between is configurable by system installer and/or
administrator. For example, you can add an entry to boot another OS as
01_otheros, 11_otheros, etc, depending on the position you want it to occupy in
the menu; and then adjust the default setting via /etc/default/grub.
再看看我的文件夹里都有什么文件
试一下把30_os-prober修改成01_os-prober,命令为mv 30_os-prober 01_os-prober,再重新生成grub2.cfg文件,发现windows启动项已经排到前面了
参考资料:http://blog.sina.com.cn/s/blog_64d57e710100mjuk.html
相关文章推荐
- 开源接口管理平台 eoLinker AMS开源版 V3.2.1更新,Mock增加允许新请求头!
- 活字格企业Web应用生成器V3.0发布更新,支持插件管理和多人协作开发
- 测试管理_各个阶段的工作要求[持续更新ing]
- EF Codefirst 初步学习(二)—— 程序管理命令 更新数据库
- centos7 环境下新增硬盘及LV管理
- 在Linq to Sql中管理并发更新时的冲突(2):引发更新冲突
- centos7引导Windows,实现双系统选择启动
- centos7更改yum源为网易源与更新系统
- 源泉书签,助您管理海量收藏。今日更新【里程碑】支持书签导出功能了,从此不怕网络书签丢失了,随时随地备份您的书签。
- 关于组件化开发中常用到的svn,cocoapods代码管理工具错误解决办法(持续更新)
- 利用subversion,usvn,rsync,cwrsyn,管理Windows Server IIS 站点文件的更新(3)
- 高校学生信息管理系统C#窗体版更新(一)
- git和github实用步骤记录,及git.oschina私有代码管理步骤记录(更新中)
- Unity 资源管理与更新
- 关于信用管理--信用更新
- Bing网站管理工具更新体验 功能强劲
- Cocos2dx 3.0rc particle粒子管理(更新,封装粒子管理,提高生产效率)
- centos7安装docker镜像源管理工具harbor 推荐
- Android下的配置管理之道之Centos7安装配置gitlab
- tomcat线上更新后台管理程序代码