Boot fix for win7 + Ubuntu + fedora.

Source: Internet
Author: User

I haven't written a blog for a long time. Today I am going to post a message to commemorate a very painful day (one afternoon ).

Recently, I am engaged in embedded development. embedded development is indispensable to QT, but I have never played QT before. Install QT qt-x11Source codeIt makes me very angry!

I didn't finish the compilation last night for half a night. Although fedora 18 was newly installed, it had already caused me to get rid of it...

There is a Ubuntu 12.10 USB flash drive live on hand, so it's almost an impulse to format the Win8 disk, and restart it to boot the USB flash drive.

So it's doomed to this afternoon's pain.

When Ubuntu is installed, He prompts coexistence with win7, indicating that the startup Item of win7 has been identified, but there is no fedora prompt, but I am not very concerned about it, so I will go directly to the next step.

The boot guide of Fedora does not exist after the restart, but the system is still running. I thought it would be nice to run Update-grub in Ubuntu, but it is always counterproductive. If I tried grub-mkconfig, it also ended in failure.

Ubuntu 12.10 uses grub, while fedora uses grub2. Maybe this is the cause of failure (I guess ).

Later, I went around the Internet, saying that I started the instance with a USB flash drive live, and then...

Then I downloaded the KDE live of Fedora from my desktop and made a USB flash drive with the USB creator. However, the tragedy once again caused no response from the USB flash drive, A black screen made me dumb. However, I had to redo the USB flash drive, but I still couldn't do it. I had to think about it. I still couldn't do it if I changed my computer !!

This may be due to a problem with the USB flash drive...

So I switched to a 4G memory card and completed it !!! In the past, I used this USB flash drive to make various boot disks very easy to use. This is not the case .. I still don't know the reason. Maybe this USB flash drive has already been used up, and he has contributed a lot to me. Far away.

This is what we did:

Su

Mount/dev/SDA/mnt

Grub-install-root-directory =/mnt/dev/SDA // install grub2 to MBR

The result shows an error (the error cannot be remembered ...)

Later I wanted to mount the/boot of the Ubuntu system and then...

Umonut/mnt

Mount/dev/sda9 // The partition where my Ubuntu system is located

CD/boot/GRUB

Then we can see grub. cfg

I tried it with excitement.

Grub-mkconfig-O/mnt/boot/GRUB/grub. cfg

The results are always less appealing. I didn't find fedora. Later I found out that this is the same as running in Ubuntu.

Try again:

Umount/mnt

Mount/dev/sda11 // disk where my fedora system is located

CD/mnt/boot/grub2

Then I tried it.

Grub-mkconfig-O/mnt/boot/grub2/grub. cfg

I was pleasantly surprised to find the startup Item of Fedora 18.

Then one afternoon passed...

In the evening, I wrote a blog and recorded the repair process. The tragedy happened again.

I don't know which tendon I got wrong again. I suddenly executed the following command:

Rpm-Qa QT *

Then, I accidentally executed the following statement:

Yum remove qt-x11-4.8.4-14.fc18.i686

When I write a blog while executing the blog, the computer suddenly has a black screen and displays several errors,

The graphical window is suddenly closed. This !!!!

My hard-earned blog... I guess there is no more.

Then, log in to the command line and use startx,

Everything went fine after entering, but chrome was closed. After chrome is enabled,

CTRL + ALT + T

Reply to the window closed last time. As a result, the blog circle is opened, and the editing essay is still there. The question is still there, and the content is hidden, and I wrote 80% of my blogs without saving the draft...

Ah !~ Tragedy always happens once.

Finally, I decided to rewrite my blog to record the unfortunate day.

The last lesson is:

Do not reload the system as soon as possible. Maybe the first sector of the computer will collapse one day, and my USB flash drive will no longer be able to be used as the boot disk...

Pay attention to saving and backing up data no matter what you do in the future.

There is also the yum remove in fedora, which is better to be used with confidence, or there will be a tragedy.

Finally, display fedora 18 KDE in the new desktop diagram.

 

Today, we continue to use the tool to format the Ubuntu System Disk in win7, and the result is naturally unable to be guided by the system ....

Search online, http://blog.csdn.net/firefoxbug/article/details/7322763 tried his method, somehow always prompted/bin/bash for unknown file or command, try to mount/bin to/Media/bin,

Still not good !!

Later I found a way, http://www.linuxidc.com/Linux/2011-06/37556.htm,

Grub2 is used on fedora 18, and the command is slightly different, so:

Grub2-install -?

The usage is as follows:

[Qin @ localhost ~] $ Grub2-install -? Unrecognized option' -? ' Usage: grub2- Install [Option] [install_device] install grub on your drive. -H, -- help print This  Message and exit -V ,-- Version print the version information and exit -- Modules = modules pre- Load specified modules -- Boot-directory = dir install grub images under the directory DIR/ Grub2 instead of /Boot/Grub2 directory -- Target = target install grub For  Target Platform [  Default = Current] -- Directory = dir use grub Images From  Dir. takes precedence over target -- Grub-setup = file use File As Grub- Setup -- Grub-mkimage = file use File As Grub- Mkimage -- Grub-mkrelpath = file use File As Grub- Mkrelpath -- Grub-probe = file use File As Grub- Probe -- Allow-floppy make the drive also bootable As Floppy ( Default                            For Fdx devices). May Break  On Some BIOSes. -- Recheck Delete Device Map If  It already exists -- Force install even If  Problems are detected -- Force-file-ID use identifier file even If UUID Is  Available -- Disk-module = Module disk module to use (biosdisk or native). This option  Is  Only available on bios target. -- No-NVRAM don '  T update the 'boot-Device  ' NVRAM variable. This option  Is  Only available on ieee1275 targets. -- Removable the installation device Is  Removable. This option  Is  Only available on EFI. -- Bootloader-id = ID the ID of bootloader. This option Is  Only available on EFI. -- EFI-directory = dir use dir As The EFI system partition root. install_device must be System Device filename. grub2 -Install copies grub images into/boot/grub2, and uses grub- Setupto install grub into the Boot Sector. Report Bugs <Bug-grub@gnu.org>.

This is used:

 
-- Boot-directory = dir install grub images under the directory DIR/grub2 instead of the/boot/grub2 directory


So:

Grub2-install -- boot-directory =/Media

/The Boot partition of fedira is mounted under media.

An error is prompted, but you cannot remember the error. The system was successfully restarted.

 

April June 20, 2013:

Today I recorded my tragic laptop .....

After attending a competition, I had to answer the question. So in windows7, I allocated a new partition for the idle 50 GB hard drive and planned to use it as a dedicated disk for the competition, then a new win user is created and some hard disk access permissions are set. After that, I used it very well. As a result, the tragedy happened when I restarted my computer!

After the reboot, the system cannot be entered directly by mistake, and the grub rescue prompt is displayed. At that time, I was not so calm. Didn't I create a win user? Again, I tried hard drive partitions too much, this is probably the reason!

But I had to google it ..

Some useful things are found:

In rescue mode, only a few basic commands are available. You must perform some operations to load the normal module and then enter the normal mode.

In rescue mode, the following commands can be used: Set, ls, insmod, root, and prefix (set the startup path)

Assume that the core file of grub2 is in the (hd0, 8) partition, And then you can see how to switch from rescue mode to normal mode started from (hd0, 8 ).

In rescue mode, the search command cannot be used. You can use the LS command to view the partition in which the grub2 file is located, for example

Ls (hd0, 8)/View (hd0, 8) Partition root directory to see if there is a boot folder

Ls (hd0, 8)/boot/view files in the/boot directory of the (hd0, 8) Partition

Ls (hd0, 8)/boot/GRUB/view files in the (hd0, 8) Partition/boot/GRUB directory

By checking the file, you can determine the partition in which the grub2 core file is located. Next, you can perform the conversion from rescue to normal:

First look at the partition. Based on the partition list, write down the/Partition Number and then ls (hd0, x)/check the file in the partition directory to find/partition. If not, continue searching. Locate/partition (hd0, x) and continue

Grub rescue> root = (hd0, X)

Grub rescue> prefix =/boot/GRUB

Grub rescue> set root = (hd0, X)

Grub rescue> set prefix = (hd0, x)/boot/GRUB

Grub rescue> insmod normal

Rescue> normal --------> If the Start menu appears, you can enter the system.

However, this is not complete, because the problem persists after the restart.

We need to go to Linux and fix grub.

Grub2-mkconfig-O/boot/geub2/grub. cfg
Grub2-install/dev/SDA

(SDA is your hard disk number. do not specify a partition number, such as sda1 or sda5)

Restart the test and the grub2 has been successfully repaired.

 

 

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.