After linux is installed, modify the default boot item.

Source: Internet
Author: User

After linux is installed, modify the default boot item.

After the linux system is installed, the default boot item is changed to linux when the system is started, which makes many people who often use the windows system crazy: press the power key, open the phone, brush Weibo, and look at the circle of friends, when I looked up again, I had to choose to restart again in the face of the password input interface.

So how do I modify the default boot item? What we need to do is modify the GRUB stuff.

STEP (take Ubuntu as an example ):

1. Enter the system. When starting the system, observe the number of items in the startup items of your windows system. When the system is enabled, open the terminal. (Baidu)

2. Enter "sudo gedit/etc/default/grub" in the terminal to open the grub file.

3. find the line "GRUB_DEFAULT = 0" in the document (or it may not be 0). If the windows system is the nth item at startup, change the value of 0 to n-1 (because the sequence number starts from 0 ). Save and exit.

What? Unable to save? Check whether sudo is not input in step 2.

4. Enter "sudo update-grub" in the terminal, press enter, and wait for several seconds.

5. Restart to see if it works.

 

Note:

I. boot process (from laruence)

1. Load BIOS hardware information and perform self-testing, and obtain the first device that can be started based on the settings;
2. read and execute the boot Loader (grub, spfdisk, and other programs) of MBR in the first boot device. (where we want to modify it)
3. Load the Kernel according to the boot loader settings. The Kernel starts to detect the hardware and load the driver;
4. After the hardware driver is successful, the Kernel will call the init program and the init will obtain the run-level information;
5. Run the/etc/rc. d/rc. sysinit file in init to prepare the job environment (such as network and Time Zone) for software execution );
6. Start each Service Running run-level in init (script Mode );
7. Run the/etc/rc. d/rc. local file in init;
8. init executes the terminal simulation program mingetty to start the login program, and finally waits for the user to log on;

Ii. sudo usage

The sudo command execution process is that the current user switches to the root (or another specified user), and then runs the command as root (or another specified user). After the command is executed, directly return to the current user. The premise is that the sudo configuration file/etc/sudoers must be used for authorization;

When we do not have the permission to perform some actions, we can try to use the sudo command.

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.