2016年9月23日 星期五

Win 10 與 ubuntu 刪除磁碟區錯誤

原本C碟有 Win10 與 ubuntu  16 系統(切出40g 硬碟給他)
然後我在Win10 把給ubuntu的磁碟區刪除   擴展回去給Win10

結果發生無法開機的狀況   畫面上出現

error: unknown filesystem.
grub rescue>

看起來是grub配置找不到開機的畫面了

好加在我系統中還有一個 ubuntu14是可以使用的   應為需要更新 grub2

解決方案:


如何搶救 Linux 上不能開機的 GRUB 2
http://www.openfoundry.org/tw/foss-programs/9267-linux-grub2-fixing

提示:
先從 grub rescue找到 ubuntu14的磁碟  然後進入 ubuntu14的開機程序

使用 ls  指令   查出有哪些磁區
查出哪個磁區有 boot資料夾   例如是 (hd0, msdos3)    ps. msdos可以省略
     
grub rescue> set prefix=(hd0,1)/boot/grub
grub rescue> set root=(hd0,1)
grub rescue> insmod normal
grub rescue> normal
grub rescue> insmod linux
grub rescue> linux /boot/vmlinuz-3.13.0-29-generic root=/dev/sda1
grub rescue> initrd /boot/initrd.img-3.13.0-29-generic
grub rescue> boot

然後在ubuntu14中去更新grub   執行以下命令

# sudo update-grub
Generating grub configuration file ...
Found background: /usr/share/images/grub/Apollo_17_The_Last_Moon_Shot_Edit1.tga
Found background image: /usr/share/images/grub/Apollo_17_The_Last_Moon_Shot_Edit1.tga
Found linux image: /boot/vmlinuz-3.13.0-29-generic
Found initrd image: /boot/initrd.img-3.13.0-29-generic
Found linux image: /boot/vmlinuz-3.13.0-27-generic
Found initrd image: /boot/initrd.img-3.13.0-27-generic
Found linux image: /boot/vmlinuz-3.13.0-24-generic
Found initrd image: /boot/initrd.img-3.13.0-24-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
done
# sudo grub-install /dev/sda
Installing for i386-pc platform.
Installation finished. No error reported.

沒有留言:

張貼留言