Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2124113
  • 博文数量: 229
  • 博客积分: 7217
  • 博客等级: 上校
  • 技术积分: 3224
  • 用 户 组: 普通用户
  • 注册时间: 2009-02-19 17:23
个人简介

个人主页https://xugaoxiang.com,微信公众号: Dev_Club 或者搜索 程序员Club

文章分类

全部博文(229)

文章存档

2017年(1)

2016年(20)

2015年(23)

2013年(1)

2012年(23)

2011年(68)

2010年(62)

2009年(31)

分类: LINUX

2010-04-13 13:11:24

The rescue mode is a major GRUB 2 enhancement. If GRUB 2 fails to find a useable grub.cfg and is unable to transfer control to a kernel it will drop to a grub-rescue> prompt. From this prompt the user can investigate problems, make changes, and retry the boot.

1、
ls
This will display the known devices and partitions. From this information, the user must determine the device and partition on which the system is installed.

2、set prefix=(hdX,Y)/boot/grub
If incorrect, "no such disk" or "not found" errors will occur later.

3、set root=(hdX,Y)
In this command, X is the device/drive, starting with 0. Y is the partition, starting with 1. Example: (hd0,1) is sda1. (hd2,5) is sdc5.

4、set
Inspect the "prefix=" listing. It should match the root designation in Step 3, in the following format: prefix=(hdX,Y)/boot/grub.

5、ls /boot
Inspect the contents. The user should see varioius kernels, initrd images and the grub folder. If not, use the ls command to inspect the device and attempt to find these files and folders. If necessary, set another device as root.

6、insmod /boot/grub/linux.mod
Load (insert module) the linux module. Without this module loaded, the user will receive an "Unknown command linux" message when trying to load the kernel.

7、linux /vmlinuz root=/dev/sdXY ro
Load the linux kernel, substituting the correct designations for "X" and "Y" (example: sda1). The user will see a message showing the kernel has been loaded.

8、initrd /initrd.img
Load the initrd image. When pressing ENTER the user may or may not see a message in the terminal.

9、boot
Attempt to boot using the information entered.

These changes are not permanent. After successfully booting into the system the user should run sudo update-grub and inspect the GRUB 2 configuration file (/boot/grub/grub.cfg).The user may need to reinstall GRUB 2 using sudo grub-install /dev/sdX.


djstava
阅读(3125) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~