• How do I use Grub from an earlier Linux installation?


    I have a laptop on which I have three OSs, Antergos, Windows 10 and Ubuntu. I installed the Ubuntu long after I had the Antergos on the system, so since I installed the Ubuntu, my laptop uses Grub in the Ubuntu installation.

    That was no problem, but now I want to remove the Ubuntu installation so I can use that disk space for storage. I’m pretty sure that if I just reformat the partition that the Ubuntu is on, I won’t be able to boot my machine. What should I do so that my machine boots from the Grub on the previously installed Antergos installation.

    I’ve attached a screenshot of my SSD configuration as shown by gparted.
    I’m not sure what sda1 is. Desconhecido=unkown
    sda2 is the Windows.
    sda3 is the Antergos
    sda6 is just for storage (armazem)
    sda7 is the Ubuntu

    0_1510573270369_gparted.png

  • @rpallen
    Thanks for your well formulated question! :)
    And yes, it seems that Ubuntu is in control of booting, so just deleting the Ubuntu space is not a good idea.

    Just to make sure, you seem to have a non-UEFI system?

    If so, then

    • boot into Antergos
    • update Antergos with pamac-updater or “sudo pacman -Syyu”
    • run commands:
    sudo grub-install /dev/sda
    sudo grub-mkconfig -o /boot/grub/grub.cfg
    

    and test that everything you want to keep works.
    Then you can take the Ubuntu space (/dev/sda7) into another use.

  • @rpallen

    From antergos

    Please click here to return the console:

    cat /etc/default/grub and cat /etc/fstab
    ?

  • Thanks, manuel.

    I don’t remember how I did my Antergos install, it was a couple of years ago. I bought a machine with Windows 10 installed and then installed Antergos WITHOUT UEFI. Again, I don’t remember how.

    I’m pretty busy this week and I can’t afford the time to try to figure things out if I “break” my system. I doubt that doing as you suggested will break anything, but I can’t take that chance right now. I’ll have time this weekend to fool around with backing stuff up and breaking broken stuff (in the unlikely event something breaks) then, so I’ll probably do as you suggested this coming weekend.
    Thanks again.

  • @rpallen OK, take your time, we’ll be here if you need any more help with this. :)

  • Only to complete:

    It is a good way to mount all partitions before generating grub.cfg (can be done from inside nautilus filebrowser)
    This will make the generation much faster!

    mark: if you install grub when ubuntu is still installed, it will create a menu entry for ubuntu too, so may you need to regenerate the grub.cfg after removing ubuntu again.

    [updates once a week] = [90% less problems]
    [Li{u}n//u//{i}x] since 1988 - overcoming failure means success
    howto-install-antergos
    how to add system logs
    i3 GNOME

  • @joekamprad said in How do I use Grub from an earlier Linux installation?:

    It is a good way to mount all partitions before generating grub.cfg (can be done from inside nautilus filebrowser)
    This will make the generation much faster!

    Also installing package lsb-release makes generation faster! No additional mounting needed. The problem (slowness) seems to be related to a bug(?) in os-prober package.
    I noticed it when running update-grub in Manjaro and not having lsb-release in Antergos, it was extremely slow (took extra 12 minutes!).

  • I follow with high interest.
    I have exactly the same situation of @rpallen.

    1. Antergos KDE
    2. Windows 10
    3. Ubuntu 17.10.
      Antergos is my daily use, Windows ( :()just when I need to use it for work once a week more or less, the 3rd is a partition I use to give a try to new releases of Linux distros.
      Once I installed a distro and made the error to install the grub too, deleting ( I should say disabling?) the one of Antergos. I’m trying to fix the issue from a long time, to give the grub back to Angergos, but I’m afraid to break the system.
      My solution must be a little different, because I’d like not to delete Ubuntu, so I should move grub from Ubuntu to Antergos.
      I am wondering if I better make a new post?..

    Antergos KDE + Ubuntu 17.10

    • Windows 10
      Motherboard Asus P8H67-M LE - CPU: Intel Core™ i5-2400 CPU @ 3.10GHz - RAM 10 Gb
      Samsung EVO 250 Gb Ssd + WD HDD 2 Tb
  • @manuel said in How do I use Grub from an earlier Linux installation?:

    lsb-release

    Yes not real faster here… it needs 3 minutes without mounting partitions…
    with mounted partitions it takes less then 15 seconds…

    Do you mean here having lsb-release installed in the second linux-OS installed?

    [updates once a week] = [90% less problems]
    [Li{u}n//u//{i}x] since 1988 - overcoming failure means success
    howto-install-antergos
    how to add system logs
    i3 GNOME

  • Thanks everyone for your help.
    I got impatient and couldn’t wait till the weekend to try this. It was successful!
    I logged into the Antergos install,
    installed lsb-release,
    looked at gparted to see if any partitions weren’t mounted and mounted the one that wasn’t,
    ran the two commands manuel gave me in the first reply to this post,
    rebooted (the Antergos boot screen appeared with the Ubuntu present - as expected),
    using gparted I reformatted the ubuntu partition as ntfs (I’ll be using this to store files I’ll need in both Linux and Windows),
    ran grub-mkconfig again,
    rebooted and got the Antergos boot screen with just the 2 Antergos options and the Windows option.
    GREAT!
    Thanks again everybody.

    A side note: I have used grub customizer in the past and it seemed to take forever to save changes. My experience here leads me to believe that grub customizer is basically a gui of grub-mkconfig (or perhaps runs it). I suspect that if I ever use it again and I make sure lsb-release is installed and all of the partitions are mounted, the time for saving in grub-customizer will be greatly reduced.

  • @rpallen said in How do I use Grub from an earlier Linux installation?:

    make sure lsb-release is installed and all of the partitions are mounted, the time for saving in grub-customizer will be greatly reduced

    Yes, mounting all other partitions sanw as for grub.cfg generation is needed, as grub-customizer is using it on startup.

    [updates once a week] = [90% less problems]
    [Li{u}n//u//{i}x] since 1988 - overcoming failure means success
    howto-install-antergos
    how to add system logs
    i3 GNOME

  • @joekamprad
    About the lsb-release:
    I used to have Manjaro’s grub for booting. I had also Antergos (and Windows) installed, a multiboot situation.
    So, whenever Manjaro’s kernel was updated, Manjaro ran update-grub automatically. And that was extremely slow if Antergos did not have lsb-release installed!

    I think it is a problem in Manjaro’s os-prober, but it may be a larger problem with Arch family distros. So, there were two alternative ways to work around the problem:

    • mount Antergos partition before running update-grub
    • install lsb-release into Antergos (and probably Arch, too)

    And I always forgot to mount Antergos partition before Manjaro’s update-grub! That’s why I just installed lsb-release to Antergos, and for me it helped a lot.

    But now I boot from Antergos grub… :)

  • @fabio
    Basically you could do the same commands as rpallen did, except: don’t delete Ubuntu!
    But as you said, Ubuntu install “disabled” Antergos.

    But that should be easy to fix, fortunately! And makes it possible for you to boot to Antergos.

    In Ubuntu, run update-grub (well, you probably have already done it during Ubuntu install).
    It writes (incorrect) entries for Antergos.
    The Antergos entries in Ubuntu are easy to fix: you need to edit file /boot/grub/grub.cfg.
    There are (possibly several) lines starting with word initrd, something like

    initrd /boot/initramfs-linux.img
    

    Search for “/initramfs” (without quotes). The error in those lines (NOTE: for Antergos menuentries ONLY! Don’t change Ubuntu entries!) is that it is missing one part.
    It should be:

    initrd /boot/intel-ucode.img /boot/initramfs-linux.img
    

    After fixing that, you need to run update-grub in Ubuntu. And now you can boot to Antergos!

    Try to update Antergos first. If you haven’t updated Antergos for a long time, updating may cause problems.

    If all seems to go well in Antergos update, just reboot and again go to Antergos, and run

    grub-mkconfig -o /boot/grub/grub.cfg
    

    and your system should be OK.

    EDIT: sorry, I forgot to ask if your system is UEFI or not. And you will need to run grub-install command with appropriate parameters based on whether it is UEFI or not.

  • @rpallen
    Good to hear it works now! :)
    I think grub-customizer, in some situations, can be a great tool. But I wouldn’t recommend it as a general “grub fixer”, since it can cause even more problems sometimes, as grub things can be quite complicated. Better to know how to fix things with the basic grub tools, like grub-mkconfig and grub-install.

  • @manuel but in general, Linux need a tool like this, to get a real Desktop alternative! Casual users should not be forced to use the terminal.

    [updates once a week] = [90% less problems]
    [Li{u}n//u//{i}x] since 1988 - overcoming failure means success
    howto-install-antergos
    how to add system logs
    i3 GNOME

  • @joekamprad
    That is also true.
    So, people, take my previous remark as just my personal opinion for my personal use. Those higher level tools can be very useful for many people.

  • Thank you for helping @manuel.
    Non UEFI system here.
    You were late because I already did the trick, applying your magic treat in pacman:

    sudo grub-install /dev/sda
    sudo grub-mkconfig -o /boot/grub/grub.cfg
    

    I restarted the system and found out in the grub list of Antergos (that I didn’t see from months) something very strange:
    1 antergos entry, 2 ubuntu entries and 2 windows 10 entries.
    I was very confused, I installed grub-customizer to recheck the situation, but I didn’t see the doubles and I received a message of “new scripts available” - or something like that - inviting me to save.
    I saved, restarted the system and my brand new regular Antergos grub is there.
    Thank you, you easily solved an ancient problem of mine :bowling:

    Antergos KDE + Ubuntu 17.10

    • Windows 10
      Motherboard Asus P8H67-M LE - CPU: Intel Core™ i5-2400 CPU @ 3.10GHz - RAM 10 Gb
      Samsung EVO 250 Gb Ssd + WD HDD 2 Tb
  • @fabio
    Glad to hear it works! :)

    Those extra entries you had are probably a result of earlier grub-customizer call, right?

    But the best thing is that it works.

  • @manuel I don’t know how to explain, but now the doubles are gone, so I’m happy ;)

    Antergos KDE + Ubuntu 17.10

    • Windows 10
      Motherboard Asus P8H67-M LE - CPU: Intel Core™ i5-2400 CPU @ 3.10GHz - RAM 10 Gb
      Samsung EVO 250 Gb Ssd + WD HDD 2 Tb
installation212 earlier1 grub79 Posts 19Views 211
Log in to reply