Complicated disk prep to install Mint to Multi-disk, Multi-OS, MBR, GPT system (grub2?)

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
Post Reply
Kseanfitz_1
Level 1
Level 1
Posts: 47
Joined: Mon Jun 15, 2020 2:32 pm
Location: USA love it or leave it!

Complicated disk prep to install Mint to Multi-disk, Multi-OS, MBR, GPT system (grub2?)

Post by Kseanfitz_1 »

As this is my first posting I am not sure if basic system spec's will show in info "Interests:"...
My system consists of 6 drives, some of them are UEFI/GPT and others are BIOS/MBR, Linux and Win-7...
I wish to install latest new Mint (20) Cinnamon on my 500gb NVME and make it the boot controller, hopefully Grub 2,first boot, daily driver.
Much internet and forum's research produces only confusing bits and peaces.
Elements like, efi partition, Bios_grub, BIOS_boot, /boot, /boot/efi, where to place what flag and where to install grub(2) etc.etc,
My basic default install for Linux is / (for root), /home, and swap (just for fun with 24gb ram), and I will have the disk formatted for GPT before manually installing Mint as "something else" partitioning.

PS system is borked because of long ago previous install of rEFInd boot manager that I have tried to delete from other partitions, but one disk still shows a presence of it in the bios and some trashed grub menus from other partitions/disks ... something I hope to clean up on other disks LATER.?.?.!
If/when I get this right I intend to promptly back up the disk once or twice and then again after I get done with some preferred app installs ans a fair amount of "personalization"

Good luck with this one, and if one shot success that stands all booting and normal use and updates and keeps working may be worthy of a sticky somewhere?
User avatar
zcot
Level 6
Level 6
Posts: 1002
Joined: Wed Oct 19, 2016 6:08 pm

Re: Complicated disk prep to install Mint to Multi-disk, Multi-OS, MBR, GPT system (grub2?)

Post by zcot »

What I do is make sure that any physical disk, if it has an operating system on it, then I make sure its grub is installed to that disk when installed. If it wasn't installed to that disk, then I boot into that system and correct it by reinstalling grub to that drive. Now each disk with a system can operate completely on its own. If one disk is removed, corrupted, order is exchanged, whatever, then you can still easily deal with each drive as a functioning unit on its own.

If you have a system with multiple grubs, then they can automatically chain load the other grubs.

Mixing multiple mbr and gpt systems is going to present some restriction, if only having to bring up the systems boot selection menu initially, so that's why most users either try to pick one or the other style.

I have no idea what chain loading mbr and gpt systems does. If you install on one disk with one grub both an mbr legacy style system as well as a efi/gpt system then the one grub is not going to work for both systems. If you have a single grub operating an efi/gpt setup and another separate grub operating a legacy mbr setup, will they chainload and act correctly? I don't know. It might be a good test. It will be easy to find out because you wouldn't do anything different than mentioned in the first paragraph. Either they will do it or not, and alternately if they don't then you're using the systems boot selection menu anyway.

If you have the outdated, security risk, dangerous to use on a network, EOL Win7 on a drive with mbr mode then you're not going to install grub onto that anyway, and the grub for example from another drive running under an efi/gpt wont use it either so none of the above matter in this case and nothing to do there. If it's broken anyway then you select that drive to boot then use some repair functionality to bootrec/fixmbr the thing or something so it will boot using the Windows loader, then you can at least pick it from the system boot selector menu.


You should be able to manage efi boot entries, like some refind entry, using your motherboard software, or by booting a mint session in efi mode and using the efibootmgr functionality. You could kill any existing bootloader from the mbr of a specific drive using dd if=/dev/null of=/dev/sdX bs=446 count=1 where sdX is the drive in question, -that removes the bootloader area minus the partition table, although change that number to 512 and it removes the partition table too so that's like a drive quick format.

Yea.
Kseanfitz_1
Level 1
Level 1
Posts: 47
Joined: Mon Jun 15, 2020 2:32 pm
Location: USA love it or leave it!

Re: Complicated disk prep to install Mint to Multi-disk, Multi-OS, MBR, GPT system (grub2?)

Post by Kseanfitz_1 »

Thanks, zcot for taking a shot at this!
I have (or had) two well developed installs of windows on nvme disks that I had hoped to save :-(, maybe I can rig them back from a backup later as I am mostly looking for a solid install of mint as my new daily driver and projects OS!
three other installs of mint (#1 19.1 part of a distro hopping on a 1TB spinner, #2 19.3 alone on an ssd, and #3 19.3 on my lessor nvme all got boot borked by update grub and boot repair that ultimate made a miles long boot menu that almost nothing would actually boot from anyway!

Looks like I may have to nuke the MRB's of all the other drives to (TRY) a nice UEFI/GBT install of Mint 20 on the the best NVME, back it up, update, install software's and personalize, then backup again, then look to manually deal with the other disks and OS's one at a time and doing mere backup's along the way as disk space will allow.

to that end... should I wipe install destination disk and set it to GBT, make 1gb (fat-32) and flag as "efi boot", do my / , /home , and swap partitions. install "something else"... and use the efi as the boot and install grub in it also...??
Also is there a point I SHOULD update-grub?
BTW I am running from a persistent USB, the last one I had to operate from got borked by the update-grub and or the boot rescue.
User avatar
zcot
Level 6
Level 6
Posts: 1002
Joined: Wed Oct 19, 2016 6:08 pm

Re: Complicated disk prep to install Mint to Multi-disk, Multi-OS, MBR, GPT system (grub2?)

Post by zcot »

Kseanfitz_1 wrote:
Sun Jun 28, 2020 2:05 pm
I have (or had) two well developed installs of windows on nvme disks that I had hoped to save :-(, maybe I can rig them back
Sure you can. Set a particular device as the boot device, then run through the Windows bootloader repair operation mentioned as above, whether that's being able to boot directly to the particular system and using the repair functionality or even using an external or 3rd party boot repair disk. And do it for both of them then you can have the 2 functional Windows systems. Booting either of them will amount to you choosing the right boot device afterwards.

boot-repair is pretty cool. But it's not going to be able to handle absurd fixes. The best feature of that program is when you get it to do the analysis and then see the output and what it says the fix will be, and then are sure to absolutely not do it because you can clearly see that it's confused, is not going to succeed on the wild insanity setups, and is even very likely to make it to where possibly nothing is directly bootable. ;)

Let's say you want to do something with these 3 mentioned Mint systems. You can boot a live session and jump into that filesystem of the afflicted system using chroot. You use the info you already have and from above, and follow one set of instructions below, depending on whether the setup is efi/gpt or bios/mbr, and you fix each of the 3 one at a time.

After that, decide which of the drives is going to be the boot priority drive and make is so, as long as it's not one of the Windows systems. And that's probably a 2 part process since you're going to mix legacy with uefi/gpt. Then boot that system and update the grub, you can do that on each as you go but just wait until the last one instead so you're not wasting your time each time and doing duplicate work anyway.

If you want to install grub to an uefi/gpt system you can do it like this:
This example shows the drive is some nvme device with its specific name(nvme0n1) and the root of the system files are on partition 5(p5) and the efi boot partition is on partition 2(p2).

Code: Select all

sudo mount /dev/nvme0n1p5 /mnt
sudo mount /dev/nvme0n1p2 /mnt/boot/efi
for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done
sudo chroot /mnt
grub-install /dev/nvme0n1
update-grub
exit
reboot
If you want to install grub to a bios/mbr system you can do it like this:
This example shows the drive is the second hard drive device with its specific name(sdb) and the root of the system files are on partition 3(3).

Code: Select all

sudo mount /dev/sdb3 /mnt
for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done
sudo chroot /mnt
grub-install /dev/sdb
update-grub
exit
reboot
So, now you have a situation where you have 5 systems that can be booted depending on where you set your boot drive priority, and it depends on the schemes I suppose it might even be possible that the one priority grub will pick up the other 4 installs, -only if they are all on the same setup scheme though. But at the worst you will be able to use some multiboot menu on more than one of them, and can get to the other(s) on changing your boot mode / priority drive.

You can go ahead and use one of the fixed systems to repair as many persistent usb setups as you like.

There you go, now you're ready to install Mint 20 too! :D
User avatar
arvy
Level 6
Level 6
Posts: 1091
Joined: Sat Mar 26, 2016 11:22 am

Re: Complicated disk prep to install Mint to Multi-disk, Multi-OS, MBR, GPT system (grub2?)

Post by arvy »

Kseanfitz_1 wrote:
Fri Jun 26, 2020 2:56 pm
My system consists of 6 drives, some of them are UEFI/GPT and others are BIOS/MBR, Linux and Win-7...
I wish to install latest new Mint (20) Cinnamon on my 500gb NVME and make it the boot controller, hopefully Grub 2,first boot, daily driver.
The critical limitation is in Grub and its modules availability for either boot mode. For example, the Grub boot loader/manager installed for UEFI-GPT booting includes no ntldr module and is therefore incapable of launching the /bootmgr (and boot configuration data BCD store) of Windows installed for BIOS-MBR (CSM) booting. So you need at least two Grub installations to accommodate both boot modes and the only way of choosing between them will be via your system's UEFI (NVRAM) boot order sequencing and/or by "special" keypress during the system start-up process.

Other than that, so long as you keep away from trying to mix both boot modes on the same drive (not totally impossible but a potential nightmare) and, as zcot has suggested, you make each drive bootable with its own bootloader independent of all others, you should have no insurmountable problems. With regard to the latter, keep in mind that Mint's installer (and most other Linux distros) will insist, regardless of user instructions to the contrary, on installing the Grub EFI boot loader into the first EFI System Partition (ESP) with a boot flag that it finds. So you'd need to correct that manually and also ensure that /etc/fstab mounts its own independent drive's ESP rather than the common one.

Good luck. With similar aims, in order to keep things as simple as possible, I stayed with BIOS-MBR booting for all of the drives in my main desktop system, even including the NVMe M.2's and the swapables used only for backup storage and "rescue" recovery. But that's because I'm lazy and not very adventurous. And I like each drive having its own completely independent MBR capable of launching anything installed anywhere on the entire system. :wink:
System: Asus ROG Maximus XI Code mobo, Intel i9-9900K CPU, Nvidia GTX1080 GPU, 32 GB DDR4-3600 RAM, Sumsung Pro 2x512GB NVMe & 3x1TB SSD, Multiboot
User avatar
Kadaitcha Man
Level 9
Level 9
Posts: 2588
Joined: Mon Aug 27, 2012 10:17 pm

Re: Complicated disk prep to install Mint to Multi-disk, Multi-OS, MBR, GPT system (grub2?)

Post by Kadaitcha Man »

arvy wrote:
Mon Jun 29, 2020 12:29 am
The critical limitation is in Grub and its modules availability for either boot mode.
It's worse than that. The Ubuntu installer, consequently the LM installer, when started in EFI mode will use the first EFI partition it finds, and it will resolutely refuse to install the loader to a different EFI partition, despite telling the installer what disk the loader should go on. In essence, it means that only only one EFI partition is allowed, irrespective of the number of disks and OSes. Pulling all the other disks disks out before installing in EFI mode is the only way it will work in keeping the EFI loader separate. Whether or not these will be able to be booted into from a boot menu will depend entirely on the machine's EFI implementation.

Quite frankly, it's a mess. The only OS I've found that actually correctly supports multiple EFI partitions is Manjaro.
It's pronounced kad-eye-cha, not kada-itcha.
User avatar
arvy
Level 6
Level 6
Posts: 1091
Joined: Sat Mar 26, 2016 11:22 am

Re: Complicated disk prep to install Mint to Multi-disk, Multi-OS, MBR, GPT system (grub2?)

Post by arvy »

Kadaitcha Man wrote:
Mon Jun 29, 2020 12:47 am
In essence, it means that only only one EFI partition is allowed, irrespective of the number of disks and OSes. Pulling all the other disks disks out before installing in EFI mode is the only way it will work in keeping the EFI loader separate. Whether or not these will be able to be booted into from a boot menu will depend entirely on the machine's EFI implementation.

Quite frankly, it's a mess. The only OS I've found that actually correctly supports multiple EFI partitions is Manjaro.
Agreed, although removing the boot flag sometimes works. I was able to get my laptop set up with Mint 20's Grub boot loader installed independently into a second drive's ESP, but I got so PO'd with the available "live" session tools that I ended up just moving it by manual force and editing /etc/fstab. Not an exercise I'd care repeat at frequent intervals.
System: Asus ROG Maximus XI Code mobo, Intel i9-9900K CPU, Nvidia GTX1080 GPU, 32 GB DDR4-3600 RAM, Sumsung Pro 2x512GB NVMe & 3x1TB SSD, Multiboot
User avatar
Kadaitcha Man
Level 9
Level 9
Posts: 2588
Joined: Mon Aug 27, 2012 10:17 pm

Re: Complicated disk prep to install Mint to Multi-disk, Multi-OS, MBR, GPT system (grub2?)

Post by Kadaitcha Man »

arvy wrote:
Mon Jun 29, 2020 1:04 am
... removing the boot flag sometimes works.
Yes, I expect it would but what an unnecessary rigmarole :)
It's pronounced kad-eye-cha, not kada-itcha.
Post Reply

Return to “Installation & Boot”