Need Help Cleaning Up The Boot Process

Hi folks. I get the feeling that my computer could be suffering from a build-up missteps during the installation of successive versions of openSUSE. After installing openSUSE Leap 15.3 on the 2nd of June, my computer simply would not boot, but the strange thing is that I’m fairly sure it booted perfectly normally once or twice on the new 15.3 install before it my computer started refusing to boot. I noticed this thread which sounds similar to my issue but, like I said, it could also be a consequence of me making simple mistakes whilst installing previous versions of openSUSE. Similar to the user in the linked thread, the computer ran Windows well enough (as well as openSUSE 15.2), but after installing openSUSE15.3, the system began to lock up completely whilst booting. My computer was locking up before I even got to the GRUB menu where I could choose between OpenSUSE or Windows 7. My initial thought was that, despite doing nothing other than wiping the Linux partitions on the Linux HDD and leaving the Windows HDD untouched (which is just what I do in order to keep the process as simple as possible) I might have still managed to get something wrong again, so I thought I should begin collecting any information which I thought might be relevant so I could ask about it here. I figured the easiest piece of information to find would be the Q Code on the motherboard which was “A2”. I looked up what that meant on the manufacturer’s site, and it said that A2 indicates some kind of error with boot devices. Because of this, I decided to simply unplug a HDD from the motherboard, and see if the computer would boot, so I disconnected the power and data cable to the Linux HDD, and Windows 7 booted without a hitch. I wanted to make sure this wasn’t a fluke and that it would continue to work like this, so I spent a few days using nothing but Windows, and it continued to work perfectly fine. Because Windows worked consistently for a few days, I thought the problem must be related to the other HDD, so I reconnected it and turned the computer back on with the expectation that it’d just make the computer lock up before I could get into the BIOS, but it didn’t. Because I managed to get into the BIOS, I set the Linux HDD to be first in the HDD boot priority, but whilst I was doing that, I noticed another unexpected entry in my list of possible boot partitions.

I’ve managed to have openSUSE 15.3 boot successfully a few times today, but I’m thinking I should probably get some help with regards to getting rid of these boot partitions or whatever they are, which seem to be collecting on my disks. I think one of them might be from a time where I fouled things up by not realising I’d selected a legacy install for openSUSE, when Windows 7 was installed in UEFI mode. As mentioned above, the current install attempt seems to have created two boot partitions for linux: one labeled openSUSE and the other called something like “Other OS”.

Are there any commands I can run which will provide some useful information about my partitions on both HDDS, rather than me just waffing on about half remembered things from years ago? Like on my Windows HDD, for example, there’s an openSUSE bootloader entry which has been there for years and it points to nothing—and I’ve no idea how it got there or how to remove it. Surely this kind of clutter could be causing my computer to have problems starting up?

Of course I thought to try fdisk -l, but that doesn’t show anything about all the entries for booting. here’s it’s output:


home:~ # fdisk -l
Disk /dev/sdb: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: TOSHIBA DT01ACA1
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: B42A699F-07C7-4E19-80EB-01BCFAA04E0B

Device          Start        End    Sectors   Size Type
/dev/sdb1        2048    1026047    1024000   500M EFI System
/dev/sdb2     1026048  626995199  625969152 298.5G Linux filesystem
/dev/sdb3   626995200 1920870399 1293875200   617G Linux filesystem
/dev/sdb4  1920870400 1953525134   32654735  15.6G Linux swap


Disk /dev/sda: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: ST2000DM001-1ER1
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: 78959F4C-F459-43EC-8814-2F7603CE3C9D

Device       Start        End    Sectors  Size Type
/dev/sda1     2048    1023999    1021952  499M EFI System
/dev/sda2  1024000    1286143     262144  128M Microsoft reserved
/dev/sda3  1286144 3907028991 3905742848  1.8T Microsoft basic data

I’ll post a photograph of the boot options which appear in my BIOS tomorrow, to show how they differ from the output of fdisk.

Any help/advice on cleaning up my system’s boot process would be greatly appreciated.

@Ray:

Are you certain that, in the UEFI/BIOS settings, the openSUSE EFI key is at the top of the list of keys?
Are you certain that, the UEFI/BIOS is actual and up-to-date?
Are you certain that, the partitions used for the openSUSE installations were clean (empty)?
Were you attempting to install newer openSUSE versions over existing openSUSE installations?

Hi
Yes, post the output from the commands (as root user);


efibootmgr -v
blkid

Inspect the contents of both /dev/sda1 and /dev/sdb1.

No. I didn’t even know there was a list with a hierarchy to it. I’ve barely had any experience using a modern BIOS. I’m aware that a modern BIOS has a secure boot feature where it can store keys to verify signed software. Is that the key you’re asking about? Secure Boot is no longer enabled on my computer anyway, and I have no idea how or if I could re-enable it with Windows 7.

BIOS is capable of using legacy or EFI mode (if that’s what you’re asking?) I’m fairly sure it is. The system Integrator that I bought the computer from updated the BIOS for me the last time it was in for repair, but that was a few years ago now.

Not really. My guess is that a big part of my problem, is that I don’t know how to look at what’s contained in the small partitions which offer the various boot options. All I do when I’m installing a newer openSUSE in place of an older one, is to set Linux partitions to be removed “even if not needed”, and to set the handling of Windows partitions to “do not modify”. I didn’t always do this, which probably accounts for the stuff in the photo of my boot options which confuses the hell out of me, but it’s just what I settled on sticking with to keep things as simple as I could for myself. Like I noted in my previous post, * fdisk -l* doesn’t really provide much useful information. The commands which malcolmlewis asked me to post the output from, provide much more useful information, but they still don’t seem to show everything listed in the boot options of my BIOS (although that could just be because I don’t properly understand what I’m looking at). I’ll see if the forum will let me post a photograph of the BIOS boot options after I post the output from the commands malcolmlewis asked me to try.[/quote]

No. I’m not a madman. I’ve been using openSuse’s various incarnations since Suse 9.1 in the early 2000s and, if there’s one consistent thread I’ve picked up on, it’s that you don’t upgrade. Just back up your stuff to an external drive and do a straight-forward install.

Anyway, here’s the input from the commands malcolmlewis asked me to post the output from:

home:~ # efibootmgr -v
BootCurrent: 0003
Timeout: 1 seconds
BootOrder: 0003,0001,0002,0007,0000,0005,0006,0004
Boot0000* Windows Boot Manager  HD(1,GPT,038b658a-e9c9-4a50-8275-a778e8305ad1,0x800,0xf9800)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}....................
Boot0001* CD/DVD Drive  BBS(CDROM,,0x0)..GO..NO........O.H.L.-.D.T.-.S.T. .B.D.-.R.E. . .B.H.1.6.N.S.4.0.................>..Gd-.;.A..MQ..L.9.K.F.H.4.3.2.F.5.9. .5. . . . . . . . ........BO
Boot0002* Hard Drive    BBS(HD,,0x0)..GO..NOo.......?.G.e.n.e.r.i.c.-.S.D./.M.M.C....................Gd-.;.A..MQ..L.0.5.8.F.6.3.6.2.6.4.7.6........BO..NO}.......?.G.e.n.e.r.i.c.-.C.o.m.p.a.c.t. .F.l.a.s.h....................Gd-.;.A..MQ..L.0.5.8.F.6.3.6.2.6.4.7.6........BO..NO}.......?.G.e.n.e.r.i.c.-.S.M./.x.D.-.P.i.c.t.u.r.e....................Gd-.;.A..MQ..L.0.5.8.F.6.3.6.2.6.4.7.6........BO..NOu.......?.G.e.n.e.r.i.c.-.M.S./.M.S.-.P.r.o....................Gd-.;.A..MQ..L.0.5.8.F.6.3.6.2.6.4.7.6........BO..NO........O.S.T.2.0.0.0.D.M.0.0.1.-.1.E.R.1.6.4.................>..Gd-.;.A..MQ..L. . . . . . . . . . . . .4.W.1.Z.L.9.Z.Q........BO..NO........O.T.O.S.H.I.B.A. .D.T.0.1.A.C.A.1.0.0.................>..Gd-.;.A..MQ..L. . . . . . . . . . .Z. .T.4.T.M.9.R.S.F........BO
Boot0003* opensuse-secureboot   HD(1,GPT,82fa1047-64d7-4974-b7bd-d5f28ff26308,0x800,0xfa000)/File(\EFI\OPENSUSE\SHIM.EFI)
Boot0004* opensuse      PciRoot(0x0)/Pci(0x1f,0x2)/Sata(0,65535,0)/HD(1,GPT,038b658a-e9c9-4a50-8275-a778e8305ad1,0x800,0xf9800)..BO
Boot0005* opensuse      HD(1,GPT,038b658a-e9c9-4a50-8275-a778e8305ad1,0x800,0xf9800)/File(\EFI\OPENSUSE\GRUBX64.EFI)..BO
Boot0006* opensuse      HD(1,GPT,82fa1047-64d7-4974-b7bd-d5f28ff26308,0x800,0xfa000)/File(\EFI\OPENSUSE\GRUBX64.EFI)..BO
Boot0007* UEFI OS       HD(1,GPT,82fa1047-64d7-4974-b7bd-d5f28ff26308,0x800,0xfa000)/File(\EFI\BOOT\BOOTX64.EFI)..BO
home:~ # blkid
/dev/sdb1: SEC_TYPE="msdos" UUID="6626-832D" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="82fa1047-64d7-4974-b7bd-d5f28ff26308"
/dev/sdb2: UUID="ff78788d-ddbb-4515-9077-ae4831687df6" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="3c8991f5-712f-4428-bd37-996cc5bdf0ef"
/dev/sdb3: UUID="da5f55f3-caca-4ab9-a610-d595a234d85f" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="9ba43fc1-e03c-4714-9c06-8ab9e2c36f7f"
/dev/sdb4: UUID="42f3223e-d55c-4dca-9d94-ee6710db763a" TYPE="swap" PARTUUID="400ca97e-aba3-41f4-933e-2717f7e8af11"
/dev/sda1: LABEL="SYSTEM" UUID="4A06-7B68" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="038b658a-e9c9-4a50-8275-a778e8305ad1"
/dev/sda2: PARTLABEL="Microsoft reserved partition" PARTUUID="9fa4a847-d19f-47de-89f7-fdefc5d68216"
/dev/sda3: LABEL="OSDisk" BLOCK_SIZE="512" UUID="80BE0814BE0804FE" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="76eef4bc-c2a9-4ed4-a5a5-d53ad66c2259"

Oh, and another bit of information which may or may not be useful is that, when I installed openSUSE, I’m fairly sure that it defaulted to using secure boot, even though it is disabled in the BIOS.

I couldn’t upload the photo of the boot options, but it has a few options I didn’t see listed in the output of those commands. I’m pretty sure the 15.3 installer was the one which added an entry with a very generic label “UEFI OS (P2: TOSHIBA DT01ACA100)”.

I’m going to bed now, but I’ll probably post the list of entries in the BIOS tomorrow, in case it might be useful.

Hi
So, the output corresponds to;


Default boot
Boot0003* opensuse-secureboot   HD(1,GPT,82fa1047-64d7-4974-b7bd-d5f28ff26308,0x800,0xfa000)/File(\EFI\OPENSUSE\SHIM.EFI)
/dev/sdb1: SEC_TYPE="msdos" UUID="6626-832D" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="82fa1047-64d7-4974-b7bd-d5f28ff26308"

Boot0004* opensuse      PciRoot(0x0)/Pci(0x1f,0x2)/Sata(0,65535,0)/HD(1,GPT,038b658a-e9c9-4a50-8275-a778e8305ad1,0x800,0xf9800)..BO
/dev/sda1: LABEL="SYSTEM" UUID="4A06-7B68" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="038b658a-e9c9-4a50-8275-a778e8305ad1"

Boot0005* opensuse      HD(1,GPT,038b658a-e9c9-4a50-8275-a778e8305ad1,0x800,0xf9800)/File(\EFI\OPENSUSE\GRUBX64.EFI)..BO
no entry

Boot0006* opensuse      HD(1,GPT,82fa1047-64d7-4974-b7bd-d5f28ff26308,0x800,0xfa000)/File(\EFI\OPENSUSE\GRUBX64.EFI)..BO
/dev/sdb1: SEC_TYPE="msdos" UUID="6626-832D" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="82fa1047-64d7-4974-b7bd-d5f28ff26308"

Boot0007* UEFI OS       HD(1,GPT,82fa1047-64d7-4974-b7bd-d5f28ff26308,0x800,0xfa000)/File(\EFI\BOOT\BOOTX64.EFI)..BO
/dev/sdb1: SEC_TYPE="msdos" UUID="6626-832D" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="82fa1047-64d7-4974-b7bd-d5f28ff26308"

So as you suspected secure boot on sdb1 is first ‘0003’ entry, ‘0004’ is on sda, which I’m guessing is not needed… The ‘0006’ and ‘0007’ are the other non-secure boot and fallback respectively.

I would delete 0005 since that’s not even present, since don’t want to use sda1 entry delete that as well… then set ‘0006’ entry to the default boot…

Personally, I only do a fresh install on a new system or, if I swap out the system drive …

  • Everything else is an upgrade –
    *=2]If an on-line upgrade, only the system repositories.
    *=2]If an off-line upgrade, also the non-system repositories, if possible …

[HR][/HR]Most important, after the upgrade, execute “rpmconfigcheck” and “rpm --verify --all” to clean up …

  • And then, check for any orphaned packages …

Yeah, the upgrade process obviously can’t be all that bad, otherwise the botched upgrade threads would be much less infrequent. It’s just that almost every time I have seen a botched upgrade thread, the general gist of the responses seem to tend towards something along the tines of “you should have just done a fresh install, bruh”, with the thread starter usually ending up annoyed and frustrated because of data loss. It’s also the case that, whilst I’ve been a user of openSUSE for many years now and I’m perfectly comfortable using the CLI to perform various tasks, I still lack the knowledge to be able to troubleshoot most system-based problems. So even though the odds of me running into a problem during an upgrade might be low, I always just take a backup and do a new install because of the near certainty that if I do run into a problem, I won’t know how to fix it and I could have just avoided it by taking the backup and install route.

@malcolmlewis
Before I proceed, I just have a few more questions. If iv’e understood efibootmgr --help correctly, Ithen I would use efibootmgr -b 0005 -B to delete 0005, right? When you say to delete the sda entries because you assume they’re not needed, do you men I should do

efibootmgr -b 0005 -B
efibootmgr -b 0003 -B
efibootmgr -b 0006 -B
efibootmgr -b 0007 -B

and leave 0000 Windows Boot Manager in place? Deleting 0000 would mean I could no longer boot in to Windows 7, right?

Thanks for the help so far guys. Sorry if these are stupid questions. I’m just being extra cautious because I really don’t want to lose my Windows 7 install and end up being forced to chose between using Windows 10, or not using hardware/software which only works with Windows.

Hi
That’s the good thing about efi entries, that’s all they are BIOS NVRAM so nothing to do with anything on the actual disk, easy to recreate if accidentally deleted, boot from a rescue device and re-create, or in a lot of cases from the BIOS boot menu can browse to the relevant efi file and boot from that.

One thing to watch out for is entries changing the entry number after deleting one, so just watch for that. I would also start with the highest number and work back.

Yes, ‘0005’ can go as well…

To create a new entry and since your using two disks it needs to be specified as it defaults to sda.

For example to re-create 0006


efibootmgr -c -d /dev/sdb -l "openSUSE Boot" -l "\\EFI\\opensuse\\grubx64.efi"

This one piece of conceptual advice does a lot to put my mind at ease, and also helps to make sense of why formatting the Linux disk never seemed to get rid of the old boot entries. Oh and thanks for the tip about the immediate re-indexing of entries. I did wonder about that after I’d posted, but you answered it before I even asked anyway. Thanks again.

:smiley:

Well this is strange. I entered used

efibootmgr -b 0007 -B
efibootmgr -b 0006 -B
efibootmgr -b 0005 -B
efibootmgr -b 0004 -B

and after each command it printed out a little bit of information about the remaining entries, all of which seemed like the expected information, but after a reboot, all but one of them is back again. It seems like efibootmgr -b 0007 -B worked exactly as intended, but it refuses to delete entries 0004 to 0006. each deletion command says that it has been removed, but always comes back on reboot.

:confused:

Hi
Well I wouldn’t worry too much, what i do on my systems is delete them all and create the one or two I want and then the system adds back in the ones it wants on next reboot…

On this system I removed them all and added one entry for openSUSE… it added the other eleven…lol


efibootmgr

BootCurrent: 0000
Timeout: 0 seconds
BootOrder: 0000,000A,000B,0001,0002,0003,0004,0005,0006,0007,0008,0009
Boot0000* opensuse  HD(1,GPT,3f31080b-e108-4e36-a7fd-ac863a5804fa,0x800,0x10400)/File(\EFI\opensuse\grubx64.efi)
Boot0001  Startup Menu
Boot0002  System Information
Boot0003  Bios Setup
Boot0004  3rd Party Option ROM Management
Boot0005  System Diagnostics
Boot0006  System Diagnostics
Boot0007  System Diagnostics
Boot0008  System Diagnostics
Boot0009  Boot Menu
Boot000A  USB:  
Boot000B  CDROM:  

I have a computer which does that. It seems that the BIOS keeps a private copy and restores what it wants to restore on the next boot. Possibly, there might be a BIOS option to remove those entries.