歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> 升級Ubuntu 12.04所遇到的一些問題

升級Ubuntu 12.04所遇到的一些問題

日期:2017/2/28 15:52:22   编辑:Linux教程

升級Ubuntu 11.10到12.04後,開機報錯“no partition found”,進入Grub後,輸入"ls"命令,也報錯“no partition found”。可見Grub已經崩潰了。

於是我下載了UNetbootin,然後利用它在Win 7下制作Ubuntu自啟動U盤。制作好之後,結果發現不會自動引導啟動,需要在開機之後出現Thinkpad歡迎界面時按F12,然後選擇U盤啟動。然後選擇U盤啟動Ubuntu,進入Ubuntu後按照 How to Fix Grub 2 中的方法安裝Grub 2到硬盤。

To fix GRUB 2, you need an Ubuntu live CD from which you need to boot. Once you boot to the LIVE CD, open a terminal an and type these commands:
a) Firstly, you need to find out on which partition your Linux system is installed:
sudo fdisk -l
(in my case, it's "sda1")

b) Now, we must mount this partition:
sudo mount /dev/sda1 /mnt
Where "sda1" is the partition where you installed Ubuntu (or any other Linux distro). It could be "sda5", "sda6", etc. for you.

c) Install grub to the partition you've mounted:
sudo grub-install --root-directory=/mnt/ /dev/sda


Important: Please notice that it's "/dev/sda", not "/dev/sda1". "sda" is the hard disk on which your Linux distribution is installed!

d) Restart your computer. As previous Grub 2 entries are removed, run the following command to restore them:
sudo update-grub

我以前是用USB Stick安裝的Ubuntu,在安裝過程中有一選項是選擇引導程序的安裝位置,默認是/dev/sdb,也就是U盤。因為當時我沒注意,所以Grub 2被安裝到了U盤,盡管事後重新安裝到了硬盤上,但貌似升級後還是不太正常。

重啟電腦進入Grub 2之後,輸入命令(Grub 2中已經不再支持kernel命令,需要用linux指定kernel):

  1. linux (hd0,X)/vmlinuz-3.2......
  2. initrd (hd0,X)/initrd.img-3.2......
  3. boot

悲哀的是系統啟動到一半仍然無法進入GUI或者shell。多次檢查測試後確認 / 所在的分區已經崩潰,Ubuntu根本無法識別。

雖然不想,但此時我已別無選擇,只能重新安裝Ubuntu 12.04了。可惜我電腦裡那些尚未備份的文件和電影啊……

更多Ubuntu相關信息見Ubuntu 專題頁面 http://www.linuxidc.com/topicnews.aspx?tid=2

Copyright © Linux教程網 All Rights Reserved