安裝多個linux系統可能出現的一個問題

來源:互聯網
上載者:User


  文章轉載自:
http://www.xnlinux.cn/thread-1753-1-1.html         

    在linux檔案系統中硬碟分區是從1開始的,sda的第一個分區即是sda1 ,但是grub在識別硬碟分區的時候卻是從0開始的,sda1即被grub識別為hd0,0 ,只要注意到這一點就行了。

   我的電腦以前裝有win7和ubuntu10.04,最近安裝了RHEL6,結果ubuntu的啟動項直接丟失了

   於是進入紅帽,sudo vi/boot/grub/grub.conf

    然後進入ubuntu的檔案系統,sudo vi/boot/grub/grub.conf

    接著我sudo fdisk -l

   將ubuntu中grub檔案所列的ubuntu的資訊按照紅帽grub檔案的格式添加到紅帽的grub檔案中,重啟,啟動項雖然有了,但是還是不能啟動,提示:Cannot mount selected partition

   糾結了半天,差點把ubuntu卸掉。。。

    後來google了一下錯誤資訊,發現了問題的所在,原來一切的一切都歸咎於一個數字。。。
    title Ubuntu
        root (hd0,7)
        kernel /boot/vmlinuz-2.6.32-21-generic                                 root=UUID=e9f9d111-8ba2-448b-95d9-92c36dc13f52 ro quiet splash
        initrd /boot/initrd.img-2.6.32-21-generic
這是紅帽grub檔案中關於ubuntu的資訊,其中root(hd0,7)
注意這個7
我又sudo fdisk -l了一下
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            3679       10230    52628940   83  Linux
/dev/sda2   *       10231       17242    56323890    7  HPFS/NTFS
/dev/sda3           17243       38913   174072277    f  W95 Ext'd (LBA)
/dev/sda4               1        3678    29542400   83  Linux
/dev/sda5           17243       24890    61432528+   7  HPFS/NTFS
/dev/sda6           24891       31265    51207156    7  HPFS/NTFS
/dev/sda7           31266       38404    57343986   83  Linux
/dev/sda8           38405       38913     4088511   82  Linux swap / Solaris
突然發現ubuntu對應的是/dev/sda7 ,這樣的話他在grub檔案中應該對應root(hd0,6)
於是改成6,重啟,ok

相關文章

聯繫我們

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