本帖来源于互联网(
链接),摘录部分在此以备用。
Restore GRUB
1.Mount the Gentoo Partitions
# mount /dev/hda6 /mnt/gentoo
# mount /dev/hda2 /mnt/gentoo/boot
2.Mount
the /proc filesystem on /mnt/gentoo/proc to allow the installation to
use the kernel-provided information within the chrooted environment,
and then mount-bind the /dev filesystem.
# mount -t proc none /mnt/gentoo/proc
# mount -o bind /dev /mnt/gentoo/dev
3.This chrooting is done in three steps.
First we will change the root from / (on the installation medium) to /mnt/gentoo (on your partitions) using chroot.
Then we will create a new environment using env-update, which essentially creates environment variables.
Finally, we load those variables into memory using source.
# chroot /mnt/gentoo /bin/bash
# env-update
>> Regenerating /etc/ld.so.cache...
# source /etc/profile
# export PS1="(chroot) $PS1"
4.To
install GRUB you will need to issue the grub-install command. However,
grub-install won't work off-the-shelf since we are inside a chrooted
environment. We need to create /etc/mtab which lists all mounted
filesystems. Fortunately, there is an easy way to accomplish this -
just copy over /proc/mounts to /etc/mtab, excluding the rootfs line if
you haven't created a separate boot partition. The following command
will work in both cases:
# grep -v rootfs /proc/mounts > /etc/mtab
5.Now we can install GRUB using grub-install:
# grub-install /dev/hda
6. Exit
# exit
# umount /mnt/gentoo/boot
# umount /mnt/gentoo
# reboot
阅读(1317) | 评论(0) | 转发(0) |