Install CentOS on top of Ubuntu (dual boot)

15,095

Solution 1

Just install normally. When the installer asks you to choose where to install, direct it to your data drive, have it create a new partition from the available space and install CentOS there. It should be perfectly straightforward.

You should consider, however, that there is not much point to this apart from your own curiosity. Anything that CentOS can do, Ubuntu can as well ad vice versa. If you need to install a particular package that only exists as an RPM, there are other to do so without installing a whole new OS. You could also install on a virtual machine if you just need the CentOS for specific tasks.

Solution 2

"My 2 cents on this: “Anything that CentOS can do, Ubuntu can as well ad vice versa.” This is true and false at the same time."

No, it's simply false. That is why there are multiple Linux distros.

https://www.reddit.com/r/linux/comments/5z6yla/difference_between_linux_distributions/

Given infinite time sure maybe you can do anything on any distro. Probably the general method would be to just overwrite the install with the other distro!

A VM likewise. The reason that I'm even looking at this page is that Ubuntu has no official NI support while RedHat/CentOS does.

I am sure that some user-group has hacked some NI RPM-based installers and gotten the SW of interest to them to run on Ubuntu or some other Debian-based system*

But there is a difference between doing that and running the official RPM installers on an officially-supported OS.

To the point here: I would suggest creating a separate install of CentOS entirely on the 2nd drive as a separate boot drive. Linux is a funny thing. There's what should work, what did work, what should have happened and what actually did happen. When it comes to sensitive installs, you don't want to take a chance with "what actually did happen" turning-out to be wildly different from what you needed to happen. That's why you want to try these things on scratch configs or VMs. But sadly a VM is not a real machine, and certainly not the real hardware that you're working with. Scratch configs, likewise, are not the actual config that you're working with (and hoping to keep working). The only way that you're going to find out whether your efforts will require a reformat and reinstall or not, is to actually try. But before you do that, can you actually do a config backup & restore? A reinstall from source? Is your data backed-up, at least? Are you unconcerned with your config &/or data?

if not, probably a 2nd computer with a NAS would be a great option. Or shared partitions. You can always run apps remotely on each machine.

Despite the insanity of doing this, I'm trying it anyway...sacrificing my personal laptop to the Cause of Higher Learning...

6 hours and I still haven't gotten CentOS 8.11 up and running side by side with Ubuntu 18.1

Despite this incredibly-helpful page and its links. https://help.ubuntu.com/community/UEFI

Which I suggest that you read very carefully before attempting this. Pretty much the whole day shot behind this. I had to use unetbootinstall to even get a functional flash drive with the install media. But it won't complete the boot to GUI even. It refuses to start and drops out into emergency mode. But at least this starts the install, when I created the stick using the built-in Ubuntu tools it would boot to the GRUB prompt and sit there. I suspect that the little error message after identifying the chip as an AMD chip (HP12 laptop) is an indication of what is going wrong and where. But maybe I have a corrupt DVD download. So I'm trying the 8 x64 ISO from another mirror. Should I try the 585MB base version or the 7GB full version? HM.

....

Day 2, COB: some half-sucesses, some lessons learned. A major problem is in actually creating the flash drive from an ISO file. This has to be done correctly for it to work. It's quite a bit more complicated than it seems...

After many repeated attempts to make one that would actually work properly I finally got CentOS to run on a flash drive, using the "LiveDVD" file. This has some benefits in that it's an actual working install that runs off the flash drive & has a local root, /home, /usr/local...it's a self-contained Linux install. LV does not officially support CentOS-8 yet but the main thing is to use an image-writer that actually works on the hardware that you're trying to use it on with the OS that you're trying to use it with. For my HP15 AMD system, this turned out to be the built-in Ubuntu 18.01 software that you can access with a right-click on the file icon in the "file explorer" menu (but I updated and patched the OS at least once along the way). There are 2 ways to get into this one by right-clicking and selecting "Open with Other Applications" and then selecting "Disk Image Writer", the other by using the Tools/Disk Tools and then clicking on the device of choice, then the gears icon under that and then using "restore partition image". The last is how I first tried it then I tried unetboot then the "Disk Image Writer".

The other problem is that the ISO has to actually boot, into the Linux shell or GUI as appropriate, on your hardware.

The smaller "minimal" ISOs seem to have the required configuration to minimally INSTALL the OS on your hard drive by default. The larger "LiveDVD" seem to be configured to RUN the OS on your flash media by default. Either way they have to work with the hardware, and they have to be properly set up to work with your hardware, and that can mean that you need an EFI boot manager installed on the boot media with a copy of grub properly set up to use it also. If the tool that you use to make the image on flash isn't even EFI aware or doesn't configure the flash to boot successfully as opposed to just creating the ISO partition not the required partition-set (involving the required EFI boot manager), then there is no chance that you're going to build a successful boot-flash with it unless you switch the hardware boot mode to BIOS (Legacy/CMD). Likewise if the version of the OS isn't EFI-aware.

So you need to learn at least something about EFI if you're going to use EFI & SecureBoot as opposed to legacy BIOS boot and CMD (CDM?).

But again I'm doing this the stupid way on purpose just so I can see what goes wrong. I want to see if I can get a true multi-OS hard drive boot config set up in my laptop. Otherwise I'd just use a different flash drive for each OS I wanted to run, put the boot partition on it, install any apps that require that OS into that boot partition and then let the internal drive be common storage. When you're ready to stop using the flash drive then create a boot partition on the internal drive and clone the flash drive onto it. Even better you can do all your configuration testing with flash drives.

But the first 7 times I tried to install CentOS it would not load to the GUI because of the "dracul" error, which I believe happened because the ISO imager wasn't creating the boot partition properly and grub did not know where to find the proper kernel. Not saying that I understand it completely but I think that's the general idea.

Anyway, with Linux you can never be sure, ever, 100% sure that it will do what you think that it will do until you've tried it and done it successfully several times. It usually will. But I wouldn't bet my life on it. For example, switching back to my Ubuntu hard drive based boot from the flash-based CentOS 7, my wifi wouldn't work at all until I did a power-off/power-on with the laptop.

It all becomes really easy when you know what works and what does not work from experience. Then you can sound like an expert and talk about "what should work" and "what should not be a problem" because it works for you with the software and hardware that you use...and if not, "then it's trash and should be thrown out" ;)

Seriously I believe that there are people out there who can get just about anything to work with Linux as long as they can modify the source-code to get it to work, not to mention modify the installation configuration to get it to work. The problem is when they start to expect people to do that, when that becomes a "rite of passage" for using Linux. People like that are happy to see users & sysadmins run back to Windows with their tails between their legs. MS sees that and says, "what, Windows wasn't hard enough for you to work with? No problem! We'll just make you use Linux!"

Solution 3

Ok I got CentOS8 to dual-boot with Ubuntu 18.1

took me a week to get it but I got it.

CentOS7 will work too but it isn't as flexible as CentOS8...it doesn't support LVM or NTFS, and I think also XFS, CentOS8 still doesn't support NTFS I think

basically you will need to do a clean install of the target drive (unless you know the ins and outs of Linux partitioning, grub EFI (if you use SecureDrive) and boot configuration...it is easier to install CentOS8 as a single OS and then install Ubuntu. The installer for Ubuntu is smart enough to handle this and will allow you to resize the target partition to share space on it between the two OSes.

CentOS seems to happily destroy any previous boot configuration, while Ubuntu will work with you on this.

So I backed up all my data to an external drive, used the disk icon mounter to put a CentOS install ISO on a thumb drive, used that to install CentOS8 on my internal drive, then used the DIM again to put Ubuntu 18 Live on the thumb, used that to set up the dual-boot and then restored my data. And it works fine.

I avoided LVM but I used Ext4 with standard partitioning. CentOS8 I used the custom disk partition configuration option and manually set up 1GB /boot/efi (as EFI), 4GB swap and the rest / (as efs4) and it booted fine. The previous week was spent trying to get the thumb to boot and install, which involved using multiple utilities and the built-in nautilus boot writer worked just fine. The problem is that you have to use an ISO image that actually boots and installs. Disk Image writer in Nautilus works great. Just right-click on the ISO and use DIW and restore it to the thumb drive.

CentOS-7-x86_64-LiveGNOME-1908.iso CentOS-7-x86_64-Minimal-1908.iso CentOS-8.1.1911-x86_64-boot.iso ubuntu-18.04-desktop-amd64.iso are what I used.

If you get dracul errors with CentOS (AMD gpu or RAID-type issues) try using "exit" to get past them. But that should not stop the installer from loading and running properly. Try the Live DVDs, they should work fine. This is working fine on my HP15 AMD-based laptop with a WDC internal drive and 4 different types of external hard drives and flash cards.

I don't know how well CentOS8 will update (hopefully without destroying the configuration) but I'll document the drive configuration before then, and backup also. I can almost guarantee you that if you try to install CentOS7 on top of Ubuntu or even to a 2nd drive that you will end up with a working CentOS install and a broken Ubuntu install, but I've only tried that with CentOS7 not with 8. I initially hoped to have one ext drive with CentOS7 and another with Ubuntu and just select the one I wanted to boot from...but I had to deal with the data at some point and I figured why not just get my laptop to dual-boot if possible so I tried it but with CentOS8. I know it works fine if you start with CentOS8 and then install Ubuntu 18.01 next to it. It may work the other way around but that's an experiment that I don't need to try now.

And the use of standard partitioning vs LVM may have some long term implications if you want to upsize the partitions later but again that is better dealt with by starting with a clean install. Probably better to find a way to mount your internal drive externally and use that to restore the data.

Note also that there is another option, you could install one or the other and just use the new container tech that Canonical has developed to alleviate the problem of running apps built for one (debian vs redhat) on the other.

Audacity is not built to run on RedHat type distros (unless you can build it from source on an RPM machine and get it to work) so this will get it to work in CentOS as an example.

https://snapcraft.io/install/audacity/centos

as opposed to trying to get rpms to run on Ubuntu or using a VM (which divides memory). More than one way to skin a cat.

But definitely back up your data as it totally suxxx to find your working config has just gotten munged, the required distro will not boot and you're very unsure how to fix it if you can even fix it.

Share:
15,095

Related videos on Youtube

S. Robert James
Author by

S. Robert James

Updated on September 18, 2022

Comments

  • S. Robert James
    S. Robert James over 1 year

    I have a Ubuntu desktop and would like to install CentOS on top of it as a dual boot. The machine has two drives, each with one partition. I don't want to risk harming my Ubuntu installation. I'd like to keep Ubuntu on the first drive, and put CentOS on the second one (which currently just has extra data). How can I do this?

  • S. Robert James
    S. Robert James over 10 years
    Will CentOS play nicely with the existing bootloader?
  • terdon
    terdon over 10 years
    @S.RobertJames yes and no. Basically, it will install a new grub, overwriting the existing one that will let you choose between Ubuntu and CentOS. So, no, it won't play nice but you don't mind. Alternatively, tell it not to install grub at all and then run sudo update-grub from Ubuntu. That will detect the CentOS and add it to grub. Seriously though, consider a VM instead.
  • Giacomo1968
    Giacomo1968 about 9 years
    My 2 cents on this: “Anything that CentOS can do, Ubuntu can as well ad vice versa.” This is true and false at the same time. Yes, all Linux is Linux. And when you commit to CentOS or Ubuntu you are basically just dealing with how one team pieced together a workable OS from the various open source pieces out there. But there are many things in CentOS that work similarly to Ubuntu, but are just slightly different. Such as different locations to config files or even naming conventions. Such as Apache2 on Ubuntu is just apache2 while on CentOS it’s httpd. Something to keep in mind.
  • terdon
    terdon about 9 years
    @JakeGould well, yes. Obviously. What I said is that anything one can do, the other can also. Not that they're identical or even that they do it in the same way. Of course there are differences in things like package names, default locations, even user management styles and administration approaches, let alone init systems and package managers. All I said was that there is no function that one distro can do that another can't.
  • davidgo
    davidgo over 8 years
    Just jumping on the CentOS vs Ubuntu bandwagon, while they are both exellent Linux distros, they can't do all the same things in different ways. Ubuntu is a Desktop based distro, and quite progressive in what it allows and supports, while CentOS is a Server based distro, and provides greater stability - at the cost of limiting some of the things you can do due to running a more conservative and "backwards compatible" setup. [ I guess Ubuntu LTS is something of a Hybrid in this regard ] - and yes, I use both, daily.
  • Fiisch
    Fiisch about 4 years
    "CentOS7 will work too but it isn't as flexible as CentOS8...it doesn't support LVM or NTFS, and I think also XFS, CentOS8 still doesn't support NTFS I think." This is simply wrong. CentOS7 does support LVM and XFS natively. For NTFS support to work you generally have to install FUSE drivers.
  • avia
    avia almost 3 years
    This. is. so. not. absolutely.NOT. what OP asked. Like, you go on with a novel about bragging how CentOS is great and fine. That was NOT the question bro. This is a wrong wrong answer. OP asked and let me re-state it clearly "Install CentOS on top of Ubuntu (dual boot)" So. basically, how to DUAL BOOT, not how to work anyways with CenOS or any Linux flavor for god sake. Just answer the question. I HATE CentOS.
  • avia
    avia almost 3 years
    Thanks for the feedback! You need at least 125 reputation to cast a vote. Well here's my vote: bad answer.