My Ubuntu is installed on a hard disk. If Ubuntu is installed on wubi, see here. I am not proficient in Linux. I belong to cainiao. Just explain some commands according to my understanding. if it is wrong, I hope the experts will not be enlightened.
There are two steps to summarize the methods.
First: Find a way to enter the Ubuntu system // There Is A livecd method (not necessarily using a CD, or a USB flash disk). This method is used by me.
Second, reinstall and update grub.
1. Download The grub4dos file and decompress the three files to the installation directory of windows, such as drive C.
2. Restart grub4dos and enter the command below.
1. Switch to the Ubuntu partition.
Root (hd0 ,?) //? You need to enter the number by yourself. See the note below.
Note: grub is now in the partition you just decompressed by default, such as drive C. switch the directory to the partition where your Ubuntu is located, and try the partition on your own. hd0 indicates the first hard disk. Generally, it is a hard disk.
? I tried it myself, from (hd0, 1) to (hd0, 9 ). the current filetype will be displayed after each execution. If the prompt NTFS or fat is the directory in windows. if ext or something is prompted, it is probably ubuntu.
For example, when I try (hd0, 8), I will prompt "ext2fs". Then I will ls it and see the folder under my familiar ubuntu. That's it, so my? The number is 8.
2. Load the kernel
Kernel/boot/vmlinuz -??????? Root = UUID = ????????????????????? RO quiet splash //? Enter your own number, see the following annotations
Note: vmlinuz -???? In? It is very simple, that is, when you press the code to vmlinuz, press the tab key to automatically complete, and then follow ???? The version is automatically completed.
What should I do if I don't know the uuid? Run the uuid command before executing this command.
Important Note: In grub4dos, I cannot access the Internet to view the command. What should I do if I forget to do it? This is what I did. I didn't know which website I was looking. but later I thought about the code as if I had seen it. then I found it. It's in the middle, so you can follow grub directly. run the CFG command. The UUID information is also available.
CAT/boot/GRUB/grub. cfg // view the file
However, if you don't need to repeat the code in it, just let me know the above sentence. Then, the first one is not the kernel, but the Linux one. We will repeat the kernel, because I failed to try Linux.
3. Load initrd
Initrd/boot/initrd -?????? //? When you press the command to initrd, the tab key is automatically completed.
4. Start
boot
All right, it's almost done. You can see Ubuntu, and it's already started normally. But to retrieve the boot item, you don't need to start it through grub4dos every time.
5. Enter two simple codes in the Ubuntu terminal.
sudo grub-install /dev/sda sudo update-grub
3. Restart. After Entering windows, delete the three files copied to the Windows disk (this file can be deleted or not)
OK, all done!