Repair of grub boot and modification of default startup items after Windows and Ubuntu are reinstalled

Source: Internet
Author: User

So I installed windows for him and then re-guided Ubuntu. The following is a record:Repair guided by gurb:1. Take an Ubuntu system USB flash drive or a CD. If you don't have one, burn it. How can I burn this article. 2. Restart to enter the USB flash drive or CD boot. Select "try Ubuntu ). 3. View information. Open the terminal (ctrl + alt + t) and enter

Sudo-I (administrator privilege) fdisk-l (view partition and type)
Then your disk information appears.
Device    Boot    Start   End Blocks    Id   System 
Find the content in the Device column corresponding to the row 83 in the Id column and check the number of sda. The following is assumed to be sda *. (If there are multiple 83 partitions with IDs, you can try Step 4-6 one later ). 4. Mount the partition. Enter (note * Replacement and space) on the terminal ):
mount /dev/sda* /mnt
5. Enter at the terminal:
grub-install --root-directory=/mnt /dev/sda
Wait a moment and you will see the words Installationfinished and No Error Reported, indicating that the setting is successful. 6. restart the computer and you will be able to see the grub boot interface of Ubuntu. If not, go back to Step 1 to see if there are multiple partitions with Id 83. 7. Do not enter windows at this time. Enter Ubuntu in the terminal and enter:
sudo update-grub
After you restart your computer, you can access windows and Ubuntu normally. Then, the grub boot is fixed.
Modify the default startup items of grubThe student also asked to change the default startup Item back to windows... (This way, you can enter Ubuntu several times in a semester ...) Remember the number of windows startup items at startup. Enter Ubuntu and enter:
sudo gedit /boot/grub/grub.cfg
Change the value of 0 in set default = "0" to the number of lines in windows that you just saw to minus one. Save and exit. Restart.

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.