CentOS+Ubuntu+Windows multi-system Grub boot repair

Briefly describe the situation:

  1. The system is installed with 64-bit Windows 7 and 64-bit CentOS operating systems, using Legacy BIOS to install and boot, without using UEFI.
  2. CentOS6.5 grub boot menu normally boots WINDOWS 7+CENTOS, CentOS contains /boot partition, / partition and /home partition
  3. After installing ubuntu 14.04 (64 bit), use the free partition alongside windows. After the installation is complete, use ubuntu grub to boot and start, only windows 7+ubuntu can be booted, centos cannot be started.
  4. In ubuntu system, install grub2/grub and then update-grub can not search centos normally.

In summary, I can only find other methods. Some people say that using the centos installation disk grub rescue is troublesome and want to boot with ubuntu. This is /boot/grub/grub.cfg under my ubuntu, add Centos partition information in it, be sure to pay attention to the partition and UUID. Successfully booted 3 systems!

menuentry 'CentOS6.5, with Linux 2.6.32-431.el6.x86_64'{
 insmod gzio
 insmod part_msdos
 insmod ext2
 set root='hd0,7'if[ x$feature_platform_search_hint = xy ]; then
 search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 e30284d7-5cf6-4864-a875-75012d8d9b14
 else
 search --no-floppy --fs-uuid --set=e30284d7-5cf6-4864-a875-75012d8d9b14
 fi
 echo 'Loading Linux 2.6.32-431.el6.x86_64 ...'
 linux /boot/vmlinuz-2.6.32-431.el6.x86_64 root=UUID=e30284d7-5cf6-4864-a875-75012d8d9b14 ro quiet splash
 echo 'Loading initial ramdisk ...'
 initrd /boot/initramfs-2.6.32-431.el6.x86_64.img
}

Let me mention here again. When installing ubuntu under a disk with windows installed gpt (mbr), if you cannot see the windows partition, but a whole hard disk, then use liveCD to enter the system and use the following command to repair:

sudo dd if=/dev/zero of=/dev/sda bs=1 count=8 seek=512

Recommended Posts

CentOS+Ubuntu+Windows multi-system Grub boot repair