Dual booting UBUNTU and CENTOS

General support questions
User avatar
TrevorH
Forum Moderator
Posts: 28571
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Dual booting UBUNTU and CENTOS

Post by TrevorH » 2019/06/25 17:37:39

You need one and one only EFI system partition. It needs to be used by all installed operating systems including all linuxes and Windows (if any). It must be on a GPT labeled disk and you must tell the installer to mount it on /boot/efi. If you format it then all its previous content will be lost and you will no longer be able to boot any previously installed operating systems.

You also need a separate /boot primary partition. It must be formatted using ext3/4 or xfs. You wil be mounting your EFI system partition on an empty directory on that filesystem called 'efi' and the installer will create it for you if it doesn't exist (for example, because you just formatted /boot!).
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

mahmood
Posts: 120
Joined: 2017/06/04 12:21:09

Re: Dual booting UBUNTU and CENTOS

Post by mahmood » 2019/06/25 17:49:51

OK. As you can see in my previous post (viewtopic.php?f=47&t=70896#p298131), there is only one efi partition. I explained there.

So, why there is no sign of centos in the grub menu?

centguy
Posts: 251
Joined: 2008/08/11 16:03:29

Re: Dual booting UBUNTU and CENTOS

Post by centguy » 2019/06/26 04:12:55

mahmood: You mentioned slow boot of ubuntu. I had the experience that LinuxMint (Debian derived, same as ubuntu or MX Linux) that
its /etc/fstab has a hardcoded SWAP UUID line. So when you install a new OS that reformats SWAP, you might incur TWO 90 secs in two places
during
booting. I wonder the same thing happens to you. [ It was not easy for me to find out this since the booting was "quiet" even though
I took out "quiet" in the vmlinuz line
but that is because linux_gfx_mode was set to "keep" that was not working. "text" will enable all messages on the screen.
i share this to remind myself and others who want to multiboot/explore other OSes]

You said 'no sign of centos in the grub menu', I suspect you are using the ubuntu bootloader that reads its grub.cfg.

If you cannot see CentOS, then you need to learn to change the boot sequence in the
startup screen (meaning hitting F2/F9/ESC/ etc when you turn on computer). [It is not that simple-minded
BIOS anymore. Basically UEFI keeps all bootloaders in /dev/sda1/efi/EFI/LinuxX].Another way,
if you are in Ubuntu, do 'update-grub' will generate a grub.cfg that might contain you new OS and you can
choose CentOS when you reboot. But eventually you need to learn to
chainload to keep things simple:

Code: Select all

menuentry "Chainload use grubx64.efi" {
insmod part_gpt
insmod fat
set root='hd0,gpt1'
chainloader /EFI/ubuntu/grubx64.efi
}
The problem with UEFI is that it seems a tall order to install both LinuxMint and Ubuntu since one will overwrite the existing one
in the EFI directories, so the newer wins. But that is another story.

owl102
Posts: 371
Joined: 2014/06/10 19:13:41

Re: Dual booting UBUNTU and CENTOS

Post by owl102 » 2019/06/26 07:16:13

mahmood wrote:
2019/06/25 15:31:53
I see that working with efi is annoying and not as easy as ten years ago!
I disagree. Ten years ago you had to struggle with overwritten boot loaders, boot entries etc.

You just need to mount your existing one-and-only ESP (EFI System Partition) to /boot/efi during installation, without reformatting. This way the Ubuntu boot loader remains intact and CentOS will install its bootloader into the ESP additionally.

Afterwards you can choose between operating systems in your UEFI menu, furthermore you can set and change the default boot loader. (The latter could be done with "efibootmgr" from within Ubuntu/CentOS, too.)

Regarding the boot menu entry: It seems that Ubuntu is (still) your default boot loader. "os-prober" within Ubuntu should detect the new CentOS boot loader, and as already told by centguy you just need "update-grub" (as root) to include CentOS into the boot menu of Ubuntu. As alternative you could use the UEFI boot menu of your computer to select either Ubuntu or CentOS. (How to get to the UEFI boot menu differs from computer from computer, often you need to press F12 after switching the computer on.)
German speaking forum for Fedora and CentOS: https://www.fedoraforum.de/

Post Reply

Return to “CentOS 7 - General Support”