1、install命令
install: install [--stage2=STAGE2_FILE] [--force-lba] STAGE1 [d] DEVICE STAGE2 [ADDR] [p] [CONFIG_FILE] [REAL_CONFIG_FILE]STAGE1:指定stage1文件所在绝对路径。DEVICE:指定vstage1装载的位置。STAGGE2:指定stage2文件所在绝对路径。ADDR:指定装载stage2的位置,如果不写,系统自动决定。例如:boot为独立分区时:grub> root (hd0,0)root (hd0,0)Filesystem type is ext2fs, partition type 0x83grub> install /grub/stage1 (hd0) /grub/stage2 p /grub/grub.confinstall /grub/stage1 (hd0) /grub/stage2 p /grub/grub.confboot为非独立分区时:grub>root (hd0,0)grub>install /boot/grub/stage1 (hd0) /boot/grub/stage2 p /boot/grub/grub.conf
grub> root (hd0,0)root (hd0,0)Filesystem type is ext2fs, partition type 0x83grub> setup (hd0)setup (hd0)Checking if "/boot/grub/stage1" exists... noChecking if "/grub/stage1" exists... yesChecking if "/grub/stage2" exists... yesChecking if "/grub/e2fs_stage1_5" exists... yesRunning "embed /grub/e2fs_stage1_5 (hd0)"... 26 sectors are embedded.succeededRunning "install /grub/stage1 (hd0) (hd0)1+26 p (hd0,0)/grub/stage2 /grub/grub.conf"... succeeded
[root@client ~]# grub-install hd0 (或者是grub-install /dev/sda也行)Installation finished. No error reported.This is the contents of the device map /boot/grub/device.map.Check if this is correct or not. If any of the lines is incorrect,fix it and re-run the script `grub-install‘.# this device map was generated by anaconda(hd0) /dev/sda
原文:http://www.cnblogs.com/black-mamba/p/4883775.html