重裝Win7後ubuntu啓動項不見的解決方法

轉載請註明地址:http://blog.csdn.net/ethan_xue/article/details/7538568

1.u盤刻錄ubuntu鏡像,只貼有難點的圖(從別的博客找的圖,懶的截圖了)



點寫入即可

2.設置bios爲usb 啓動

3.會從u盤進入ubuntu,點試用ubuntu

4.ctrl+alt+t打開終端輸入sudo -i(獲得管理員權限)

輸入fdisk -l(是小寫的字母'L',查看盤符列表)

會出現類似下面的信息:

           Disk /dev/sda: 320.1 GB, 320072933376 bytes 

    255 heads, 63 sectors/track, 38913 cylinders 
    Units = cylinders of 16065 * 512 = 8225280 bytes 
    Disk identifier: 0x70f7ab9c

    Device    Boot    Start   End Blocks    Id   System 
    /dev/sda1 1       1627     13060096     27   Unknown 
    Partition 1       does not end on cylinder boundary. 
    /dev/sda2 *       1627     1639102400   7    HPFS/NTFS 
    Partition 2 does not end on cylinder boundary. 
    /dev/sda3 1639     8166     52429859     7   HPFS/NTFS 
    /dev/sda4 8167     38913    246975277+   5   Extended 
    /dev/sda5 8167     32385    194539082+  7    HPFS/NTFS 
    /dev/sda6 32386    38788    51432066    83   Linux 
    /dev/sda7 38789    38913    1004031     82   Linux swap / Solaris

 然後找到ID爲83的盤符,根據上面顯示的信息可知當時裝ubuntu時是裝在sda6這個分區。有時會有多個83,可根據大小判斷哪個是真正的分區

5.在終端輸入mount /dev/sda* /mnt

  mount /dev/sda* /mnt/boot

   (*代表ubuntu系統所在的分區,即上一步顯示結果中ID爲83的分區號,如上面顯示的是在sda6這個分區,所以輸入的是mount /dev/sda6 /mnt

    注意:mount後面有一個空格,sda6後面也有一個空格,這兩個空格千萬不要漏掉,否則會報錯)

6.上一步結束之後,繼續在終端中輸入grub-install --root-directory=/mnt /dev/sda

   等待一會兒,若出現Installationfinished,No Error Reported則表示成功了

   (注意:grub-install之間沒有空格,--root前面有一個空格,--root前面是兩個'-',/mnt後面有一個空格)

7.到此,ubuntu引導基本恢復,重啓電腦後,就可以看到熟悉的ubuntu引導界面了,進入ubuntu系統,打開終端輸入

  sudo update-grub

  等待片刻顯示以下信息:

           Generating grub.cfg ... 
    Found linux image: /boot/vmlinuz-2.6.31-20-generic 
    Found initrd image: /boot/initrd.img-2.6.31-20-generic 
    Found memtest86+ image: /boot/memtest86+.bin 
    Found Windows Vista (loader) on /dev/sda1 
    Found Windows 7 (loader) on /dev/sda2 
    done

   恢復工作便全部完成了。

參考文章:http://www.cnblogs.com/dolphin0520/archive/2012/03/11/2390175.html

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章