装Linux时候忘记装GRUB的重装


方法1:

用光盘引导进去再重装Grub。选择"Try Ubuntu",将根分区mount在一个目录下,使用grub-install.

sudo mount /dev/sdaX /mnt/root
sudo mount --rbind /dev /mnt/root/dev
sudo chroot /mnt/root grub-install /dev/sda
如果没有第二行,就会出错:

/usr/sbin/grub-probe: error: cannot find a device for /boot/grub (is /dev mounted?)

If there is such error:

root@ubuntu:/mnt/dst-root# chroot /mnt/dst-root/ grub-install /dev/sdb
/proc/devices: fopen failed: No such file or directory
/proc/devices: fopen failed: No such file or directory
Is device-mapper driver missing from kernel?
/proc/devices: fopen failed: No such file or directory
Failed to set up list of device-mapper major numbers
/proc/devices: fopen failed: No such file or directory
/proc/devices: fopen failed: No such file or directory
/proc/devices: fopen failed: No such file or directory
Is device-mapper driver missing from kernel?
/proc/devices: fopen failed: No such file or directory
Failed to set up list of device-mapper major numbers
/proc/devices: fopen failed: No such file or directory
/proc/devices: fopen failed: No such file or directory
/proc/devices: fopen failed: No such file or directory
/proc/devices: fopen failed: No such file or directory
Is device-mapper driver missing from kernel?
/proc/devices: fopen failed: No such file or directory
Failed to set up list of device-mapper major numbers
/proc/devices: fopen failed: No such file or directory
/proc/devices: fopen failed: No such file or directory
Installation finished. No error reported.
root@ubuntu:/mnt/dst-root# echo $?

Try to use the command also:

mount --rbind /proc /mnt/root/proc

Error 3:
/dev/root: Not found or not a block device.

ubuntu@ubuntu:~$ !76
sudo chroot /mnt/dst grub-install /dev/sda
/dev/root: Not found or not a block device.
ubuntu@ubuntu:~$ cd /dev
root@ubuntu:/dev# ll root
ls: cannot access root: No such file or directory
root@ubuntu:/dev# ln -snf sda7 root
root@ubuntu:/dev# ll root
lrwxrwxrwx 1 root root 4 2012-10-28 14:30 root -> sda7
root@ubuntu:/dev# chroot /mnt/dst 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'.

(fd0)	/dev/fd0
(hd0)	/dev/sda
(hd1)	/dev/sdb
root@ubuntu:/dev# cat /mnt/dst/boot/grub/device.map 
(fd0)	/dev/fd0
(hd0)	/dev/sda
(hd1)	/dev/sdb

Solution is link /dev/root to ROOT partition.

There's a great guide on Grub errors: http://www.gentoo.org/doc/en/grub-error-guide.xml, however it doesn't have the solution to Error 3.

I found error 3 solution on:
http://forums.gentoo.org/viewtopic-t-886224-start-0.html


方法2:

装Grub4dos直接在windows下引导。


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值