Dual booting UBUNTU and CENTOS

General support questions
mahmood
Posts: 122
Joined: 2017/06/04 12:21:09

Dual booting UBUNTU and CENTOS

Post by mahmood » 2019/06/25 14:20:55

I have a working Ubuntu 18.04 which has
/
EFI
/home
SWAP

Now, I want to install centos 7 which should be dual booted.
I want to know should I reformat EFI or not?

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Dual booting UBUNTU and CENTOS

Post by TrevorH » 2019/06/25 14:57:04

No.

You might find it easier and less risky to use a VM instead.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

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

Re: Dual booting UBUNTU and CENTOS

Post by mahmood » 2019/06/25 15:31:53

I can not use VM due to working on a physical GPU.
I see that working with efi is annoying and not as easy as ten years ago!

For a test, I installed centos with a separate /boot/efi as you can see in the picture (attachment #1). With this installation, after POST, I only see ubuntu grub page (purple colored grub). The is no sign of centos.


If I reformat /boot/efi, I get this error (attachment #2)


If I leave /boot/efi untouched, I also this error (attachment #3)


Is there any other path which I missed?!
Attachments
3.jpg
3.jpg (151.42 KiB) Viewed 7741 times
2.jpg
2.jpg (150.36 KiB) Viewed 7741 times
1.jpg
1.jpg (174.52 KiB) Viewed 7741 times

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Dual booting UBUNTU and CENTOS

Post by TrevorH » 2019/06/25 15:38:04

You can only have one EFI system partition so you will have to share it between Ubuntu and CentOS. CentOS uses a path of /boot/efi/EFI/centos for its files, hopefully ubuntu uses something different! You cannot format it as it contains your ubuntu kernels etc. Or perhaps contained might be more accurate...
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

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

Re: Dual booting UBUNTU and CENTOS

Post by mahmood » 2019/06/25 15:43:44

So, that means nothing can be done since I shouldn't reformat EFI and centos installer can not put itself in a separate path in the existing EFI.

That means, I have to backup my ubuntu files and destroy that.

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Dual booting UBUNTU and CENTOS

Post by TrevorH » 2019/06/25 15:52:44

You should be able to mount the existing EFI partition on /boot/efi in the installer. And choose not to format it.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

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

Re: Dual booting UBUNTU and CENTOS

Post by mahmood » 2019/06/25 16:13:25

Seems to be impossible... Here is what I did:
As I said I had a centos installation but it doesn't appear in the grub. So, I booted the installer again and made the following modifications.
1- removed the separate EFI.
2- removed /
3- removed /home
4- keep SWAP.
Then I clicked DONE and got an error. You can see that in the first picture.

I again clicked DONE and it showed me a summary of what is going to be done (picture 2).

I clicked on accept and then it returned to the main wizard with red colored error message for the disk. I reopened the disk section and saw another error "no valid boot loader target device found" (picture 3).
Attachments
3.jpg
3.jpg (161.74 KiB) Viewed 7717 times
2.jpg
2.jpg (164.84 KiB) Viewed 7717 times
1.jpg
1.jpg (136.04 KiB) Viewed 7717 times

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Dual booting UBUNTU and CENTOS

Post by TrevorH » 2019/06/25 16:16:49

You *need* a separate EFI partition if your machine is using UEFI. It's not optional. You also require a /boot partition. If you try to install without those being specified it will not work.

And I did a test install in UEFI mode, created a /boot and /boot/efi and did the install then did it again to see if it was possible to re-use the existing /boot/efi partition without formatting and it is.

You must specify all the filesystems that CentOS needs to perform the install. Those will be /boot, /boot/efi (must be specified as an EFI System partition in the installer) and then you will need a root filesystem and, optionally, things like /home, /var and /tmp.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

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

Re: Dual booting UBUNTU and CENTOS

Post by mahmood » 2019/06/25 16:55:46

OK. I specified /boot and the errors were fixed. But that is not all...
I selected /boot/efi but didn't reformat it. I expect the installer to append centos to the existing efi which contains ubuntu.

After installation and reboot, I see it automatically enters Ubuntu. It does take quite long time to boot. I think that is related to some layout changes, but not sure why...

After login to the ubuntu, I check "fdisk -l" and see this

Code: Select all

Disk /dev/nvme0n1: 232.9 GiB, 250059350016 bytes, 488397168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 3BA5EDB4-10D3-472A-ACD0-71A58A584CD0

Device             Start       End   Sectors  Size Type
/dev/nvme0n1p1      2048 136718335 136716288 65.2G Linux filesystem
/dev/nvme0n1p2 136718336 138719231   2000896  977M EFI System
/dev/nvme0n1p3 138719232 261599231 122880000 58.6G Microsoft basic data
/dev/nvme0n1p4 261599232 263032831   1433600  700M Microsoft basic data


Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 9DAC5E70-936E-4565-82B6-EC73224C8FAE

Device          Start        End   Sectors   Size Type
/dev/sda1  1945524224 1953523711   7999488   3.8G Linux swap
/dev/sda2        2048  390625279 390623232 186.3G Linux filesystem
/dev/sda4   392058880  801658879 409600000 195.3G Microsoft basic data


I also see many /dev/loopX where X is number, e.g. 1, 2, ..., 15

In the output please note that

nvme0n1p1 --> / (for ubuntu)
nvme0n1p2 --> efi (should be shared)
nvme0n1p3 --> / (for centos)
nvme0n1p4 --> /boot (for centos)

sda1 --> swap (should be shared)
sda2 --> /home (ubuntu)
sda4 --> /home (centos)

Did I miss something?

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

Re: Dual booting UBUNTU and CENTOS

Post by mahmood » 2019/06/25 16:57:06

These two statements are confusing
You should be able to mount the existing EFI partition on /boot/efi in the installer. And choose not to format it.
and
You *need* a separate EFI partition if your machine is using UEFI. It's not optional
Can you explain more?

Post Reply