grub安裝(轉)

ba發表於2007-08-13
grub安裝(轉)[@more@]在grub下, 磁碟的命名是bsd格式,

hd0是第一個盤,hd1第二個盤, hd1可能是hdb也可能是hdc也可能是sda

hd0,0是第一分割槽, hd0,0 是 /dev/hda1 hd0,1 是 /dev/hda2 .... hd0,5 是 /dev/hda6....

grub的有一個自己的命令介面,在啟動時,安c可以進入, 或者在linux下直接執行grub出現命令介面.

grub下的命令支援tab補全. 也可以用tab對檔名進行補全.

在grub命令介面, 常用的幾個命令有:

root (hd0,0) ;指定/dev/hda1做為根

kernel /boot/vmlinuz root=.... ;指定要調入的核心 以及引數

initrd /boot/initrd.img ;指定ramfs啟動映像

boot ;開始啟動

;上面幾條可以從一個不能啟動硬碟恢復啟動.

setup ;此命令,可以用於在grub命令介面向硬碟安裝grub啟動支援.

faq:

問:我已經在用檔案複製 在/dev/hdc6 建立了一個linux系統,如何讓它可以啟動?

答:將grub安裝到mbr,以下命令,

#:grub
Probing devices to guess BIOS drives. This may take a long time.

GNU GRUB version 0.97 (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>root (hd1,5) ;指定根是/dev/hdc6
Filesystem type is ext2fs, partition type 0x83
grub>setup --stage2=/boot/grub/stage2 --prefix=/boot/grub (hd1)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/e2fs_stage1_5" exists... yes
....
grub>quit


直接用grub-setup來安裝:

grub-setup hd1

製作一個grub軟盤:

grub-floppy /dev/fd0

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10617731/viewspace-952728/,如需轉載,請註明出處,否則將追究法律責任。

相關文章