该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
5、安装Grub到U盘上:
[star@localhost ~]$ sudo grub-install
--root-directory=/media/test/ /dev/sdb
Probing
devices to guess BIOS drives. This may take a long time.
Installation
finished. No error reported.
This is the
contents of the device map
/media/test//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'.
(fd0)
/dev/fd0
(hd0)
/dev/sda
(hd1)
/dev/sdb
6、复制当前系统的menu.lst到u盘grub下:
[star@localhost ~]$ sudo cp /boot/grub/menu.lst
/media/test/boot/grub/
7、根据实际情况修改menu.lst。
8、安装grub到MBR:
[star@localhost ~]$ sudo grub
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> find
/boot/grub/stage1
(hd0,5)
(hd1,0)
grub> root (hd1,0)
Filesystem
type is ext2fs, partition type 0x83
grub> setup (hd1)
Checking if
"/boot/grub/stage1" exists... yes
Checking if
"/boot/grub/stage2" exists... yes
Checking if
"/boot/grub/e2fs_stage1_5" exists... yes
Running "embed /boot/grub/e2fs_stage1_5
(hd1)"... 19 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd1)
(hd1)1+19 p (hd1,0)/boot/grub/stage2
/boot/grub/menu.lst"... succeeded
Done.
grub> quit
9、卸载就OK了,即完成了。以后就可以使用这个U盘来引导或修复系统了。