Update grub2 in ubuntu

Source: Internet
Author: User
When multiple systems are installed on a computer, it is inevitable that the system cannot be accessed, most of which are grub problems. Use the LiveCD disc to start the computer and then enter the Ubuntu system on the disc, or start it with USB to open the terminal. Sudo-I will first look for the partition where your ubuntu is installed. After using: fdisk-l, a table will be generated. The table contains your partition information, find

When multiple systems are installed on a computer, it is inevitable that the system cannot be accessed, most of which are grub problems. Use the LiveCD disc to start the computer and then enter the Ubuntu system on the disc, or start it with USB to open the terminal. Sudo-I will first look for the partition where your ubuntu is installed. After using: fdisk-l, a table will be generated. The table contains your partition information, find

When multiple systems are installed on a computer, it is inevitable that the system cannot be accessed, most of which are grub problems.

Use the LiveCD disc to start the computer and then enter the Ubuntu system on the disc, or start it with USB to open the terminal.

sudo -i

First, find the partition where your ubuntu is installed. Use:

fdisk -l

A table will be displayed, with your partition information in the table. Find the partition where you installed Ubuntu. If you are not sure, find the partition with id 83. If your Ubuntu is installed in the/dev/sda1 partition, mount the root directory of the original system below:

mount /dev/sda1 /mnt

Mount/dev/sda1 to/mnt. You can also choose another location. Note that if you have a separate/boot partition, You need to mount the/boot file once separately. For example, if your original/boot file is mounted to/dev/sda12, enter again here

mount /dev/sda12 /mnt/boot

The following is the last step:

grub-install --root-directory=/mnt/dev/sda

(Note:/mnt is followed by a space key)
If you see
Installation finished. No Error Reported.
It indicates that it is successful!
Restart your computer and you will be able to see the grub2 boot interface. However, it can only be used to guide Ubuntu, but Windows 7 cannot be guided for the moment. At this time, you can choose to enter Ubuntu, find and start the terminal, and enter the following command on the terminal:

sudo update-grub2

Update grub2.
Follow the prompts to enter the password. If the password succeeds, the following similar statements will appear, indicating that the password is successful.

Generating grub. cfg...
Found linux image:/boot/vmlinuz-3.2.0-26-generic
Found initrd image:/boot/initrd. img-3.2.0-26-generic
Found linux image:/boot/vmlinuz-3.2.0-25-generic
Found initrd image:/boot/initrd. img-3.2.0-25-generic
Found linux image:/boot/vmlinuz-3.2.0-23-generic
Found initrd image:/boot/initrd. img-3.2.0-23-generic
Found memtest86 + image:/boot/memtest86 +. bin
Found Windows 7 (loader) on/dev/sda1
Found Ubuntu 10.04.3 LTS (10.04) on/dev/sda10
Found Ubuntu 10.04.3 LTS (10.04) on/dev/sda9
Done

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.