歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> 雙硬盤雙Win8加Ubuntu修復Grub

雙硬盤雙Win8加Ubuntu修復Grub

日期:2017/2/28 14:38:15   编辑:Linux教程

雙硬盤雙win8加Ubuntu是條件,grub已經不能夠啟動了,要修復一下,使其能夠啟動這個3個系統。具體的分布是:硬盤A+Win8A 硬盤B+Win8B+ubuntu。現在默認啟動的是Win8。

使用LinuxLive USB Creator制作usb live,然後從u盤啟動。

Linux安裝助手LiLi USB Creator 2.8.25發布 http://www.linuxidc.com/Linux/2013-10/92052.htm

按照如下操作:

--------------------------------------------------------------------------

How to Repair, Restore, or Reinstall Grub 2 with a Ubuntu Live CD or USB

Grub 2 typically gets overridden when you install Windows or another Operating System. To make Ubuntu control the boot process, you need Reinstall (Repair/Restore) Grub using a Ubuntu Live CD.

Warning:

Using the sudo command, especially from a Live CD can do serious damage to your system. Read all instructions and confirm you understand before executing any commands. When pasting into the Terminal, use Ctrl+Shift+V, NOT Ctrl+V.

Terminal Commands:

Mount the partition your Ubuntu Installation is on. If you are not sure which it is, launch GParted (included in the Live CD) and find out. It is usually a EXT4 Partition. Replace the XY with the drive letter, and partition number, for example: sudo mount /dev/sda5 /mnt.

sudo mount /dev/sdXY /mnt

Now bind the directories that grub needs access to to detect other operating systems, like so:

sudo mount --bind /dev /mnt/dev && sudo mount --bind /dev/pts /mnt/dev/pts && sudo mount --bind /proc /mnt/proc && sudo mount --bind /sys /mnt/sys

Now we jump into that using chroot.

Now install, check, and update grub.

This time you only need to add the drive letter (usually a) to replace X, for example: grub-install /dev/sda, grub-install –recheck /dev/sda.

grub-install /dev/sdXgrub-install --recheck /dev/sdX

Now grub is back, all that is left is to exit the chrooted system and unmount everything.

exit && sudo umount /mnt/dev && sudo umount /mnt/dev/pts && sudo umount /mnt/proc && sudo umount /mnt/sys && sudo umount /mnt

Shut down and turn your computer back on, and you will be met with the default Grub2 screen.

You may want to update grub or re-install burg however you like it.

Congratulations, you have just Repaired/Restored/Reinstalled Grub 2 with a Ubuntu Live CD!

--------------------------------------------------------------------------

這裡說下注意事項:

1.制作的usb live用的ubuntu版本要和硬盤上已經裝的位數(同為32或者64)一致且最好是同一版本.否則有些命令不能使用。

2.對於第4步的grub-install /dev/sdX,後邊的“X”要是現在默認啟動的硬盤,如這邊的情況,應該對應的是硬盤A。

3.如何查看硬盤上不能啟動的ubuntu的版本號,可以去/etc/os-release中查看,也可以grep "VERSION" /etc -rn

4.如遇到“chroot:failed to run command '/bin/bash' :Exec Format error”,說明犯了1錯誤

5.關於讓默認啟動Win8的問題,修改/etc/grub.d/30_os-prober不再好使,因為它會prober出兩個win8最終還是不知道要啟動哪一個。如果要修改可以修改/boot/grub/grub.cfg。

Ubuntu 13.10 下載、安裝、配置 整理匯總 頁面 http://www.linuxidc.com/Linux/2013-10/91564.htm

Windows 7下硬盤安裝Ubuntu 13.10圖文教程 見 http://www.linuxidc.com/Linux/2013-10/91565.htm

Copyright © Linux教程網 All Rights Reserved