How to restore a grub backup to the hard drive boot program

Source: Internet
Author: User
Keywords Bootstrapper through operating system can execute
Tags aliyun backup boot program copy default developed disk file

Grub is the http://www.aliyun.com/zixun/aggregation/13835.html ">ubuntu linux Default boot program, developed by the GNU Project team, that supports most of the currently common operating system boot." This article mainly describes how to install grub on a floppy disk, and the final production of the boot floppy will be able to start your current hard drive installed on the operating system, you can also through the floppy disk into the GRUB command operation interface, through the input command to start the operating system you want to use. All operations in this article are performed under Ubuntu Linux.

1. Perform the following command to obtain administrator privileges.

Sudo-s
Answer the <password> prompt

2. Format the floppy disk into Ext2 file system:

Mke2fs/dev/fd0

3. Load the floppy drive to copy the files required for grub boot.

Mount/dev/fd0/media/floppy mkdir/media/floppy/boot mkdir/media/floppy/boot/grub cd/boot/grub CP stage1 stage2/media/ Floppy/boot/grub

If you want to use this floppy disk to start your computer's existing operating system, please copy the/boot/grub/menu.lst, device.map Two files to the appropriate directory on the floppy disk.

4. Uninstall the floppy drive (umount/dev/fd0), enter the terminal and boot grub, and enter the GRUB command operation mode, and you will see the Grub command Prompt (grub>) and execute the following command:

Device (FD0)/dev/fd0 root (fd0) setup (fd0) quit

5. In this way, a grub boot floppy is finished, if you copy the two files to the floppy disk in the third step, then use this floppy disk to start your computer's startup interface with the hard disk when you start the interface is identical;

6. For security purposes, you can also back up the boot system on the current hard drive to a floppy disk (backed up into a file), which is provided that your grub is installed on your hard disk. The bootstrapper is contained in a file named Boot.mbr. The following are backup operations:

DD If=/dev/hda of=/media/floppy/boot.mbr bs=512 count=1

When there is a problem with the boot program on your hard drive, you can boot to the floppy disk and perform the following command to fix it:

DD if=/media/floppy/boot.mbr Of=/dev/hda bs=512 count=1

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.