6

I have a Linux system for current use and a few other partitions to test different other distros. But the way I install these systems, which is always the same, leads to the GRUB boot list being changed, while GRUB itself seems installed within the last installed system. That is, I can edit GRUB list with Grub Customizer within the last installed system, while any changes made using Grub Customizer installed in other systems do not affect the GRUB boot list. To restore GRUB into my main system (and then be able to edit GRUB with Grub Customizer from there) I use Grub Repair within a live usb session to install GRUB on the main partition.

Is it possible to avoid affecting the GRUB list and all its settings when I install a new system on a separate partition? (I mean, except adding the new entry.)

My experience as described above involves Ubuntu-based distros, Manjaro, Deepin, KaOS, OpenSuse.

  • Avoiding Grub would be the most expedient approach... :) – jasonwryan Mar 12 '15 at 22:50
  • @What does that mean? I am familiar with the installers that come with Ubuntu-based systems or with that of Manjaro. I do not remember choosing something related to grub during installations. – user32012 Mar 12 '15 at 22:54
  • Syslinux, or a UEFI boot manager like rEFInd or gummiboot, handle this scenario much more competently than Grub. – jasonwryan Mar 12 '15 at 23:22
1

Installing an Ubuntu-System on a separate partition via a booted Ubu-Live-System is (usually) done with ubiquity, the installer.

The usual way to run ubiquity is to double-klick on the icon on the Live-Desktop (an XDG-Starter). But ubiquity has some cmd-line-opts, and to make use of them, you must either edit-and-save that XDG-Starter, change the line:

Exec=ubiquity -b

or run ubiquity in terminal:

ubiquity -b

Option -b means: no-boot-loader-installation

The new boot-entry in the already-there grub.cfg of the already-there-Linux should read:

menuentry "New-Ubu" {
    root=hd0,2
    linux /vmlinuz
    initrd /initrd.img
}

=== Once you got New-Ubu started this way ===

(hd0,2 is just an example, the partition 2 on first HDD, the below lines as well), you may type in a terminal:

sudo grub-install --boot-directory=/boot/ --force /dev/sda2

the warning about embedding can be ignored

and hereafter

sudo update-grub

what should re-create /boot/grub/grub.cfg of the CURRENT running New-Ubu. Now since the New-Ubu system is bootable "itself", you can later (to boot New-Ubu again)

  • EITHER chainload (not recommended: the ignored warning above may get justified after e2fsck on the New-Ubu root-fs ),
  • OR load (the now created) configfile /boot/grub/grub.cfg of the New-Ubu-root-fs (/dev/sda2)

to do so, you must replace the above quoted menu-entry in the /boot/grub/grub.cfg of the already-there-Linux as follows:

menuentry "New-Ubu" {
    configfile (hd0,2)/boot/grub/grub.cfg
}

This also reflects the needed kernel-opts (KVM-gfx-mode related stuff on boot up) that are implicitly written by update-grub, and can solve problems that may occur when booting New-Ubu by the former-mentioned menu-item (what uses actually symlinks in the root-dir, with no kernel-opts ...)

P.S.: There is an issue with 32/64 Bit Variants of Linux-Releases and appropriate installed Bootloaders. It is recommended to stick 100% to either 32 or 64 Bit.

Honey is Funny! Further more, I like Bugs Bunny. wqwqwqwqwqwqwqq ;)

| improve this answer | |
0

If Manjaro is not involved

I do not have a way of installing a new Linux on a new partition without touching the boot menu customization made with Grub Customizer on a previously installed Linux system, but I have a simple solution for restoring that very customization by using Boot Repair.

Installing a new Linux on a separate partition will replace the boot menu edited with Grub Customizer in a previous Linux system. In fact the data of that customization is not lost, but it is present on the partition of the older Linux installation, and you need to restore it.

That can be done whether the last Linux installation is kept in place (and you have the boot menu that comes with it) or it was deleted (and you have no boot menu at all - and cannot boot at all).

The idea is to use Boot Repair on a Live USB with a Linux system.

So, boot in the live Linux environment and install Boot Repair. Use an Ubuntu-based Linux, because of the method to install the tool I use here:

sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt-get update
sudo apt-get install -y boot-repair && boot-repair

Boot Repair starts:

  • select Advanced options

[images below were taken in a local installation, so certain specifications (like 'OS now in use etc') will be different, absent etc.]

enter image description here

  • Leave the Main options under the first tab as they are

enter image description here

  • Under Grub location tab: OS to boot by default - select the main Linux installation where you have edited the boot list in Grub Customizer; Place GRUB into: select the partition of the same Linux installation as above.

enter image description here

  • Under Grub options tab: uncheck 'Purge Grub before installing it'

enter image description here

  • Do not change MBR options

  • Under 'Other options' tab: Place the boot flag on - select the same main Linux installation where you have edited the boot list in Grub Customizer

enter image description here

Apply.

After Boot Repair finishes its processes, reboot and you should see the boot list and theme set by your Grub Customizer setting.


If Manjaro is involved

Take into account the fact that from my experience if Manjaro is the last Linux installed, the above procedure may lead to that system becoming unaccessible (tested with KDE, Xfce and Fluxbox Manjaro).

Also, Grub Customizer doesn't seem to work as it should in Manjaro - it gives an error saying changes cannot be saved.

I recommend the above only if Manjaro is not installed (or if you want to remove it anyway).

In case Manjaro was already installed at the time of installation of another Linux, like Ubuntu, Manjaro will not boot, as it will only work with its own grub. The Manjaro grub can be restored and used for all the installed systems. (While it doesn't seem to work with Grub Customizer it has enhanced features like remembering the last booted entry).

To restore the Manjaro boot list (~ as indicated here ~):

At that other linux grub menu, go into its grub prompt (grub>) by pressing 'c'.

At its grub prompt:

grub> search.file /boot/intel-ucode.img root
grub> configfile /boot/grub/grub.cfg

Manjaro grub menu will then appear, enter at the first (top) entry and it will boot into Manjaro.

When booted into Manjaro, at terminal,

sudo grub-install /dev/sda
sudo update-grub
| improve this answer | |
  • I used the procedure mentioned in If Manjaro is not involved. It worked. However, I have two other issues. (1) Grub2 menu background turned grey in color and the background image that I had specified in /etc/default/grub failed to appear. Changes in video resolution were effected. (2) the grub2 Menu showed several EFI boot options which I don't want them to appear. E.g. *Ubuntu, Advance options for Ubuntu, EFI/BOOT/bkpbootx64.efi, EFI/BOOT/fbx64.efi, EFI/ubuntu/fbx64.efi, EFI/ubuntu/fwupx64.efi, EFI/ubuntu/mmx64.efi, System setup. Question: How to avoid these issues? – Sun Bear Aug 19 '19 at 9:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy