<meter id="pryje"><nav id="pryje"><delect id="pryje"></delect></nav></meter>
          <label id="pryje"></label>

          新聞中心

          EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計應(yīng)用 > 教你如何學(xué)習(xí)GRUB

          教你如何學(xué)習(xí)GRUB

          作者: 時間:2016-09-12 來源:網(wǎng)絡(luò) 收藏

          只有少數(shù)情況下,才需要將 引導(dǎo)裝入器重新安裝到引導(dǎo)記錄。首先,如果更改 root 分區(qū)的分區(qū)類型(例如,從 ext2 改成 ReiserFS),則需要重新安裝?;蛘撸绻?/boot/grub 中的 stage1 和 stage2 文件,由于它們來自更新版本的 ,很有可能要重新安裝引導(dǎo)裝入器。其它情況下,可以不必理睬!

          GRUB的最大的特點就是交互性特別強。在開機時,按一下“c”,將進入GRUB 控制臺。顯示如下:

          GRUB version 0.5.96.1 (640K lower / 3072K upper memory)

          [ Minimal BASH-like line editing is supported. For the first word, TAB

          lists possible command completions. Anywhere else TAB lists the possible

          completions of a device/filename. ]

          grub>

          歡迎使用 GRUB 控制臺?,F(xiàn)在,再研究命令:

          將通過GRUB 控制臺繞過lilo來啟動RedHat ,

          grub> root (h

          現(xiàn)在,按一次 Tab 鍵。如果系統(tǒng)中有多個硬盤,GRUB 將顯示可能完成的列表,從 hd0 開始。如果只有一個硬盤,GRUB 將插入 hd0,。如果有多個硬盤,繼續(xù)進行,在 (hd2 中輸入名稱并在名稱后緊跟著輸入逗號,但不要按 Enter 鍵。部分完成的 root 命令看起來如下:

          grub> root (hd0,

          現(xiàn)在,繼續(xù)操作,再按一次 Tab 鍵。GRUB 將顯示特定硬盤上所有分區(qū)的列表,以及它們的文件系統(tǒng)類型。在我的系統(tǒng)中,按 Tab 鍵時得到以下列表:

          grub> root (hd0, (tab,按tab一下鍵)

          Possible partitions are:

          Partition num: 0, Filesystem type is fat, partition type 0x6

          Partition num: 2, Filesystem type is ext2fs, partition type 0x83

          Partition num: 4, Filesystem type unknown, partition type 0x7

          Partition num: 5, Filesystem type is ext2fs, partition type 0x83

          Partition num: 6, Filesystem type is fat, partition type 0xb

          Partition num: 7, Filesystem type is fat, partition type 0xb

          Partition num: 8, Filesystem type is ext2fs, partition type 0x83

          Partition num: 9, Filesystem type unknown, partition type 0x82

          如您所見,GRUB 的交互式硬盤和分區(qū)名稱實現(xiàn)功能非常有條理。這些,只需要好好理解 GRUB 新奇的硬盤和分區(qū)命名語法,然后就可以繼續(xù)操作了

          grub> root (hd0,8)

          現(xiàn)在已安裝了 root 文件系統(tǒng),到裝入內(nèi)核的時候了

          grub> kernel /boot/vmlinuz-2.4.2 root=/dev/hda5 ro

          [Linux-bzImage, setup=0x1200, size=0xe1a30]

          您已經(jīng)安裝了 root 文件系統(tǒng)并裝入了內(nèi)核?,F(xiàn)在,可以引導(dǎo)了。只要輸入 boot,Linux 引導(dǎo)過程就將開始。是不是很cool啊,GRUB的menu.lst更像一個下的腳本程序。

          5 常見grub除錯方法的思路

          首先進去Linux的rescue模式!

          用軟盤或光盤啟動,然后在啟動的提示符輸入: rescue

          按照提示進入一個Shell狀態(tài),你可以到/mnt/下面看到一個sysimage這么目錄,進去以后,就是你安裝linux的/分區(qū).

          使用命令將根分區(qū)變?yōu)楫?dāng)前目錄的根分區(qū):chroot /mnt/sysimage

          然后轉(zhuǎn)到/sbin/這個目錄中.

          使用fdisk -l 顯示當(dāng)前分區(qū)情況,然后使用#grub-install /dev/hdx(x為你使用的是那塊硬盤安裝的,一般情況下是hda)

          使用exit推出chroot,再使用exit退出linux rescue模式,系統(tǒng)將重新啟動!取出光盤,應(yīng)該可以看到grub安裝好了.

          在具體的環(huán)境中,編輯/boot/grub/grub.conf文件和menu.lst文件.


          上一頁 1 2 3 4 5 下一頁

          關(guān)鍵詞: GRUB linux

          評論


          相關(guān)推薦

          技術(shù)專區(qū)

          關(guān)閉
          看屁屁www成人影院,亚洲人妻成人图片,亚洲精品成人午夜在线,日韩在线 欧美成人 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();