ubuntu用livecd修複grub2

來源:互聯網
上載者:User

ubuntu用livecd修複grub2 首先用livecd啟動,然後在終端下切換到root許可權:(你不嫌麻煩的話可以跳過這一步,在一下的每一步前面加sudo)  www.2cto.com  sudo -i 接下來找一找你ubuntu10.04所在分區,用: fdisk -l 我的部分輸出如下: Device Boot      Start         End      Blocks   Id  System/dev/sda1               1         914     7341673+  12  Compaq diagnostics/dev/sda2   *         915        4967    32554359    7  HPFS/NTFS/dev/sda3            4968        8006    24410767+  83  Linux/dev/sda4            8007       19457    91980126+   5  Extended/dev/sda5            8007       14085    48829536   83  Linux/dev/sda6           14086       14328     1951866   82  Linux swap / Solaris/dev/sda7           14329       14344      128488+  83  Linux/dev/sda8           18485       19457     7815591    b  W95 FAT32/dev/sda9           14345       18308    31839232   83  Linux/dev/sda10          18308       18484     1413120   82  Linux swap / Solaris 內容有點多,因為我是3系統- -!,而我ubuntu10.04根目錄所在的分區就是/dev/sda9,如果你不確定的話就找id為83的吧。  www.2cto.com  下面掛載原系統的根目錄: mount /dev/sda9 /mnt 將/dev/sda9掛載到了/mnt下,當然你也可以選其他地方,這裡注意如果你有單獨為/boot分區的話,要單獨掛載一次/boot,比如說 如果你原來的/boot掛載到/dev/sda12上了,那個你這裡要再輸入mount /dev/sda12 /mnt/boot。我這裡沒有把它單獨分出來,所以就不需要了。  www.2cto.com  下面是最後一步了: grub-install --root-directory=/mnt /dev/sda 這裡我剛開始的時候自做主張的寫成了grub-install –root-directory=/mnt /dev/sda9,同學們不要學我,- -! 如果看到 Installation finished.No Error Reported. 就表示已經成功啦!重啟看看,熟悉的grub引導畫面是不是又回來了? 最後贊一下強大的man,第一次修複grub,基本靠man就能解決了。 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.