雙硬碟雙Win8加Ubuntu修複Grub

來源:互聯網
上載者:User

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

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

Linux安裝助手LiLi USB Creator 2.8.25發布 

按照如下操作:

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

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 下載、安裝、配置 整理匯總 頁面

Windows 7下硬碟安裝Ubuntu 13.10圖文教程 見

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.