Fedora16 use LiveCD to fix grub2 boot

Source: Internet
Author: User
Since I installed Fedora16 on my computer and turned it into a dual system, I became interested in openSUSE. As a result, I was eager to install a three-system game, but I didn't really understand Linux, result During the installation, grub boot of openSUSE was directly installed on the MBR, and grub2 of the original Fedora16 was overwritten. As a result, the computer could not recognize Fedora16, in addition, openSUSE could not recognize my wireless network card, and it was a cup of cake. Fortunately, the students started out in a timely manner and finally turned this computer into a dual system since I installed Fedora 16, I was interested in openSUSE again. As a result, I was eager to install three systems for fun, but I didn't really understand Linux, result During the installation, the grub boot of openSUSE was directly installed on the MBR, And the grub2 Boot of Fedora 16 was overwritten. As a result, the computer could not identify Fedora 16, moreover, openSUSE could not recognize my wireless network card, and it was a cup of cake. Fortunately, the senior student got out of the game in time and finally solved the problem.

Today's children like to install the system, Windows 7 + Fedora. If you first install win7 and then Fedora, it is quite simple. If you first install Fedora and then WIN 7, this article also applies.

Read: http://www.linuxidc.com/Linux/2008-06/13956.htm

If LiveCD does not know why, please google

If you do not know how to create LiveCD, please google

If you do not know how to use LiveCD, please google

 [In order to take care of some young people who just want to play fedora, save your google time]

Step 1: http://fedoraproject.org/download more than 600 M livecd image file, the home page is 32-bit, you can click more to download 64-bit

Step 2: https://fedorahosted.org/liveusb-creator/ download liveusb production software, official.

Step 3: Prepare a USB flash drive. (It doesn't matter if there is data in it. It's not like pe in the production process. It will format you and keep the original data ),

Use the software to select the ISO you just downloaded, and then select your USB drive letter, and persistent storage to select 100 MB (this is equivalent

In Livecd, the/home mount point does not need to be written into the USB flash drive.) Click "creat" to complete the creation.

Step 4: Adjust the boot sequence of your bios or the notebook now supports quick boot. Select the USB flash drive to start it.

Start fedora 16 will appear after startup. Press enter to enter

[Some USB flash drives cannot be started after being created using the official windows liveusb creator. Try another USB flash drive. Or

Http://unetbootin.sourceforge.net/download this software for trial]

[English is used by default. If your English is poor, click the live user name in the upper-right corner of the screen, select system settings, and

Select region and language. In the displayed dialog box, select chinese. Click the user name, log out,

After logging out, you will be asked if you want to change the name of the folder under home. I suggest you do not make it Chinese, because it is troublesome in shell]

After LiveCD is started, you should first specify the partition where your fedora is installed. The current hard disks should all be sata.

/Dev/sdax, x is a number, 1 ~ 4 indicates the primary partition, and 5 is the logical partition. If you are using an IDE Hard Disk in a writable environment, it corresponds to/dev/hdax.

Open your Disk utility or Disk unity and find the partition where the fedora installation is located. I am on sda10, so let's take this description below ..

12 sumount -t ext4 -o rw /dev/sda10/media

Mount the installation partition of fedora to the current LiveCD file system. If you are too lazy, for example, me :), double-click it in the file manager.
Next, the partition will be mounted under/media/_ FEDORA _ ***.

Originally, the fedora installed on the hard disk only hangs the file directory. There is no hardware resource, and nothing can be done. It can only be used to copy/paste data,
Now, give the resource of the current system to him.

12345 sumount -t proc none /media/procmount -o bind /dev /media/devmount -o bind /sys /media/sysmount -t devpts devpts /media/dev/pts

In particular, do not write/dev as/dev /.
/Dev is not a block device

After mounting, use the chroot command to switch to the original fedora.

 

123 suchroot /mediagrub2-install /dev/sda

Of course, the above command indicates that grub2 is installed on the hard disk MBR for recovery boot. If you want to install it in the current partition for other software to boot, it should be
Grub2-install/dev/sda10

OK

 

1234567 exitumount /media/procumount /media/dev/ptsumount /media/sysumount /media/devumount /mediareboot

Of course, the above-mentioned grub is the original grub, and opensuse is gone. In fact, grub2 is very powerful and can automatically identify n systems. You only need to regenerate the configuration.
File.

123 sugrub2-mkconfig  -o  /boot/grub2/grub.cfgreboot

Congratulations

I encountered some problems when I was helping others fix them today. I 'd like to write them down and share them.

First of all: the partition of this computer is not a simple one/partition I wrote above, using LVM and a boot partition (sda8), then it will be mounted separately during mounting. In LVM, there is a root logical volume group and a swap volume group, located in/dev/mapper/vg_fedora_root, And/dev/mapper/vg_fedora_swap (this name is defined by yourself, if you use the default system partition for installation, the name is different if it is not manual)

 

123 sumount -o rw  /dev/mapper/vg_fedora_root/mediamount -o rw /dev/sda8/media/boot

Then mount the write resource.

Second: An error occurred while executing the grub2-install

1234 [root@Fedora sunhao]# grub2-install /dev/sda/sbin/grub2-setup: warn: Your embedding area is unusually small.  core.img won't fit in it../sbin/grub2-setup: warn: Embedding is not possible.  GRUB can only be installed in this setup by using blocklists.  However, blocklists are UNRELIABLE and their use is discouraged../sbin/grub2-setup: error: will not proceed with blocklists.

The embedding area between mbr and sda1 is too small. It should be the default value of 63. If it is 32, this problem will occur, but I run fdisk-lu, the computer is already 63, for unknown reasons.
Google did not find the solution or the installation was not possible. Later I saw this usage on the wiki and forced installation.

1 grub2-install--force  /dev/sda

It can be installed and started successfully ~

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.