Ubuntu with Win7 dual system, change partition causes error:no such partition grub rescue>

Source: Internet
Author: User

My computer is installed in Windows and Ubuntu dual system. changing partitions under Windows, including creating new partitions, deleting partitions, merging partitions, and so on, can cause Ubuntu grub to find no partitions to enter the Grub rescue mode. This can be restored in the following way. Excerpt http://www.cnblogs.com/ZhangZhifeng1988/archive/2011/12/19/2294018.html as follows:

The internet to find a lot of ways to solve the problem finally. There are about three kinds of content on the net, one is to use LiveCD, only hangs of this one computer, in the company also too lazy next system engraved CD or U disk. The second method is to use the Surergrubdisk software. In the company under a, engraved on a U disk, come back to try, do not know is not carved good or what reason, the screen flashed a moment later, on the card in the booting from the USB device is not moving. The next is the third approach, the solution to the problem, without the need for other disks and devices, to solve the problem directly. Here are the steps:
The first is to find your own system boot partition, (if you remember the words do not have to check) by entering the LS command can list all partitions, as follows:

Grub rescue> ls 
hd0 (HD0,MSDOS1) (HD0,MSDOS5) ... (HD0,MSDOS10)
Next is to find the system boot partition, the first input LS (hd0,1) system will prompt Unkonw Filesystem, and then input LS (hd0,5), continuous input until the system no longer prompt unknow FILESYSTEM
The next task is to set the boot partition and path, such as the partition you just found to (hd0,8), determine the input ls (hd0,8), the list of/grub this folder, If not, see if there is/boot this folder, general grub in this folder, my is found under this folder. The following is the input command (//for the contents of the comment, no input required):

Grub Rescue> set root= (hd0,8)                                  // Just found the partition
grub rescue> set prefix= (hd0,8)/boot/grub                     //The Grub directory that you just found
The next step is to load the normal mode module with the following command:

Grub rescue> insmod/boot/grub/normal.mod//corresponds to the Grub directory just now, normal.mod files under the Grub folder
After loading, enter normal mode with the following command:
Grub rescue> Normal
At this point, the system enters the system (mode) we normally use. Then we have to do the work on the time to reset the system boot partition and path, because our system can not boot is unable to find the path caused. This process has two steps, one is to update grub, GRUB can then find the partition changes, and the other is to reset the boot partition. The steps are as follows:
Open terminal, enter sudo update-grub carriage return, after the command runs, enter the second command: sudo grub-install/dev/sda//SDA is the boot disk
After completing these steps, the system is fully recovered.

his cue is unknown filesystem, and I'm suggesting no such partition.

Another note below is attached below http://blog.sina.com.cn/s/blog_6c9d65a10100n76w.html

My Linux has the grub rescue> after resizing the partitionThis means that the GRUB2 configuration file is broken, because the partition adjustment or the partition UUID change causes the GRUB2 not to start normally, thus entering the repair mode (Grub rescue) is also called the rescue mode.
in rescue mode, only a few commands can be used:set , ls, insmod, root, prefix
(1) Set view environment variable, where you can view the boot path and partition. (2) LS viewing device(3) insmod loading module(4) root Specifies the partition that is used to boot the system and sets the grub boot partition in rescue mode(5) Prefix set grub boot path
I don't know where the boot directory is.ls #查看一下设备状态

grub rescue> ls (HD0,MSDOS3)error:bad filename.hint: The wrong file name, I found in the test must be the back plus A/
grub rescue> ls (HD0,MSDOS3)/./  .. / lost+found/
There is a boot directory in (HD0,MSDOS1)/below by viewing discovery
ii. Setting the boot partition and path for Grubset root= (HD0,MSDOS1) #设置grub启动分区set prefix= (HD0,MSDOS1)/boot/grub/ #设置grub启动路径Check the settings:Grub Rescue> Setprefix= (HD0,MSDOS1)/boot/grubROOT=HD0,MSDOS1
third, load the basic moduleinsmod/boot/grub/normal.mod #加载基本模块
Four, enter the normal modenormal #进入正常模式, the menu appears, if loading grub.cfg (wrong) may be a problem, press shift to appear menu, then press C key to enter the consoleafter entering normal mode, there will be grub> such as the prompt, there are a lot of commands to support here.
v. Guidance Systemset root= (HD0,MSDOS1) #设置正常启动分区linux/boot/vmlinuz .... Ro text root=/dev/sda1 #加载内核, enter the console mode initrd /boot/initrd .... #加载initrd . IMGBoot #引导
Vi. Updating GrubInstallation: Grub-install/dev/sdaUpdated: Update-grub


Virtual machine Experiment:Through the above experience, I carried out experiments in the virtual machine to deepen the consolidation. First, move the boot directory to another partitionmv/boot/ /home/after this reboot, there was aGrub rescue> Rescue mode. Second, manual START process recordls (HD0,MSDOS6)/ #找到了boot所在的分区set root= (HD0,MSDOS6) #设置grub启动分区set prefix= (HD0,MSDOS6)/boot/grub/ #设置grub启动路径insmod/boot/grub/normal.mod #加载基本的模块Normal #从救援模式进入正常模式
set root= (HD0,MSDOS6) #设置系统启动分区, where you point to the partition where the kernel resideslinux/boot/vmlinuz-2.6.35-22-generic ro text root=/dev/sda1 #加载内核initrd /boot/initr ..... #加载initrd . IMGboot #启动
the test starts normally and the login dialog box appears.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.