• Important: We recently upgraded our forum software - please let us know if you run into any issues.

Install CentOS broke my Ubuntu install, how can I fix it?

danjpalmer

New Member
I purchased a pretty average laptop with the goal of installing various flavors of Linux on for testing.

The PC came with Windows 10.

I first installed the latest Ubuntu LTS install onto a new partition, worked well and have been using for a couple of weeks. Today I had need to install CentOS, which also installed and worked well on a new partition.

The issue now is when I choose to boot Ubuntu on start up I get these errors:

error: can't find command 'linux'
error: can't find command 'initrd'

Click to continue...
Any idea how to fix or what I could have done wrong during the CentOs install? I'm okay at using Linux but don't have a lot of experience in installing Linux OR multi-boot scenarios.
 


wizardfromoz

Super Moderator
Staff member
Gold Supporter
G'day Dan and welcome to linux.org :)

but don't have a lot of experience in installing Linux OR multi-boot scenarios.
... whereas I do (I run about 80 Linux on 3 rigs), but I had not seen that error before.

However a little Google-fu under

can't find command 'linux' error: can't find command 'initrd'

... gave me some answers I understand, and I'll refer you to them.

DO read through everything first before trying anything. :D

Particularly good, I found was

https://www.dedoimedo.com/computers/grub2-fedora-command-not-found.html

... but you can see in there, there is a chance you may end up in Rescue mode, which can be tricky. The article describes the issue as "Side Problem".

In your case, the regeneration of grub lines would be (#precedes my comment, not a command)

Code:
grub2-mkconfig -o /boot/grub2/grub.cfg

#AND

grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg


https://unix.stackexchange.com/questions/195583/error-cantt-find-command-linux-when-booting-system

... is short and sweet, but has, relevantly,

Do you have Secure Boot enabled? In that case, CentOS GRUB might be restricted to using only the linuxefi and initrdefi keywords instead of plain linux and initrd. – telcoM Nov 20 '18 at 21:50

... so it may be the case that you need to reinstall with Secure Boot disabled.

Questions arise:

1. Do you still have Windows 10 onboard?

2. Are you currently running in UEFI mode?

If you are not sure, enter this at Terminal and tell us the output

Code:
[ -d /sys/firmware/efi ] && echo "EFI boot on HDD" || echo "Legacy boot on HDD"
3. Is Ubuntu on top of your Grub menu or CentOS at the moment, and was that order changed with the installation of CentOS?

4. Do you prefer to boot into Ubuntu first or CentOS?

5. Do you have a lot of data in UBuntu that needs preserving, or customised settings that may be a nuisance to replace?

Bottom line is that I am thinking that the simplest solution might be to reinstall Ubuntu, this will likely place Ubuntu in the primary spot on the Grub menu, with CentOS 2nd, and Win 10 (if still there), at 3rd.

Let us know what you think and ask any questions.

Cheers

Chris Turner
wizardfromoz
 

danjpalmer

New Member
Hi!,

Thank you for your fantastic reply.

To answer you questions:

1. Do you still have Windows 10 onboard? Yes I do

2. Are you currently running in UEFI mode? Not sure, tried the commands below on the command prompt at boot and it failed. Did you mean I should log into CentOS and use terminal?

3. Is Ubuntu on top of your Grub menu or CentOS at the moment, and was that order changed with the installation of CentOS? Yes and Yes

4. Do you prefer to boot into Ubuntu first or CentOS? Purely depends on what I'm testing. This machine is for testing software on various Linux flavors (or at least that is the plan) so I have no preference in boot order.

5. Do you have a lot of data in UBuntu that needs preserving, or customised settings that may be a nuisance to replace? No, I don't. Reinstalling Ubuntu wouldn't be a complete pain, as long as it didn't then screw up the CentOs install!

I plan on installing RedHat at some stage, too. Hopefully that won't unearth more issues.
 

wizardfromoz

Super Moderator
Staff member
Gold Supporter
Thanks for the responses, Dan :)

1. & 2. You are likely on UEFI, as Win 10 prefers that environment. If you want to check, go to Start and type in the command

Code:
msinfo32
In the Summary page, right-hand pane about halfway down it will either say UEFI or Legacy/BIOS

2. Yes, in CentOS's Terminal you can type and enter that

3. I call this the TLS The Leaderboard Shuffle (like a golf major on the 3rd and 4th days :)), but technically the one on top is called The Primary Partition. This can change when new Distros are added, and it can also occur with certain updates such as Kernel updates, Firmware updates, and updates to the GRUB files.

4. Fine :p

5. Also good. Mate, reinstalling Ubuntu is not likely to adversely affect CentOS. It will put Ubuntu at 1 spot, CentOS at 2, and then Windows Boot Manager at 3.

Start taking a read of my Tutorial on Timeshift here, and you'll find it is easy to install on almost any Distro. If you want, you could put it on CentOS first, and take a snapshot, before reinstalling Ubuntu.

Or when you have both up and running, take a snap of both. Your call.

Ask any questions on Timeshift at the Tute.

On Redhat, RHEL (RedHat Enterprise Linux) is a commercial product, where you pay to get support and a licence. You can certainly choose to do that, or else its free equivalents and CentOS and Fedora.

Cheers

Wizard
BTW, if you choose to reinstall Ubuntu, you would choose the Something Else option early in the piece, and then simply reinstall over the top of the existing Ubuntu partitions. Sing out with any questions :D
 
  • Like
Reactions: Rob

danjpalmer

New Member
Thanks for the responses, Dan :)

1. & 2. You are likely on UEFI, as Win 10 prefers that environment. If you want to check, go to Start and type in the command

Code:
msinfo32
In the Summary page, right-hand pane about halfway down it will either say UEFI or Legacy/BIOS

2. Yes, in CentOS's Terminal you can type and enter that

3. I call this the TLS The Leaderboard Shuffle (like a golf major on the 3rd and 4th days :)), but technically the one on top is called The Primary Partition. This can change when new Distros are added, and it can also occur with certain updates such as Kernel updates, Firmware updates, and updates to the GRUB files.

4. Fine :p

5. Also good. Mate, reinstalling Ubuntu is not likely to adversely affect CentOS. It will put Ubuntu at 1 spot, CentOS at 2, and then Windows Boot Manager at 3.

Start taking a read of my Tutorial on Timeshift here, and you'll find it is easy to install on almost any Distro. If you want, you could put it on CentOS first, and take a snapshot, before reinstalling Ubuntu.

Or when you have both up and running, take a snap of both. Your call.

Ask any questions on Timeshift at the Tute.

On Redhat, RHEL (RedHat Enterprise Linux) is a commercial product, where you pay to get support and a licence. You can certainly choose to do that, or else its free equivalents and CentOS and Fedora.

Cheers

Wizard
BTW, if you choose to reinstall Ubuntu, you would choose the Something Else option early in the piece, and then simply reinstall over the top of the existing Ubuntu partitions. Sing out with any questions :D

Thanks again for all your excellent help, greatly appreciated.

I'm on the road until Sunday so I will action this when I return and aim to have an update on Monday/Tuesday next week!

Once I have both working I will definitely look at Timeshift before attempting another install!

Have a great weekend
 

wizardfromoz

Super Moderator
Staff member
Gold Supporter
Safe Trip :)

Wizard
 

danjpalmer

New Member
So, installing Ubuntu worked....but now CentOs is broken. I'm going to have to give up on this for now. Thank you for your help!
 

asdf02

New Member
multiple distros installation usually creates problem with grub(unless you know what you are doing), it is better to use virtualbox or vmware to test the OS for beginners. until you are confident enough or find the right OS for your regular usability, then only dual boot.
 

wizardfromoz

Super Moderator
Staff member
Gold Supporter
G'day @asdf02 and welcome to linux.org :)

Don't think me unkind, but

...then only dual boot.
... is just not so, I stop short of saying "Rubbish" as I can sense your heart is in the right place. :p

I have to go for my evening in Oz, but I will be back with more tomorrow.

Avagudweegend

Chris Turner
wizardfromoz
 

wizardfromoz

Super Moderator
Staff member
Gold Supporter
Good Morning, all :)

Dan

1. Can you enter that code from my point 2 in #2 on your Ubuntu and report back? (on EFI vs Legacy)

2. Can you take eg a phone pic and upload it, of your Grub Boot Menu as it is currently?

3. Can you give us a GParted screenshot (from Ubuntu), of your "State of The Nation" (see mine below)? Either that, or the outputs of (a # precedes my comment, not an instruction)

Code:
lsblk

#(those are L's) AND

sudo fdisk -l

# also an L
... will do for now.

4.
....but now CentOs is broken.
Can you give us exact error/s?


On Multibooting - My Dell Inspiron shipped with a 256 GB SSD and a 2 TB HDD, with 16 GB RAM.

I also have a 4 TB Western Digital My Book hooked in via USB 3, with over 30 LInux Distros.

Here are a couple of screenshots.




SCREENSHOT 1 - WIZARD'S WD MY BOOK

Features 24 Linux Distros currently working happily side-by-side (going to removed /dev/sdc26 Debian, as now have one with wifi working at /dev/sdc12). I use GParted as a forward planner, and I use it daily.

Also featured is a 400 GB partition for Timeshift, which houses the snapshots for my entire system. No Downtime for The Wiz, 10 - 15 mintues with a restore and I am back in business :p

Note there is ... NO SWAP. Not needed, and that's a fact, not just an observation (unless perhaps you do extensive video or music editing, or a lot of Google Earth-ing). If you have 6 - 8 GB RAM, it (swap) is a waste of space.




WIZARD'S SOLID STATE DRIVE

... has Windows 10 and a further 9 LInux Distros. All work. Windows is shrunk to a bare minimum, but I may have to give it a little more space because of its incessant updates.

My /dev/sda 2 TB HDD not shown here, has 2 Legacy Linux on it for helping purposes and is currently formatted to MBR. Once I finish those experiments, I could just as easily revert it to UEFI-GPT, and throw another 50 Linux on it.

On my secondary rig, a Toshiba Satellite, I have the partitions numbering into the 50s, but with 8GB of RAM, it is getting a bit sluggish (and not because of lack of Swap, lol).

For Dan's purposes, we could regard his one drive (I take it that is so?) as being like my SSD - Windows 10, my BeaverMATE is like his Ubuntu, and my Fedora equates to his CentOS.

Virtual Machines such as VBox and VMWare have their uses, but there is a steep learning curve, easier just to do a full install.

With the VM, if you have 2GB or less of RAM, it is a waste of time, and if you have 8GB, you have to allocate at least 4GB to the Guest OS just to get an idea of performance. If Dan is prepared to do that, we have people here who can help with VM.

Cheers

Wizard

Once I have both working I will definitely look at Timeshift before attempting another install!
Nope, better is get one running, take a Timeshift snapshot. Get the 2nd running, take a Timeshift snapshot. Hindsight is great (not).
 
  • Like
Reactions: Rob

Members online


Latest posts

Top