GrubRescue when multiple systems enter Ubuntu

Source: Internet
Author: User
Tags add numbers
When Windows and Ubuntu coexist, Ubuntu will bring a Grub system boot. you can choose which system to enable. However, if we partition a disk in Windows, the disk information will be reorganized, and the system boot disk obtained by Grub will change. if Wind... when Windows and Ubuntu coexist, Ubuntu will bring a Grub system boot. you can choose which system to enable. However, if we partition a disk in Windows, the disk information will be reorganized, and the system boot disk obtained by Grub will change. if Windows is started on/dev/sda1 and Ubuntu is started on/dev/sda8, disk startup caused by partitioning may change Ubuntu boot to a random partition, such as/dev/sda2. the changed partition does not include the Grub Boot File. at this time, we need to manually set the Grub boot file so that Ubuntu can find its boot zone. Perform a series of operations under www.2cto.com to solve the problem of Grub loss. First of all, there are few commands available in Grub Rescue. install the following method step by step: Step 1: find the Grub boot disk. 1. after ls executes this command, all the partitions in your disk are displayed. for example, my disk has the following partitions: (hd0, msdos1) (hd0, msdos5) (hd0, msdos6) (hd0, msdos7) (hd0, msdos8 )... step 2: Find partitions of non-NTFS file systems. Www.2cto.com 1.ls (hd0, msdos1)/Some information will appear after you execute it. if it is file not kown, it means that this partition is not what we are looking, keep searching for the remaining partitions and know other information. depending on the Ubuntu version, it may be possible that/and/boot can both be identified, or only/boot can be identified, if both of them can be identified, try again. for my disk, (hd0, msdos8) and (hd0, msdos9) both recognize Step 3: find the Grub file location 1.ls (hd0, msdos8)/boot/grub. you can find grub, but it is strange that there is also a grub in my (hd0, msdos9, so I first tried grub content in msdos8 and executed Step 4: set grub to start 1. grub rescue> set root = (hd0, msdos8) 2. grub rescue> set prefix = (Hd0, msdos8)/boot/grub 3. grub rescue> insmod/boot/grub/normal. the mod can be executed normally, but the mod file does not appear to be put under msdos8 in my disk. the execution result indicates that the file is not found, so I tried to set it to msdos9, but my grub was directly put under the root directory www.2cto.com in msdos9, so I made the following command 1. grub rescue> set root = (hd0, msdos9) 2. grub rescue> set prefix = (hd0, msdos9)/grub 3. grub rescue> insmod grub/normal. if no prompt is displayed for the mod result, the fifth step is successful: Display the missing Grub menu 1. grub rescue> normal so that the Grub menu can be displayed directly, and then you can enter the Ubuntu system Step 6: repair Grub 1. sudo update-grub 2. sudo grub-install/dev/sda cannot add numbers such as, which is the disk number. if it is not the partition number, restart it here to restore it.
Author fengxiaoke_fxk
Related Article

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.