Fixed grub boot and encountered misoperations.

Source: Internet
Author: User
Fixed grub boot and encountered a misoperation-Linux general technology-Linux technology and application information. The following is a detailed description. Author: stdio
You should have fixed grub, but today I encountered misoperations, wasting a lot of time and losing face ...... Write a log to commemorate this misoperation! (Hey, is it a bit bt)

First, let's look at a typical grub repair process and reinstall grub to MBR:

$ Sudo grub

Grub> find/boot/grub/stage1/* return the location of the boot partition */

Hd0, X/* hd0 indicates the first hard disk, and X indicates the Partition Number of the linux main directory */

Grub> root (hd0, X)

Grub> setup (hd0)/* install grub to MBR */

Today, my roommate re-installed XP, and the original grub boot was gone. So I went to the live cd of ubuntu and fixed grub through the above operations. In the last step, a misoperation occurred, the command is set to "setup (hd0, 0)", so that grub is installed in the first partition of the hard disk, that is, the C disk under XP. As a result, XP disappears...

I still use fixmbr, Which is useless. After thinking for a long time, I thought I should use fixboot C: To fix the Partition Boot of drive C. To ensure that grub is removed from MBR once and for all, the XP ntloader should be used as a guide.

Terminal input:

$ Sudo dd if =/dev/hda of =/media/linux, lnx bs = 512 count = 1/* if your hard disk is identified as sda, replace hda with sda */

This command will generate a file named linux under/media. copy the lnx file to drive C (other disks are also supported, as you prefer ^) and edit the C root directory boot. INI file, add C: \ linux. lnx = Grub Menu. After modification, a grub menu option will be added when the computer is started. You can select it to view the linux Startup Menu. Then use the XP installation disk to repair the mbr, enter the fault recovery platform, and enter the command fixmbr.

Now, I have separated linux boot from XP boot, which makes it much more comfortable.

Dd

1. Role

The dd command is used to copy files and convert and format data according to parameters.

2. Format

Dd [options]

3. [opitions] Main Parameters

Bs = byte: Forced ibs = <字节> And obs = <字节> .

Cbs = byte: the specified <字节> .

Conv = Keyword: convert a file by using a comma-separated keyword.

Count = number of blocks: only copy specified <块数目> .

Ibs = byte: Read the specified <字节> .

If = file: Read <文件> Content, rather than non-standard input data.

Obs = byte: Specify <字节> .

Of = file: Write Data <文件> Instead of standard output.

Seek = number of blocks: skipped the specified value in obs. <块数目> .

Skip = number of blocks: skipped the specified value in ibs <块数目> .

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.