双系统windows+linux
发布日期:2022-02-12 16:07:00 浏览次数:14 分类:技术文章

本文共 961 字,大约阅读时间需要 3 分钟。

1.先装了windows

2.后拿一个磁盘装linux

2.1装完centos linux后,在grub2启动选项中没有看到win启动菜单,原因是centos没有识别ntfs分区:

解决如下:

a. 添加EPEL源(ntfs-3g在该源中):

$ yum search epel
# yum install epel-release
b. 安装ntfs-3g用于识别ntfs分区:
# yum install ntfs-3g(ntfs-3g.x86_64)
c. 重新生成引导项:(即运行update-grub2)

# grub2-mkconfig -o /boot/grub2/grub.cfg

cat update-grub2#!/bin/shset -eexec grub-mkconfig -o /boot/grub/grub.cfg "$@"

其他相关:

如果是三系统,第一个装的是windows,第二个是centos, 第三个ubuntu,我的做法是装第三个系统前先删除第二个系统的boot,由第三个系统来装新的boot,更新update-grub2后能识别出三个系统。

[root@localhost grub.d]# ls /etc/grub.d

00_header  01_users  20_linux_xen     30_os-prober  41_custom
00_tuned   10_linux  20_ppc_terminfo  40_custom     README
grub> ls

grub> set

在grub-rescue下:

set root=hd1,msdos8

set prefix=(hd1,msdos8)/boot/grub

insmod normal

normal

进入linux,打开控制台,更新grub

sudo update-grub2

 

grub设置默认启动项:

使用“sudo vim /etc/default/grub”命令打开该配置文件。

其中的“GRUB_DEFAULT=0”就是设置的默认启动项了。GRUB启动项是按照启动菜单依次使用数字进行索引了,起始数字为0。结合前面的系统启动菜单,如Windows8的启动项在第5项,因此这里我们就需要修改为4(因为第一项是从0开始的)。

转载地址:https://blog.csdn.net/wellsmith/article/details/92847498 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:Centos 安装桌面系统及虚拟化设置
下一篇:ubuntu18 设置静态IP

发表评论

最新留言

做的很好,不错不错
[***.243.131.199]2024年04月21日 15时43分35秒