I installed centos 6.5 on the server. UEFI is used by default. I didn't pay attention to using GRUB only. Then the problem occurs, I installed another hard disk with grub boot system on the server,
After the hard disk is started, if the hard disk is removed and restarted, The UEFI of centos 6.5 cannot be identified. You can start the UEFI of the motherboard and run the UEFI command:
mount fs0fs0:cd EFIcd redhatgrub.efi
The folder name may not be accurate. In this way, you can manually start the system. You can also insert the system disk to upgrade the system. You don't need to manually delete the folder or lose data.
This is not very good. So I had the idea of turning the UEFI-GPT back into MBR.
Google is always awesome, so I got the result of using gdisk. I started another system, mounted the hard disk of centos 6.5, and followed the steps on google:
Click "Applications." Point to "Accessories," then click "Terminal." Input the following into Terminal: sudo fdisk-l
Press "Enter" to see the disk devices connected to the computer. the device with the asterisk next to it is the boot device. write down the filename (for example,/dev/sda) assigned to the disk.
Input the following into Terminal: sudo apt-get install gdisk. Press "Enter" to install the partitioning tool to Ubuntu.
Input "sudo gdisk" into Terminal, then press "Enter" to run gdisk as a superuser. Input the name assigned to the boot device, then press "Enter" again.
Press "r," then hit "Enter," to switch to the recovery and transformation options. press "g," then press "Enter," to select the option to convert GPT to MBR on Linux.
Press "w," then press "Enter," to convert GPT to MBR on the primary partitions. Press "y," then "Enter," to finalize and exit.
After the operation is complete, the system cannot be restarted, and the UEFI manual guide will not work.
When humans think, God will laugh, but after thinking, they will find that they can still be saved,
Note in advance that centos 6.5 is installed in three zones, namely, sda1-UEFI zone, which is fat32, sda2 -- display the partition of the actual system and data that is NTFS (but ext4) under fdisk-l,
Sda3 -- swap partition.
After entering the system started by the USB flash drive, I mounted the sda1 partition to the mnt directory and found that there was a file grub in the efi-> redhat Directory. conf, people who often play the system know what this is. That's why I have hope.
The specific steps are as follows:
1. mount sda1 and copy grub. conf for later use. Do not use it! Then umount
2. Use fdisk to change sda1 to 83-linux, sda2 to 83-linux, and sda1 to startup partition.
The command process is as follows: fdisk/dev/sdat183t283a1
3. Make sda1 into ext3 because it is fat32.
Command: mkfs. ext3/dev/sda1
4. mount sda1 and sda2. Here, sda1 is in/mnt and sda2 is in/sda2. install grub, grub-install -- root-directory =/mnt/dev/sda for sda1, in this way, grub is installed.
5. Copy the backed up grub. copy the conf file to the/mnt/boot/grub directory and make a soft connection. the lst points to grub. conf command: ln-s grub. conf menu. lst
6. Run the/sda2/boot/directory in grub. the files used in conf are used by kernel, and the files used by initrd are copied to the/mnt/boot directory.
7. Modify/mnt/boot/grub. conf and change root (hd0, 1) to root (hd0, 0)
8. Save, sync, umount, unmount the hard disk, and restart.