Explanation and settings of the Ubuntu STARTUP configuration file grub. cfg

Source: Internet
Author: User


In versions earlier than ubuntu9.10, the configuration file is menu. lst, and then changed to grub. cfg.

The path of grub. cfg is/boot/GRUB/grub. cfg.

The following is an analysis:

Open the command line and run sudo gedit/boot/GRUB/grub. cfg (or sudo gedit/boot/GRUB/menu. lst) to open the grub. cfg file.

In ### begin/etc/grub. d/00_header ###, some default startup information is recorded.

In

If [-S $ prefix/grubenv]; then
Load_env
Fi
Set default = "0"
In this sentence, default = "0" indicates starting from the first system in the startup Item (that is, the default UBUNTU), where the order starts from 0. For example, if you want to use the fifth option in the startup item as the default startup Item, you can change the number 0 to 4 here.
In
If [$ {recordfail} = 1]; then
Set timeout =-1
Else
Set timeout = 2
In this sentence, the timeout after else refers to the waiting time. The unit is wonderful and can be modified as needed.

In ### begin/etc/grub. d/10_lupin ###, the startup options are recorded.
For example:
Menuentry "ubuntu, Linux 2.6.32-22-generic "{
Insmod NTFS
Set root = '(hd0, 5 )'
Search-no-floppy-FS-UUID-set 0e9ca6229ca60475
Loopback loop0/Ubuntu/disks/root. Disk
Set root = (loop0)
Linux/boot/vmlinuz-2.6.32-22-generic root =/dev/sda5 loop =/Ubuntu/disks/root. Disk Ro quiet splash
Initrd/boot/initrd. img-2.6.32-22-generic

This is the first startup option for Ubuntu. The first line displays the Ubuntu name, Linux 2.6.32-22-Generic. The content in the quotation marks can be modified as needed, insmod NTFS is the information of the loading module. For example, you can add JPG support to insmod jpeg. If you want to use a PNG or TGA file as the background, add insmod PNG or insmod TGA ,. Set root = '(hd0, 5)' is critical here. Here we record that the system starts from that partition. The order here may be different from the order you see in windows, in Windows, the system partition sequence is based on the partition number, and the partition number can be changed at will, but here is the physical order, you can enter the DF command in the terminal to view the Mount partition information. Here, hd0 refers to the first physical hard disk. The sequence also starts from 0, and the subsequent 5 refers to the first 6th partitions. The sequence also starts from 0. Here, those who do not have the Windows Startup option after installing Ubuntu should find some ideas, right, we can use this information to add, for example, we can add
Title Windows XP
Root (hd0, 0)
Makeactive
Chainloader + 1
Start the Widows XP system from the first partition of the first disk.

Linux/boot/vmlinuz-2.6.32-22-generic root =/dev/sda5 loop =/Ubuntu/disks/root. Disk Ro quiet splash

In this sentence, splash indicates a pop-up screen. If you do not like the Ubuntu logo page, you can delete the word splash, so that Ubuntu will not start in text mode.

Finally, I append a default startup option for Windows 7.

Menuentry "Windows 7 (on/dev/sda1 )"{
Insmod NTFS
Set root = '(hd0, 1 )'
Search-no-floppy-FS-UUID-set 44c07536c0752f74
Chainloader + 1
}

Here, search-no-floppy-FS-UUID-set 44c07536c0752f74 sets the uuid = *** as the root partition, and set root = '(hd0, 1) 'duplicate. It can be deleted.

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.