当前位置: 首页 > news >正文

Ubuntu修改双系统默认启动顺序

1.打开grub的默认启动配置文件

sudo gedit /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_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

2.修改默认启动项

GRUB_DEFAULT=4
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=3
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

GRUB_DEFAULT设置默认启动的系统菜单选项,默认是从0开始的;

3.更新生效配置

$ sudo update-grub
[sudo] mango 的密码: 
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-6.2.0-36-generic
Found initrd image: /boot/initrd.img-6.2.0-36-generic
Found linux image: /boot/vmlinuz-6.2.0-26-generic
Found initrd image: /boot/initrd.img-6.2.0-26-generic
Found linux image: /boot/vmlinuz-5.17.0-1035-oem
Found initrd image: /boot/initrd.img-5.17.0-1035-oem
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
Found Windows 10 on /dev/sda1
done

4.grub配置的生成

/etc/default/grub 提供了一些简单的配置选项来控制grub的执行流程;
/etc/grub.d 目录中放置了一些脚本,用于生成/boot/grub/grub.cfg文件;
update-grub 此命令会使用以上两个文件生成最终的配置文件/boot/grub/grub.cfg;

$ ls /etc/grub.d
00_header        10_linux_zfs   30_os-prober      40_custom
05_debian_theme  20_linux_xen   30_uefi-firmware  41_custom
10_linux         20_memtest86+  35_fwupd          README
http://www.lryc.cn/news/416012.html

相关文章:

  • 高仲富:49岁搞AI,白天种菜卖菜,晚上学数学搞程序
  • 光线追踪(纹理映射)
  • 传统产品经理VS现在AI产品经理,你要学习的太多了,超详细收藏我这一篇就够了
  • C#使用Socket实现TCP服务器端
  • MTK联发科MT8766/MT8166安卓核心板性能参数对
  • ps绘制动图
  • AI学习指南机器学习篇-强化学习和深度学习简介
  • yolov8 bytetrack onnx模型推理
  • ImageNet数据集和CIFAR-10数据集
  • Go语言编程大全,web微服务数据库十大专题精讲
  • 【LabVIEW学习篇 - 13】:队列
  • 大语言模型综述泛读之Large Language Models: A Survey
  • 奇偶函数的性质及运算
  • 代码随想录 day 32 动态规划
  • 支持目标检测的框架有哪些
  • 原神自定义倒计时
  • top命令实时监测Linux进程
  • Rust 所有权
  • Python面试题:结合Python技术,如何使用PyTorch进行动态计算图构建
  • 基于RHEL7的服务器批量安装
  • C. Light Switches
  • LabVIEW机器人神经网络运动控制系统
  • Qt WebEngine播放DRM音视频
  • 渗透小游戏,各个关卡的渗透实例
  • SpringBoot集成阿里百炼大模型(初始demo) 原子的学习日记Day01
  • 高级java每日一道面试题-2024年8月06日-web篇-cookie,session,token有什么区别?
  • Python 图文:小白也能轻松生成精美 PDF 报告!
  • AQS的ReentrantLock源码
  • CSP-J 模拟题2
  • 途牛养车省养车平台源码 买卖新车租车二手车维修装潢共享O2O程序源码