Add CentOS's entry to Grub2

Hello, I have 3 OS in mi laptop: openSuse 13.2, Win 8.1 and CentOS 7, I run the following commands:


#grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found theme: /boot/grub2/themes/openSUSE/theme.txt
Found linux image: /boot/vmlinuz-4.0.5-2.g0e899eb-desktop
Found initrd image: /boot/initrd-4.0.5-2.g0e899eb-desktop
Found linux image: /boot/vmlinuz-3.16.7-21-desktop
Found initrd image: /boot/initrd-3.16.7-21-desktop
  WARNING: lvmetad is running but disabled. Restart lvmetad before enabling it!
  No volume groups found
Found CentOS Linux release 7.1.1503 (Core)  on /dev/sda12
Found Windows Boot Manager on /dev/sda2@/efi/Microsoft/Boot/bootmgfw.efi
Found openSUSE 13.2 (x86_64) on /dev/sda8
done


#grub2-install /dev/sda
Installing for x86_64-efi platform.
Installation finished. No error reported.

But when I reboot I can only see openSuse 13.2 and Win 8.1. CentOS info: boot is in xfs, / and home are in the same partition in brtfs file system (I had problems with the GUI installer, and I had to use text installer). Thank you

Sorry I can’t edit the post. Well, I have to use my Lenovo’s Novo button in order to boot CentOS


#df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        3.9G     0  3.9G   0% /dev
tmpfs           3.9G   80K  3.9G   1% /dev/shm
tmpfs           3.9G  9.0M  3.9G   1% /run
tmpfs           3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/sda12       58G   14G   43G  24% /
/dev/sda12       58G   14G   43G  24% /home
/dev/sda10      494M  230M  265M  47% /boot
/dev/sda2       256M   37M  220M  15% /boot/efi

but I want to boot CentOS from grub2.

Was Centos installed as legacy or EFI?? if you used mix modes then you can’t boot both by grub

when I run df -h in Centos, it shows /dev/sda2 256M 37M 220M 15% /boot/efi , so I think is EFI

#df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        3.9G     0  3.9G   0% /dev
tmpfs           3.9G   80K  3.9G   1% /dev/shm
tmpfs           3.9G  9.0M  3.9G   1% /run
tmpfs           3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/sda12       58G   14G   43G  24% /
/dev/sda12       58G   14G   43G  24% /home
/dev/sda10      494M  230M  265M  47% /boot
/dev/sda2       256M   37M  220M  15% /boot/efi

The CentOS’s installer in text mode is horrible, it uses automatic partitioning, so i am not sure, it has 3 options:

-Brtfs: the actual one, in which I can’t see the entry.
-LVM: I can boot Centos from openSuse grub2, but I get black screen.
-standar: the horrible xfs and I can’t resize partitions, but I can boot from openSuse grub2 withour problems.

I think maybe is a brtfs issue, im not sure, in CentOS forum nobody answer xD, and I want to use openSuse grub2 because I like it :P. And I find this case curious.

Well look into /boot/efi and see if there is a centos directory. I don’t know what centos mounts by default in any given mode. Maybe also show fdisk -l so we all know your layout.

It is most likely is. Please run os-prober and upload full /var/log/messages (or journalctl output) between start and end of os-prober run to susepaste.org, post link here. Also post /proc/self/mountinfo from CentOS.

Actually, you can.

For example, I have Mint installed as legacy (but it is x86_64). I am booting it with EFI. It does get an entry via grub2-mkconfig.

I think the problem here is related to the use of “btrfs”, but I don’t know enough about that to be sure.

What I would do is add a boot entry to “/etc/grub.d/40_custom”

Possibly the following will work:


menuentry "configfile for CentOS on sda10" {
     configfile (hd0,10)/grub/grub.cfg
{

except that maybe “(hd0,10)” isn’t correct for GPT partitioning. It might need to be something like ‘hd0,gpt10’.

This also assumes that theres a “/boot/grub/grub.cfg” in the CenOS system. If it is “/boot/grub2/grub.cfg”, then make adjustments.

i run opensuse 13.2 and SL 6.6

now 6.6 has it’s own /boot partition ( as a backup )

now this means that suse needs to “probe foreign OS” in the boot config gui

yast2
Click on “boot loader”
click on “bootloader options” TAB
and put a check in the check box

now

this DOSE cause a bit of a complication for installing my nvidia.run driver in SL6.6

for example after a kernel update on sl6 this needs to happen

reboot into suse 13.2
rerun the ABOVE bootloader GUI
( this updates the suse grub to the UPDATED sl6 kernel )

boot into sl6 in text mode FROM/USING the suse grub

install the .run into sl6
reboot

use as normal

a bit of extra work BUT
from the bios i can choose
suse to boot sl6

and sl6 also boots suse
( after re-updating that one for changes to suse )