A-A+

安适如常:如何修复Grub启动菜单

2013年04月11日 软件技巧 阅读 24,780 views 次

之前曾写过《重装Windows后如何进入Ubuntu》,介绍了如何恢复被覆盖掉的Grub,重现Windows+Ubuntu的双系统启动菜单。

最近有Linux newbie朋友也再次问到了这个问题,而且根据小编的观察和总结,无论是Linux单系统用户,还是Windows+Linux双系统用户,会经常遇到Grub被覆盖或者被破坏的问题。故,掌握本文技能实属必要。

工欲善其事,必先利其器。作为Linuxer,手中须常备一张Ubuntu/LinuxMint的Live光盘或者U盘。用这个Live盘启动,进入Live系统,并打开一个终端。(以下步骤全部在终端中使用命令完成)

请确认你的Linux安装于哪个分区。关于磁盘分区的命名方式,请阅《重装Windows后如何进入Ubuntu》。比如小编的LinuxMint安装在sda7分区中。

把Linux所在的系统分区挂载在一个临时目录中:
sudo mount /dev/sda7 /mnt

依次执行下列命令,将系统必须的设备、映射等挂载:(请勿直接复制本文命令,bind前为2个连接符,WordPress将其连成一个了。)
sudo mount --bind /dev /mnt/dev
sudo mount --bind /dev/pts
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys

切换根目录:
sudo chroot /mnt

安装Grub:
grub-install /dev/sda

检查Grub:(请勿直接复制本文命令,recheck前为2个连接符,WordPress将其连成一个了。)
grub-install --recheck /dev/sda

更新Grub:
update-grub

退出临时挂载的系统,并逐个卸载之前挂载的目录:
exit
sudo umount /mnt/dev
sudo umount /mnt/dev/pts
sudo umount /mnt/proc
sudo umount /mnt/sys
sudo umount /mnt

现在,Grub就已经安装好了,你需要做的只是重启电脑,即可看到亲切的Grub启动菜单了。

标签:

13 条留言  访客:13 条  博主:0 条

  1. avatar 潇湘居士

    Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/litaowan/public_html/wp-content/themes/Ality/functions.php on line 263
  2. avatar 一生有我学习网

    Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/litaowan/public_html/wp-content/themes/Ality/functions.php on line 263
  3. avatar Jamie

    Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/litaowan/public_html/wp-content/themes/Ality/functions.php on line 263
  4. avatar zym

    Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/litaowan/public_html/wp-content/themes/Ality/functions.php on line 263
    • avatar 薄荷叶

      Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/litaowan/public_html/wp-content/themes/Ality/functions.php on line 263
      • avatar zym

        Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/litaowan/public_html/wp-content/themes/Ality/functions.php on line 263
        • avatar 薄荷叶

          Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/litaowan/public_html/wp-content/themes/Ality/functions.php on line 263
  5. avatar 长不大的彼得潘

    Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/litaowan/public_html/wp-content/themes/Ality/functions.php on line 263
    • avatar 长不大的彼得潘

      Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/litaowan/public_html/wp-content/themes/Ality/functions.php on line 263
  6. avatar 长不大的彼得潘

    Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/litaowan/public_html/wp-content/themes/Ality/functions.php on line 263
    • avatar 还魂草

      Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/litaowan/public_html/wp-content/themes/Ality/functions.php on line 263
  7. avatar zym

    Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/litaowan/public_html/wp-content/themes/Ality/functions.php on line 263
  8. avatar Kevin

    Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/litaowan/public_html/wp-content/themes/Ality/functions.php on line 263

给我留言

您必须 登录 才能发表留言!

Copyright © 薄荷开源网 保留所有权利.   Theme  Ality

用户登录

分享到: