Use a USB flash drive to install CentOS and write the boot command on the USB flash drive.

Source: Internet
Author: User

Use a USB flash drive to install CentOS and write the boot on the USB flash drive. I found that I am a genius! Let's review the scenario: there is an old machine in the company. My colleague said it was okay to study how to install a Linux. I just downloaded a CentOS6.4 a few days ago, and I just completed the work. Unfortunately, the broken machine does not have an optical drive. You have to use a USB flash drive. I won't talk about how to create a boot disk, or how to install it. What I want to say is that I have installed it successfully. (I have a lot of nonsense) The problem is coming. I unplugged the USB flash drive after I restarted it. Then you can't get up again .. I am not so worried. I have a dead heart. It takes me more than an hour to install the system because it is slow to break the machine. I checked it hundreds of times and said it was to install the boot into the USB flash drive. I tried it and the USB flash drive can be started. Miserable. If I had my own computer, I would be too lazy, but this is the company's. You can't always plug in my USB flash drive. So I asked a lot of people in the group and told me to reinstall the system. But I don't have to worry about it. Can I reload it without moving? No worries. The following is a solution. Please refer to the materials of many people! 1. Insert a USB flash drive to enable the system. (If the USB flash drive is swallowed up, you can launch a Live CD.) 2. open a terminal and run the $ sudo grub command (this may take a while). You will see a prompt like 'grub> '3. enter find/grub/stage1 after the prompt 'grub> '. You will get a running result. For example, the result on my machine is (hd0, 0) (This command is actually used to find the partition where/boot is located.) 4. run grub> root (hd0, 0) (enter the running result on your machine. run grub> setup (hd0) and several lines of text are displayed. Succeeded "fixed successfully! 6. Run quit. 7. Run reboot to restart the computer. I am in the mood. It seems like a flower, because I saw the grub startup interface, but I am not happy later. It is restarting, but it still cannot enter the system. Later, I studied the startup items of grub and found a problem. I clearly wrote root (hd0, 0). Why does it become root (hd1, 0? (This is probably a BUG of grub in CentOS6.4 .) Then I press the 'E' key and edit it as root (hd0, 0) to start it. Then how wonderful the world is. Started successfully. After some suffering, I finally don't need to reinstall the system! Finally, I used grub to temporarily Change 1 to 0. In fact, it was not changed at the next startup, but it was still 1. Then I edit the/boot/grub/menu. lst file and change the content to the correct one. Save and exit. Restart. Then the problem is solved. I hope that my experience will help people who encounter the same difficulties as me! The first blog post is a bit nonsense. Thank you for your understanding!

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: 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.