General questions about using gparted and manual manjaro/linux installations

I have some follow-up questions in regard to an issue where I was helped during installation of manjaro and having an “invalid partition table.” In part of the troubleshooting process we manually created a new partition table and partioned my drive. I have some questions about the process we went through in order to make sure I understand what we did and how I should best operate things in the future. (Original topic)

Basically I was advised to create to a new table and 4 partitions, like this:

sda1 - primary partition - ext4, 60GB
sda2 - primary partition - linux-swap, 8GB
sda3 - primary partition - ext4, 60GB
sda4 - primary partition - ext4, 173GB

And I have installed manjaro and the bootloader on sda1. I have sda3 for what will become a second operating system. And sda4 for storage.

After having 20 tabs open trying to understand these things, since I was advised how to organize my partions here, I figured it may be appropriate to also ask the question here as well. I am aware the answers are “out there” on google, and trust me, I am using google and wikis as much as I can to learn as well. TL:DR My questions:

  1. With my new 4 partition setup, if I install a second operating
    system in /dev/sda3, which boot loader option do I choose during
    installation?

  2. Do I simply choose for the new installation to install the
    bootloader as the master boot loader on /dev/sda and does it simply
    overwrite the old one?

  3. What happens if I use the /system option to install the bootloader, or do I choose the “do not install a bootloader option?”

  4. What then follows if /system or "do not install a bootloader"
    option are chosen? Do i need to modify the current grub on /dev/sda ,
    or does it automatically detect the other operating systems and update
    itself appropriately?

  5. When reinstalling a new operating system over the top of an operating system that was previously already installed on sda3, is it recommended to first use gparted to delete / reformat sda3? Or is that unnecessary, and I simply need to run an operating system installer and install over the top of the operating system that currently resides in sda3? And again, what do I do about the grub in this situation?

My end goal is to use sda1 as my daily driver, sda2 as my linux swap, sda3 as my experimental operating system, and sda4 as extra storage. Thank you!

I’d personally do a UEFI boot over legacy.

Reformat it to a GPT table

sda1  -  EFI partition  -  /boot/efi  -  FAT32, 100MB
sda2  -  Manjaro        -  /          -  ext4, 60GB
sda3  -  2nd OS         -             -  ext4, 60GB
sda4  -  Storage        -             -  ext4, 181GB
sda1  -  EFI partition  -  /boot/efi  -  FAT32, 100MB
sda2  -  Manjaro        -             -  ext4, 60GB
sda3  -  2nd OS         -  /          -  ext4, 60GB
sda4  -  Storage        -             -  ext4, 181GB

I don’t know how much RAM you have, but you can just use a swap file if you need one. I don’t use a swap file or swap partition because I have 16 GB RAM. If you do want a swap partition:

sda1  -  EFI partition  -  /boot/efi  -  FAT32, 100MB
sda2  -  SWAP           -  swap       -  linux-swap, 8GB
sda3  -  Manjaro        -  /          -  ext4, 60GB
sda4  -  2nd OS         -             -  ext4, 60GB
sda5  -  Storage        -             -  ext4, 181GB

In an EFI boot, you can just boot with Grub, and both OS will be on there to choose at boot. In the 2nd installation, you should not need to overwrite the bootloader. sudo update-grub should be able to detect both OS.

Remember to mount the EFI partition on both installations to /boot/efi

I have never tried it in legacy boot before so… I don’t know how it is that way.

1 Like

Answers are for bios-legacy/msdos set up.

Suggested reading first (if haven’t read)
wiki grub
wiki grub 1

By default, whenever you install another linux OS, the newly installed OS bootloader will become the default bootloader.

You can choose (a) not to install any bootloader, (b) install it to its partition (/system) or © let it install to mbr (which is the default).

When it is installed to mbr (the default), the old OS does not lose its bootloader (it is still there) but the mbr will now have the ‘information’ to ‘go to’ the new OS and ‘boot’ the bootloader there.

When using /system , or what is more commonly called ‘installed to partition’, the new OS bootloader is installed but the mbr still retains the old information to go to the old OS to ‘boot’ the old OS bootloader.

When using ‘do not install a bootloader’ , it does not install any bootloader.

The current grub ‘system’ remains unchanged.
Grub uses a file, /boot/grub/grub.cfg which contains a list (menu) of OS’s that it boots.
Whenever a new OS is added, we have to update the menu so the new OS is included in that menu; and no, it does not do that automatically. We will will need to issue a command “update-grub” to check and include the new OS.
The modification is not the grub system itself, just that menu.

It is not necessary to delete or reformat when installing an OS over an existing OS. Telling the installer to format that partition is enough.

As for grub, the old OS grub is gone with the OS, and when installing the new OS, the default install (to mbr) will make the new OS bootloader the default. If we do not make the new OS default (to mbr), nothing gets booted.

A few additional points.

o When using Manjaro with other non-Manjaro linux, make sure the Manjaro OS is the default bootloader.
So when you install a new non-Manjaro OS, suggest you set the new OS bootloader to its partition.
After installation, go to Manjaro and do ‘update-grub’ to include the new OS into its menu.

Why is this necessary? - Please ask in a new post (meaning not new topic - but also acceptable and preferable) so as not to divert the point of this topic.

o As for UEFI/gpt, the grub system is not too different to apply though there are some subtleties.
I do not advise we take it here now based on your need to understand at this point, but we will be happy to do this when ever you want to do so.

Cheers.

2 Likes

@gohlip I will begin with your steps outlined here, and then later on look into UEFI, and thanks again for another detailed reply, right on…

I am curious, why do you say to “make sure” Manjaro OS is the default bootloader? Does the operating system that resides on my sda1 require that I use it’s bootloader for the MBR on sda because I have the boot flag enabled on sda1? Or is this simply out of preference for Manjaro? :wink:

Also, what would happen if I type “update-grub” from the secondary OS installed on sda3 with it’s own bootloader on sda3 partition? Would it upgrade sda3 partition bootloader or would it overrite the bootloader onto sda MBR?

I’m sure I’ll have some more questions later. I have more work to do here. Thanks.

Because you can use grub + os-prober for legacy boot to detect both operating systems.

'LLo,

Nothing wrong ! -> you could even uninstall grub in this secondary OS (& the issue is solved :wink:)
A bit like “no bootloader” during the second install (if exists ?) !

@realmain , I I think I see, thanks, so these are features unique to manjaro that automate a normally more difficult task?

@fassil , does this update-grub feature do the os-prober also? I’m reading here, https://wiki.manjaro.org/index.php/Restore_the_GRUB_Bootloader and it says i need to install mtools and os-prober before I run update-grub. Just to confirm, sorry, you are saying that you cannot modify the MBR for SDA from sda3?

You don’t need also os-prober with the second OS, but by mémory it’s a dependancy of another package…
Why would you modify mbr from sda3 if it works ?
A better thing would be to save it from live on an external drive with dd, but it’s another story.
Maybe, you should stop reading now & go for it :wink:

1 Like

That’s just because other OS grub will make the wrong parameters of Manjaro and using that won’t boot Manjaro and result in a kernel panic.
Why? Short answer - because Manjaro uses a different way to implement intel-ucode and requires a modification of grub to boot. Other OS builds intel-ucode into the kernel and don’t need grub modification, so it will pick up Manjaro parameters (the normal way) which won’t boot Manjaro. Yes, that’s the short answer.

No.

No.

grub ‘system’ as I said earlier is not affected by ‘update-grub’. It just regenerates the grub menu, which is /boot/grub/grub.cfg. It does not override anything anywhere.

1 Like

Thanks everybody. Very helpful. I’m now running multiple linux installs on my setup and am pretty happy with it. I’ve learned a lot here.

Thus far I have been installing the additional operating system grubs to their respective partitions and then updating my MBR from my initial manjaro install on sda1 with update-grub. What is the purpose of doing it this way? What does having the extra bootloader on its partition do? Eg. sda3 operating system and bootloader also on sda3 vs not installing a bootloader to sda3 at all-- with no bootloader on sda3, will update-grub still detect the OS and add it to the MBR? Google doesn’t seem to readily provide an answer to this. Thanks

[quote=“yoadam, post:10, topic:23061”]
with no bootloader on sda3, will update-grub still detect the OS and add it to the MBR?
[/quote]Yes.

If anything happen to sda1 OS, say it got nucleared. You have a bootloader ready in sda3 OS.
Yes, it is not set in mbr, but there are ways to bring it back to live more easily than if it were not installed.
[edit] - or for whatever reason you want sda3 OS set to mbr instead of sda1 OS.
Also, there are other uses, like multibooting, configfile and more, but many don’t use these.
After all, its not a big ‘package’ or space to install.

got it. thanks

@gohlip with my configuration currently, do I need to update-grub for the MBR each time one of my secondary operating systems updates their kernels? Or will the MBR load the proper kernel straight-away? Thanks

edit: I’m going to guess the answer is NO. Since I am not even required to have a grub for my other operating systems, correct?

Correct, there is no need to update grub whent the kernel updates

Currently you’re using sda1 OS as default grub.
If you have a new kernel for sda3 OS, you will need to go to sda1 OS and ‘update-grub’ so that it generates a new grub.cfg (grub menu) that includes the new kernel in sda3 OS.

ps: if you have a new kernel in sda1 OS, the sda1 OS will automatically do the ‘update-grub’ for you.
You don’t have to repeat ‘update-grub’ in sda1 OS.
It is advisable to do an ‘upgrade-grub’ in sda3 OS for new kernel in sda1 OS even though sda3 OS is not the default grub. It just keeps everything current. Advisable, not necessary - but seeing how OCD guys like us :smile: are, I’ll figure you’ll want to do it.

To be more clear, you need to update grub if a new kernel has a different version with a different name. If they keep the same name, no need to update grub.

2 Likes

To be more clear, you need to update grub if a new kernel has a different version with a different name. If they keep the same name, no need to update grub.

Is there an easy way to know when an updated kernel version is keeping the same name vs when it is going under a new name and would require my attention to update-grub on the MBR? Thanks.

I know that in Manjaro minor (bugfix) kernel updates keep the same file names. New name is used when you install new kernel version. For example, linux49 package gives vmlinuz-4.9-x86_64 kernel file name. So from 4.9.0 and all the way to 4.9.26 (and later too) Manjaro keeps the same name. But linux410 uses vmlinuz-4.10-x86_64 kernel file name.
That depends on distribution. Arch Linux uses the same name for the current kernel. So look at /boot directory of the distribution you use on other partition to learn what kernel names it uses. Maybe you can refer to the documentation (wiki, forum) of that distribution for more information.
I can’t be sure, but I think Ubuntu based distros use different names even for minor kernel updates.

Great, Thanks.

I am now currently exploring the UEFI route aforementioned by @realmain

So far, so good, I have 8 partitions, sda1 is /boot/efi and sda2 is swap, sda3-sda7 are 5 different operating systems, and sda8 is file storage. Set my bios to non-secure mode UEFI boot and started installing operating systems!

I installed all of the boot loaders onto /dev/sda (default installer settings for all of them) and used /dev/sda1 as /boot/efi (also turned on boot and esp flags) and /dev/sda2 as swap, and made extra sure not to allow the OS installers to reformat those two partitions! Finally installed “refind” to be a boot manager and am using it to load the respective grub for each operating system. This is called “chainloading”, is that correct? Everything seems to be working according to plan, and it seems to help me to avoid having to “update-grub” every time one of my operating systems has a kernel version upgrade, as each operating system is loading itself from it’s own default grub.

Is there anything I should be aware of ( @gohlip ?) with my current configuration mentioned here? I feel pretty happy with it! Thanks again, couldn’t have done it without you in the beginning!

rEFInd pic attached. Antergos Kali Manjaro Debian (SID) =)

1 Like

Forum kindly sponsored by