Grub command line to start Windows

Source: Internet
Author: User

The Grub mentioned here is different from the Grub for DOS mentioned above. The Grub mentioned above has nothing to do with the first sector of the disk. That is to say, if you delete the grub directory in disk C, it will not affect your system startup. The Grub I will talk about below will write some code to the first sector of the disk, that is, it will be written to the Master Boot Record MBR.

1 Grub command line code is divided into two parts: one part is written to the Master Boot Record MBR of the first sector, and the other part is located in a fixed position on the disk.

2 Grub command line operation process. After the computer starts, BOIS first performs self-check and other work, and then BOIS loads the first sector of the disk in 512 bytes) to somewhere in the memory, and then jumps to this place to execute the code, this code is the part of the above-mentioned Grub written into MBR. This Code contains the location information of the second part of Grub on the disk. This Code loads the second part based on this information, the second part is the core of Grub, and the second part reads/boot/grub. conf configuration file. Then, the user interface is displayed based on the configuration file. The menu options you see are as follows. Of course, you can press the keys 'C' to enter the command line mode.

3 As mentioned above, the information of each operating system on your machine is written into the configuration file grub. conf. If your configuration file is incorrect, grub certainly cannot find the OS you want to start. You need to start it manually at this time. For example, if you format a disk in Windows or another reason), after the machine is restarted, the beautiful grub interface disappears, leaving only a strange prompt "grub>, you can use commands to start your operating system.

Start Windows from the Grub command line:
Grub> root (hd0, 0)
Grub> chainloader + 1
Grub> boot

Start Fedora Core2 from the Grub command line and assume it is mounted on/dev/hda7 ):
Grub> kernel (hd0, 6)/boot/vmlinuz-2.6.5-1.385.img root =/dev/hda7
Grub & gt; initrd (hd0, 6)/boot/initrd-2.6.5-1.385.img
Grub> boot
Starting Debian from the command line is similar to starting Fedora Core2.

Note: If you adjust the partition size through the partition software, the ghost knows what the results will be. I have not tried it. Theoretically, you have finished playing, because the address information in the first part of Grub about the second part is invalid, the Grub core cannot be loaded!

4. You can use the same method to start the system in the future. If you feel uncomfortable and want a menu, modify your/boot/grub. conf file. Now that the machine is running, it's easy to go online and find other articles.

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.