Linux: grub修复

修复#

在liveCD下先挂载相应分区,然后使用grub-install进行修复。

注意:如果系统是使用systemd的,修复环境也要是基于systemd的(直接搞个ubuntu的livecd好了),否则grub-install可能会失败(提示 cannot read 'boot/efi': Is a folder)

mount /dev/sda2 /mnt
mount /dev/sda1 /mnt/boot/efi
mount -B /sys /mnt/sys
mount -B /dev /mnt/dev
mount -t proc /proc /mnt/proc
chroot /mnt
grub-mkconfig -o /boot/grub/grub.cfg  # 双系统注意观察grub-probe输出是否有windows字样
grub-install /boot/efi  (这是efi的,如果是mbr则是 grub-install /dev/sda1)

修改默认启动项#

默认的GRUB_DEFAULT为0,改为需要的即可,然后执行 grub-update 更新grub.cfg文件。(或grub-mkconfig -o /boot/grub/grub.cfg)

posted @   dylanchu  阅读(1055)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· AI技术革命,工作效率10个最佳AI工具
点击右上角即可分享
微信分享提示
主题色彩