Ubuntu grub repair command

Source: Internet
Author: User
Ubuntu fixed the grub command. a problem occurred while backing up grub. cfg today, leading to the accidental deletion of grub. cfg. What's worse is that I didn't realize this yet. After restarting, I only saw the grub command line interface with black and white characters. one line of grub & gt; waited for me to enter the command. okay, I'll fix your TT1.grub & gt ;... the grub command of ubuntu is being backed up today. A problem occurred during cfg, leading to the accidental deletion of grub. cfg, but I didn't realize it at the time. After restarting, I only saw the grub command line interface with black and white characters. a line of grub> waiting for me to enter the command, okay, I'll fix your T 1. grub> ls displays multiple partitions: (hd0) (hd0, msdos4), (hd0, msdos1), (hd0, msdos2), (hd0, msdos3) 2. grub> ls (hd0, msdosX)/boot/grub x indicates that the number is used to execute the preceding command multiple times. from 1 to 4, finally in ls (hd0, msdos4) /boot/grub shows a bunch of things instead of no such file or directory. it's half done here. 3. grub> set root = (hd0, msdosx) x indicates a number. in step 2, I found that my number is 4, and I entered msdos4 grub> setprefix = (hd0, msdosx) /boot/grub x indicates a number. in step 2, I found that my number is 4 and the input is msdos4 gru. B> insmod normal grub> normal generally, the system will be started here, but I am prompted that the kernel is not loaded. okay, I will load the kernel 4. grub> linux (hd0, msdosx)/boot/vmlinuz-(kernel version) ro root =/dev/sdax x stands for numbers, my name is msdos4. so here I enter sda4, which should be emphasized here. First, the kernel (hd0, msdosx)/boot/vmlinuz-(kernel version) ro root =/dev/sdax on the internet prompts in my ubuntu13.04 that there is no kernel, google knows that it has switched to linux instead of kernel. Next, when you enter the kernel version number in linux (hd0, msdosx)/boot/vmlinuz-here, after you press the Tab key in the upper left corner of the keyboard multiple times, multiple names of all the kernel versions in your system will appear. you can select a proper one and click OK. 5. grub> initrd/boot/initrd-(initrd version number) here, the input version number is the same as the method used to enter the kernel version number. the Tab key displays all initrd versions of the system. Note that this version must be consistent with the kernel version you just set! 6. grub> boot in general, after entering this command, a bunch of scrolling English will pop up, and it will be stuck on an interface for a while. then you will be able to see your system! 7. Don't be too happy. In fact, the startup problem has not been solved. the terminal enters the command update-grub, OK, and grub is fixed!
 
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.