FEDORA20 Change the boot default startup and change startup wait time (GRUB2 boot)

Source: Internet
Author: User
Tags chmod uuid

GRUB2-Booted multiple systems can modify the boot sequence and improve system wait times in the following ways, Fedora,ubuntu,windows are valid. To change the boot boot method one:

1. Using the terminal, first find the Windows Menuentry.
# Cat/boot/grub2/grub.cfg | grep Windows
Results:
Menuentry Windows 7 (loader) (ON/DEV/SDA1)--class windows--class os {
2. Set Windows as the default startup item (here you can only use the contents of double quotes "" or "single quotes" in the command output above)

# Grub2-set-default Windows 7 (loader) (ON/DEV/SDA1)
3. Verifying default Startup Items
# grub2-editenv List
Output:
Saved_entry=windows 7 (loader) (ON/DEV/SDA1)

If it is WINDOWS8 or windows8.1 the same way, this method is available for parental testing.

When you restart your computer, you see that the default boot entry is Windows.

This is the first time I set it up, and then installed a system, this method is not used, do not know how to do. If this method doesn't work, use the second method. Method Two:

1. Terminal input, improve permissions and edit startup configuration file

# sudo chmod +w/boot/grub2/grub.cfg

#sudo gedit/boot/grub2/grub.cfg

2. Below the configuration file, find the paragraph shown below

### Begin/etc/grub.d/30_os-prober ###

Menuentry ' windows 7 (loader) (on/dev/sda1) '--class Windows--class os $menuentry _id_option ' Osprober-chain-140e68540e6 830c2 ' {

Insmod Part_msdos

Insmod NTFS

Set root= ' HD1,MSDOS1 '

if [x$feature_platform_search_hint = xy]; Then

Search--no-floppy--fs-uuid--set=root--hint-bios=hd0,msdos1--hint-efi=hd0,msdos1--hint-baremetal=ahci0,msdos1-- Hint= ' HD1,MSDOS1 ' 140e68540e6830c2

Else

Search--no-floppy--fs-uuid--set=root 140e68540e6830c2

Fi

Chainloader +1

}

### End/etc/grub.d/30_os-prober ###

Cut the whole piece down and paste it in

### Begin/etc/grub.d/00_header ###

、、、、、、、、、、、、、、、、、、、、、、、、、、、、

### End/etc/grub.d/00_header ###

Later, the Linux boot entry is placed

### Begin/etc/grub.d/10_linux ###

Before. Then save and reboot.

Note: ### begin/etc/grub.d/### and ### end/etc/grub.d/## #是对应存在的. Just in case, you can back up this file first.


(The above method is verbose, there is a modified grub.cfg below)


1, when starting to see a few boot items, remember to change to the default starting position. Starting from 0. (may be faster, move up and down keys, let it stay for a while)

2, grub.cfg defaults to read-only, with the administrator account to modify the properties of the file # chmod 775/boot/grub2/grub.cfg.

3, modify the default start option, # Vi/boot/grub2/grub.cfg

Modify set default= ' 0 ' this place, want to change into the first few write a few, my Win7 is 8th, so change to default= ' 7 '. Save exit.

4, change the file back to read-only property. # chmod 400/boot/grub2/grub.cfg

It's OK to reboot.

PS: At the same time installation must first installed Win7, after the install Fedora, otherwise there is no guidance.

--------------------------

You can also open the Grub configuration file with Gedit:

sudo gedit/etc/default/grub

Then enter the following command in the terminal to update the startup item profile (optional):

Grub2-mkconfig-o/boot/grub2/grub.cfg
Change the wait time at boot boot into system needs to modify GRUB profile

The old version of Fedora (such as FEDORA12) in the file in/boot/grub/grub.conf, the new fedora (such as FEDORA20) in/boot/grub2/grub.cfg

Open this file (with a text editor to open, recommend vim, you can appropriately improve the permissions, otherwise it may be due to insufficient permissions to open this file), you can see the contents are as follows:

# grub.conf generated by Anaconda
#
# so you don't have to rerun grub after making changes to this file
# notice:you have a/boot partition. This is means that
# all kernel and INITRD paths are relative to/boot/, eg.
# root (hd0,0)
# kernel/vmlinuz-version RO root=/dev/mapper/vg_linux-lv_root
# initrd/initrd-[generic-]version.img
#boot =/DEV/SDA
Default=0
Timeout=5
Splashimage= (hd0,0)/grub/splash.xpm.gz
Hiddenmenu
Title Fedora (2.6.31.5-127.FC12.I686.PAE)
Root (hd0,0)
Kernel/vmlinuz-2.6.31.5-127.fc12.i686.pae ro root=/dev/mapper/vg_linux-lv_root lang=zh_cn. UTF-8 keyboardtype=pc keytable=us RHGB quiet
Initrd/initramfs-2.6.31.5-127.fc12.i686.pae.img

The timeout=5 on the wait time is 5 seconds, if you change it to 15, save the file (Vim save how to save the file here is not in detail) and then restart the machine, you can see the effect.

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.