Ubuntu 10.04 Grub2修复详细步骤

 

Ubuntu 10.04 LTS终于发布了,原来打算过一阵子再把9.10升一下的,但今天在update manager里,看到已经有提示说可以直接升到10.04,一时冲动没忍住,于是就升了……

  Ubuntu 10.04 LTS终于发布了,原来打算过一阵子再把9.10升一下的,但今天在update manager里,看到已经有提示说可以直接升到10.04,一时冲动没忍住,于是就升了,接着就碰到魔鬼了:重启后在grub那步出错,过不去了,提示 “GRUB loading error: the symbol ‘grub_puts_’ not found”,光标就停在grub rescue>后面,google找了一些文章,发现国内的几个都大同小异,Ubuntu 10.04 Grub2修复后面有一些步骤根本没有交代清除,做到一半就进行不下去了,后来找到一个老外的帖子, 一步一步都很清楚,照着做下来,成功地把grub2修复了。

  Ubuntu 10.04 Grub2修复详细步骤1

 

Boot to the LiveCD Desktop (Ubuntu 9.10 or Ubuntu 10.04).     
Open a terminal – Applications, Accessories, Terminal .     
Determine your normal system partition – (the switch is a lowercase “L”) sudo fdisk -l     
If you aren’t sure, rundf -Th . Look for the correct disk size and ext3 or ext4 format.     
Mount your normal system partition:     
Substitute the correct partition: sda1, sdb5, etc.     
sudo mount /dev/sdXX /mnt # Example: sudo mount /dev/sda1 /mnt  

 

  Ubuntu 10.04 Grub2修复详细步骤2

 

Only if you have a separate boot partition :     
sdYY is the /boot partition designation (examply sdb3)     
sudo mount /dev/sdYY /mnt/boot     
Mount devices:sudo mount --bind /dev/ /mnt/dev     
To ensure that only the grub utilities from the LiveCD get executed, mount /usrsudo mount --bind /usr/ /mnt/usr     
mount proc filesystemsudo mount --bind /proc/ /mnt/proc     
Chroot into your normal system device:sudo chroot /mnt     
If there is no /boot/grub/grub.cfg or it’s not correct, create one usingupdate-grub     
Reinstall GRUB 2:     
Substitute the correct device – sda, sdb, etc. Do not specify a partition number.     
grub-install /dev/sdX  

 

  Ubuntu 10.04 Grub2修复详细步骤3

 

Verify the install (use the correct device, for example sda . Do not specify a partition): sudo grub-install --recheck /dev/sdX     
Exit chroot : CTRL-D on keyboard     
Unmount devices:sudo umount /mnt/dev     
If you mounted a separate /boot partition:sudo umount /mnt/boot     
Unmount last device:sudo umount /mnt     
Reboot.reboot     
Post-Restoration Commands    
Once the user can boot to a working system, try to determine why the system failed to boot.    
 The following commands may prove useful in locating and/or fixing the problem.  

 

  Ubuntu 10.04 Grub2修复详细步骤4

 

To refresh the available devices and settings in /boot/grub/grub.cfg     
sudo update-grub     
To look for the bootloader location.    
grub-probe -t device /boot/grub     
To install GRUB 2 to the sdX partition’s MBR (sda, sdb, etc.)    
sudo grub-install /dev/sdX     
To recheck the installation. (sda, sdb, etc.) sudo grub-install --recheck /dev/sdX     
Please check the following link for further details.  

 

MBR(主引导记录)损坏是常见的引导问题,可以严重影响到双系统环境下的GRUB2引导。为了修复这种情况,用户可以借助Ubuntu 10.04 LiveCD的系统恢复功能来解决问题。具体步骤如下: 参考资源链接:[Ubuntu 10.04 LiveCD修复GRUB2双系统引导教程](https://wenku.csdn.net/doc/649644014ce2147568b3f768?spm=1055.2569.3001.10343) 1. 首先,使用Ubuntu 10.04 LiveCD启动计算机。在启动时,选择“试用Ubuntu”进入LiveCD模式。 2. 通过LiveCD启动后,打开终端窗口,使用`sudo fdisk -l`命令查看所有磁盘分区信息,找到Ubuntu系统所在的Linux分区,例如`/dev/sda7`。 3. 在终端中输入`sudo -i`以获得root权限,然后创建一个临时目录并挂载Ubuntu分区,命令如下:`mkdir /media/tempdir`和`mount /dev/sda7 /media/tempdir`。 4. 使用`grub-install --root-directory=/media/tempdir /dev/sda`命令,将GRUB2重新安装到MBR。这里`--root-directory`参数指向挂载的Ubuntu分区,`/dev/sda`指的是硬盘设备。 5. 如果`grub-install`命令成功执行,系统将显示“Installation finished. No error reported.”的提示信息。 6. 最后,重启计算机,GRUB2应该能够正常引导进入双系统环境。 这一过程不仅解决了由于MBR损坏导致的引导问题,还展示了Linux LiveCD在系统维护中的实用性和灵活性。为了更全面地掌握这一技巧,建议参考《Ubuntu 10.04 LiveCD修复GRUB2双系统引导教程》,该教程不仅提供了修复步骤,还涵盖了其他相关知识,帮助用户深入理解和运用Linux系统工具进行系统维护。 参考资源链接:[Ubuntu 10.04 LiveCD修复GRUB2双系统引导教程](https://wenku.csdn.net/doc/649644014ce2147568b3f768?spm=1055.2569.3001.10343)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值