Installing Leap 15.0 - Placement of GRUB

I started installing Leap 15.0 and when I reached “partitioning” I stopped. There was no partition for Grub.

Let me explain a little. I have 42.1, 42.2 and 42.3 installed that is I keep two old versions as sort of standby. When the next version comes in I erase the oldest and put in the new, using the same old Swap.

Till now it has worked fine and till 42.3 I installed a Grub, a Root and a Home partition. Leap 15 ignores the old Swap of 2 GB and proposes a new Swap of 3.74 GB. I suppose I can handle it by resizing the old Swap to 3.74 GB and deleting the new proposal. The other two partitions proposed are ROOT and Home that is no Grub. However there are sub-volumes proposed that appear to include Grub. Am I correct in assuming that the separate Grub partition has been done away with from Leap 15.0 onwards?

PrakashC

Two remarks.

You do not have to increase your Swap partition because the installer suggest that. You can still use your old partition. I have no idea why the suggestion is larger, but you did not provide any information about the system like how large it’s memory is, so any comment from others is difficult to give. :frowning:

I never heard of a Grub partition. Do you mean a partition for /boot? Or something different?
Again you did a lot of story telling, but post no computer facts.
I assume that at least showing your partitioning as it is now

fdisk -l

and what those partitions are used for

mount | grep '^/dev'

Might help to understand what you are talking about.

I have 4 GB RAM, so 2 GB is adequate SWAP. Earlier the installation would recognise the existing SWAP and propose to use it. This time though the Swap is recognised but still a new partition of 3.74 GB is suggested. That seems to suggest that LEAP 15 needs larger swap.

The partition I called Grub is identified as BIOS Grub by the partitioner. It is sized about 8 MiB. It is the boot partition for the specific installation. Since I have three versions i.e. 42.1, 42.2 & 42.3 at present I have 3 of each partitions BIOS Grub or boot, / or Root and /Home besides the common Swap. I have a separate partition for “Data” where I keep my working data and mount it under Root of whichever version I use. I certainly have no problem if what used to be the BIOS Grub partition has been moved under the / (Root) as a sub-volume but I need to know if it is so.

PrakashC

Swap is used only when you run out of main memory. Also if you use to hibernate swap is used and if you do then you need about as much swap as memory since that is where the memory image is stored. I suggest that the new proposal is for those that use hibernate

Still not sure what that grub partition is but I guess it is a separate /boot partition. Or could be a EFI boot partition. Using EFI or MBR boot???

Note that if you use BTRFS file system you will lose some options for snapper if you use a separate /boot partition.

Also unless you do something very special there is no need for a separate /boot

Where to start!

I have never heard of a “grub” partition, though I suppose it is possible to have one. People often use a “/boot” partition, and much of grub normally goes there. Perhaps that is what you mean.

When using “btrfs”, then it is best to not have a separate “/boot” partition. One of the features of “btrfs” is to be able to boot from an older snapshot. And that only works if you do not have a separate “/boot” partition.

Yes, there can be a “bios_grub” partition (otherwise known as “bios_boot”). But you only ever need one of those. You do not need one per linux system. You just need one. If you already have one, then the partitioner won’t propose another.

For the benefit of other readers: the “bios_grub” partition is only needed when the disk has a GPT partition table, but UEFI is not being used for booting. The “bios_grub” partition provides some additional space for grub boot code, when grub is installed in the MBR (or, actually, PMBR) of that disk. Since only one linux can use that location for booting, you only need one bios_grub partition.

As for swap – Leap 15.0 has a new partitioner. And I guess it has a larger default size for swap. If you use the expert partitioner, then you can insist on using your original swap and ignore the proposal.

(edit) if you think the proposal of a larger swap is a mistake, then report that as a bug.

This is re posts by Nrickert and Gogalthorp. Thanks!

Well, I do not use hibernate and so I think I will stick with the old 2 GB Swap partition.

Next re BIOS Grub partition (that is how it is named by the partitioner) or Boot partition if you please, I had asked for advice under the thread Two Grub Partitions! started on 22 Dec 2015. Well since the installation software proposed a new BIOS Grub each time I went along with it. But now as I come to think of it there was a time when the installer used to ask if Grub should be installed or not and if yes where or something like that. This was well after the setting up of the partitions. The question remains whether this partition contains files specific to the version!

And now there is no proposal for a separate BIOS Grub partition. It could even mean that the existing such partition has been detected and will be used with appropriate changes! That is what I wish to know or confirm.

PrakashC

Only one OS controls the booting only that one needs the connection to the BIOS/UEFI. The rest or chained from the controlling OS’s grub

Yes, I think it detects the existing bios_grub partition, and reuses it.

In my experiments (with pre-release versions), I tried creating a smaller bios_grub partition (slightly under 1M, using sectors 34-2047). And the partitioner still proposed a new bios_grub partition. But I think it won’t propose one if there is already an 8M or larger bios_grub partition.

As far as I know, openSUSE doesn’t directly use that bios_grub partition. But when it installs booting, grub2-install might use it.

OK. I get that. Also Nrickerts post also says the same thing.

So am I right to assume that Leap 15 will use one of the existing /boot partition and update it?
If so, the existing /boot partition for 42.1 is the earliest one on the disk and will that be used automatically? And if so, I can safely delete the other two BIOS Grub partitions installed by 42.2 and 42.3?

PrakashC

Again, I think there is a confusion between “/boot” partitions and “bios_grub” partitions.

Please provide the output from:

fdisk -l

so that we have a clearer idea what we are talking about.

Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0xc0680d28

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1  *         2048    206847    204800   100M  7 HPFS/NTFS/exFAT
/dev/sda2          206848 307202047 306995200 146.4G  7 HPFS/NTFS/exFAT
/dev/sda3       307202048 614402047 307200000 146.5G  7 HPFS/NTFS/exFAT
/dev/sda4       614402048 976771071 362369024 172.8G  7 HPFS/NTFS/exFAT


Disk /dev/sdb: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 64A6B0E5-A22F-4F33-8923-D16FA673F82D

Device         Start       End  Sectors  Size Type
/dev/sdb1       2048    321535   319488  156M Microsoft basic data
/dev/sdb2     321536   4513791  4192256    2G Microsoft basic data
/dev/sdb3    4513792   4530175    16384    8M BIOS boot
/dev/sdb4    4530176  53190655 48660480 23.2G EFI System
/dev/sdb5  335919104 335935487    16384    8M BIOS boot
/dev/sdb6  335935488 419825663 83890176   40G Microsoft basic data
/dev/sdb7  168103936 168120319    16384    8M BIOS boot
/dev/sdb8  168120320 252012543 83892224   40G Microsoft basic data
/dev/sdb9  252012544 335919103 83906560   40G Microsoft basic data
/dev/sdb10  53190656 126158847 72968192 34.8G Microsoft basic data
/dev/sdb11 419825664 503717887 83892224   40G Microsoft basic data
/dev/sdb12 503717888 587610111 83892224   40G Microsoft basic data

Partition table entries are not in disk order.

sda is exclusively for Windows
sdb is for Linux
sdb1 is system partition
sdb2 is SWAP

sdb3 is BIOS Grub for 42.1 set up during installation
sdb4 is / for 43.1
sdb10 is /Home for 42.1

sdb5 is BIOS Grub for 42.2 set up during installation
sdb6 is / for 43.2
sdb11 is /Home for 42.2

sdb7 is BIOS Grub for 42.3 set up during installation
sdb8 is / for 43.3
sdb9 is /Home for 42.3

sdb12 is my data partition. Sort of long term home.

PrakashC

I’ll just comment on that.

Yes, you have three bios_boot partitions. That does not make sense. If the partitioner is proposing that, then it is a bug. You should never need more than one bios_boot partition.

On the other hand, I would not remove any. And that’s because it is hard to know which one is actually in use. If you want to remove, best to do that at your next install so that grub can be reinstalled after the removal.

Your output shows “/dev/sdb4” as the EFI system partition. If you are using UEFI, then you don’t even need a bios_boot partition. And 23G is far larger than makes sense.

But apparently, “/dev/sdb4” is really your root partition for one of your openSUSE systems.

Re BIOS Grub partitions I know which was installed with which version. I also checked it out by using the partitioner with each version and noted which partition was marked for booting. I believe that the latest installed becomes the master so currently sdb7 should be the one operating. Since I plan to remove 42.1 anyway I could remove that set of partitions while working in 42.3 and try a reboot. If I run into a problem I can get back 42.2 and 42.3 when installing Leap 15.

Re sdb4 and EFI, that was one mix up when I installed 42.1. I had discussed it in my earlier thread re Two Grub Partitions. I had by error first installed 42.1 from the EFI option which caused the earlier versions (13s) to disappear. I then re-installed 42.1 MBR option over the first installation and though the partition remained EFI everything else worked fine. So that partition is now due for deletion and I will take care to ensure it is formatted as MBR type. I keep the size of the / Root partition as suggested by the installer and will be limiting the size of /Home keeping in mind my Data partition.

I would request your suggestions in the above plan of action. Thanks.

PrakashC

I am doubting that means anything.

As far as I know, to install booting with your disk setup, the command

grub2-install /dev/sdb

is used. It is up to the code in “grub2-install” to find a bios_boot partition and install some of the code there. I don’t think it knows which of those bios_boot partitions was setup for this install.

For me, it is only a guess as to which of this bios_boot partitions is currently being used. There’s probably a timestamp inside the partition that could be used to tell.

I now realise I have been confusing between the action of boot loader which is to select which OS version is loaded, and the actual loading of the OS itself. Obviously there can be only one boot loader partition or should I say “only one active boot partition”. The extra BIOS Grub partitions came up with the Leap 42 series. Anyway I logged into each version and checked the boot loader options through YAST configure the boot loader. In all three versions the screen presented and some details are different. The choices I made in each case for boot code options are tabulated below:

|Option
|
|42.1
|42.2
|42.3|
|Boot from root partition|Yes|Yes|Yes|
|Boot from Master Boot Record|No|No|No|
|Custom Boot Partition|No|No|No|
|Set active flag in partition table for boot partition|Yes|Yes|Yes|
|Write Generic Boot code to MBR|No|Yes|No|

I do not remember why ticked “Write generic boot code to MBR” while installing 42.2, but then I am not booting from the MBR! And can that process be undone? Why the 3 BIOS Grub partitions came up is still a mystery. I am also not clear about difference in booting from root partition and booting from MBR and the relative advantages/disadvantages.

What comes to my mind is that I select Boot from the Master Boot Record and Write Generic Boot Code to MBR options while installing Leap 15. Then it should be safe to delete the BIOS Grub Partitions that I connect with 42.2 and 42.3 versions.

PrakashC

The bios_boot partition is only used when you “boot from MBR”. So apparently you were not using it for 42.x.

It seems that there’s a bug in the 42.x partitioner. It should not be creating a new bios_boot partition if there is already one there. Reminder to self – check if the 15.0 partitioner still does that.

That said, the problem remains that you really don’t know which of those bios_boot partitions is in use.

If you really want to remove them, then the safest plan might be:

  1. remove all but one bios_boot partition
  2. reinstall grub, with
grub2-install /dev/sdb

so that you know the installed grub is using the bios_boot partition that you kept.

Thanks. I will try that, but request for some additional clarification of doubts.

A] Since I have multiple versions on the same Hard Disk should I keep to the option “Boot from Root Partition” since each version has a different Root Partition? I get the feeling that “Boot from MBR” would be correct if there were only one version of the OS on that Hard Disk.
B] What exactly is “Write Generic Boot Code to MBR” for? Is this the same code used by various Windows? When should this option be checked?
C] Is it possible to reinstall Grub through Yast?

PrakashC

People disagree on that.

Personally, I always set it to boot from a partition. And then I can use the active flag for the partition to decide which controls the booting.

There are other people who always set it to boot from the MBR. And in that case, the most recently installed wins (controls the booting).

B] What exactly is “Write Generic Boot Code to MBR” for? Is this the same code used by various Windows? When should this option be checked?

It is not the same code as used by Windows. But it does about the same thing as the code used by Windows. It actually installs the code from “/usr/share/syslinux/mbr.bin” for legacy partitioning and the code from “/usr/share/syslinux/gptmbr.bin” with GPT partitioning.

I check that box if I am unsure whether there is already boot code in the MBR. If I know that there is already boot code, then I uncheck that box. Most of the time, it won’t matter. On one of my computers, I am using “/usr/share/syslinux/altmbr.bin”, so I uncheck that box so that I can keep the code that I want there.

The documentation for the syslinux boot code is in “/usr/share/doc/packages/syslinux”.

C] Is it possible to reinstall Grub through Yast?

Yes, but …

The trouble with Yast, is that sometimes it will just regenerate the menu and sometimes it will reinstall. It depends on what you have changed on that screen. So I’m never quite sure whether it will reinstall. If you change enough, then it will reinstall.

(edit) the time/date of the file “/boot/grub2/i386-pc/core.img” is when grub2 was last installed, so you can check.

Thanks. That helps me understand a lot.

Run bootinfoscript which shows disk address which is stored in MBR grub2 code and compare with partition address.

https://github.com/arvidjaar/bootinfoscript