Use Grub2 in Ubuntu to repair mobile hard drive boot

Source: Internet
Author: User
To install grub2, you must install the following package: grub-pc. grub-common can be found in the package management tool. Grub-install-v to check the current version. The traditional grub version is 0.97 or below, and the grub2 version is 1.96 or higher. The configuration file of grub2 is/boot/grub. cfg,

To install grub 2, you must install the following packages:

Grub-pc, grub-common

It can be found in the package management tool.

Grub-install-v to check the current version. The traditional grub version is 0.97 or below, and the grub2 version is 1.96 or higher.

The configuration file of grub 2 is/boot/grub. cfg, but this file cannot be modified. d/and/etc/default/grub files are edited, and update-grub is used to generate the configuration file.

That is to say, a normal process should be:

Sudo apt-get install grub-pc, grub-common # not required if grub2 is already installed

Sudo grub-install -- root-directory = // dev/sda # install grub2 boot on the device

Sudo update-grub # generate the grub configuration file

The current problem lies in update-grub, because grub-install can be installed by a specified device, but update-grub in the generated configuration file cannot be specified.

Whereis update-grub

Find it in the/usr/sbin/directory and edit it to make a shortcut to grub-mkconfig. The Code is as follows:

#! /Bin/sh
Set-e
Exec grub-mkconfig-o/boot/grub. cfg "$ @"

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.