Purchase Linux CDs / DVDs / Flash Drives at OSDisc.com

Welcome to Our Community

While Linux.org has been around for a while, we recently changed management and had to purge most of the content (including users). If you signed up before April 23rd, 2017 please sign up again. Thanks!

  1. Follow us on twitter - we shoot all of our new original content out as well as random messages. https://twitter.com/linuxdotorg
    Dismiss Notice

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

Discussion in 'Getting Started' started by danjpalmer, Mar 13, 2019.

  1. danjpalmer

    danjpalmer New Member

    Joined:
    Mar 13, 2019
    Messages:
    4
    Likes Received:
    0
    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:


    (Log in to hide this advertisement)


    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.
     
  2. wizardfromoz

    wizardfromoz Super Moderator
    Staff Member Gold Supporter

    Joined:
    Apr 30, 2017
    Messages:
    2,534
    Likes Received:
    2,124
    G'day Dan and welcome to linux.org :)

    ... 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,


    ... 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
     
  3. danjpalmer

    danjpalmer New Member

    Joined:
    Mar 13, 2019
    Messages:
    4
    Likes Received:
    0
    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.
     
  4. wizardfromoz

    wizardfromoz Super Moderator
    Staff Member Gold Supporter

    Joined:
    Apr 30, 2017
    Messages:
    2,534
    Likes Received:
    2,124
    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
     
  5. danjpalmer

    danjpalmer New Member

    Joined:
    Mar 13, 2019
    Messages:
    4
    Likes Received:
    0

    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
     
  6. wizardfromoz

    wizardfromoz Super Moderator
    Staff Member Gold Supporter

    Joined:
    Apr 30, 2017
    Messages:
    2,534
    Likes Received:
    2,124
    Safe Trip :)

    Wizard
     
  7. danjpalmer

    danjpalmer New Member

    Joined:
    Mar 13, 2019
    Messages:
    4
    Likes Received:
    0
    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!
     

Share This Page