This is in connection to my other thread "Peculiar Problem Booting Leap 15.6.
I started the post and suddenly had to leave it. Here is what I was to post.
I have a desktop (old) i3-2105 @ 3.10GHz, 2 SSDs (one for OpenSUSE and one for Windows 10). The OpenSUSE SSD has Leap 15.5 and 15.6. In addition I have a portable SSD with Leap 15.6 for use when travelling. When booting I use F12 key to select OpenSUSE SSD where I wish to work, else system boots into Windows as default. At the Grub menu I can opt to either boot to 15.6 or 15.5. My working data is on a separate partition on this SSD so I can access it from either installations.
As brought out in the linked thread, I had problems with 15.6 and finally went for re-installing 15.6 in the same partitions as earlier. That is when the Mariadb file download failed forcing me to abort the installation. As suggested by Knurpht I decided to clean the zypper cache. I did so by booting from the portable SSD (15.6) and issuing sudo zypper clean command in terminal. Was that the correct way?
When I tried installing 15.6 again the Open SUSE did not show up at the disk utilisation stage. The SSD does show up in the F12 booting menu but not in the installation process. So I tried to boot into the SSD from F12 menu and ran into Grub Rescue. It appears that unless grub is repaired I cannot proceed further.
I have tried to repair grub by booting from portable SSD, mounting the 15.5 partition as its grub files will be intact, chroot to 15.5 partition and issued grub-install /dev/sdb (that is the target SSD). However I got error message ‘command not found’. What am I doing wrong? And what should I do?
PrakashC
We don’t want to see user interpretation stories, we want to see output and real commands. In pre-formatted text ( </> ).
- How did you do the chroot? Step by step, real commands
- Did some Windows Update happen?
- Could you be more clear about the partitioning? Like showing
lsblkfrom the portable install?
Here are the details of my SSDs.
sda is the Windows 10. sdb is for the OpenSUSE. sdb2 is / for 15.5 with home at sdb6. 15.6 / is sdb3 with home at sdb8. Swap sdb7. sdb 5,7 and 9 are where I store working data and mount as required. sdc is the portable SSD.
<localhost:~ # fdisk -l
Disk /dev/sda: 232.89 GiB, 250059350016 bytes, 488397168 sectors
Disk model: Samsung SSD 860
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xd853d332
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 104447 102400 50M 7 HPFS/NTFS/exFAT
/dev/sda2 104448 162814679 162710232 77.6G 7 HPFS/NTFS/exFAT
/dev/sda3 162816000 163837951 1021952 499M 27 Hidden NTFS WinRE
/dev/sda4 163840000 488394751 324554752 154.8G 7 HPFS/NTFS/exFAT
Disk /dev/sdb: 232.89 GiB, 250059350016 bytes, 488397168 sectors
Disk model: Samsung SSD 860
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 7EF8DA19-2CFB-46C3-80E0-65C57B514ACB
Device Start End Sectors Size Type
/dev/sdb1 2048 18431 16384 8M BIOS boot
/dev/sdb2 18432 83904511 83886080 40G Linux filesystem
/dev/sdb3 293619712 376901631 83281920 39.7G Linux filesystem
/dev/sdb4 125847552 167790591 41943040 20G Linux filesystem
/dev/sdb5 167790592 230705151 62914560 30G Linux filesystem
/dev/sdb6 230705152 293619711 62914560 30G Linux filesystem
/dev/sdb7 480546816 488397134 7850319 3.7G Linux swap
/dev/sdb8 376901632 480546815 103645184 49.4G Linux filesystem
/dev/sdb9 83904512 125847551 41943040 20G Linux filesystem
Partition table entries are not in disk order.
Disk /dev/sdc: 465.76 GiB, 500107862016 bytes, 976773168 sectors
Disk model: Portable SSD T5
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 33553920 bytes
Disklabel type: gpt
Disk identifier: 2F608C60-8B36-4A8A-ADCA-714530D7DADD
Device Start End Sectors Size Type
/dev/sdc1 65535 131069 65535 32M BIOS boot
/dev/sdc2 131070 346680149 346549080 165.2G Linux filesystem
/dev/sdc3 346680150 451536149 104856000 50G Linux filesystem
/dev/sdc4 451536150 468313109 16776960 8G Linux swap>
Knowing that sdb3 with 15.6 was stuck up I decided to work from sdb2 that is 15.5. Here is how I went about it:
<localhost:~ # mount /dev/sdb2 /mnt
localhost:~ # chroot /mnt
localhost.localdomain:/ # grub-mkconfig -o /boot/grub/grub.cfg
bash: grub-mkconfig: command not found>
Since that did not work and I surmised that 15.5 was intact, I next tried
<localhost.localdomain:/ # grub-install /dev/sdb
bash: grub-install: command not found
localhost.localdomain:/ # update-grub
bash: update-grub: command not found>
And finally exited and decided to ask for more experienced help.
<localhost.localdomain:/ # exit
exit>
Windows and Linux run independently (either one or the other) so no possibility of Windows Update interference.
You were asked before to please use pre-formatted text for posting output, this including prompt-command-output-prompt. Ignoring that advice leads to unreadable posts with no separation between comment and output. It is your responsibility to properly post, you cannot expect us to edit every single post for you. I will leave it up to you to come up with a properly formatted post.
Do not fracture your problem into multiple posts.
You should have continued Replies into the original thread.
Otherwise, fracturing into multiple threads just leads to confusion and discontinuity.
I had copied the commands and output from the terminal to Kate in order to compose my post. I am more of a user comfortable with the graphic window than the command prompt/text terminal. I hope the following will be OK.
localhost:~ # fdisk -l
Disk /dev/sda: 232.89 GiB, 250059350016 bytes, 488397168 sectors
Disk model: Samsung SSD 860
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xd853d332
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 104447 102400 50M 7 HPFS/NTFS/exFAT
/dev/sda2 104448 162814679 162710232 77.6G 7 HPFS/NTFS/exFAT
/dev/sda3 162816000 163837951 1021952 499M 27 Hidden NTFS WinRE
/dev/sda4 163840000 488394751 324554752 154.8G 7 HPFS/NTFS/exFAT
Disk /dev/sdb: 232.89 GiB, 250059350016 bytes, 488397168 sectors
Disk model: Samsung SSD 860
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 7EF8DA19-2CFB-46C3-80E0-65C57B514ACB
Device Start End Sectors Size Type
/dev/sdb1 2048 18431 16384 8M BIOS boot
/dev/sdb2 18432 83904511 83886080 40G Linux filesystem
/dev/sdb3 293619712 376901631 83281920 39.7G Linux filesystem
/dev/sdb4 125847552 167790591 41943040 20G Linux filesystem
/dev/sdb5 167790592 230705151 62914560 30G Linux filesystem
/dev/sdb6 230705152 293619711 62914560 30G Linux filesystem
/dev/sdb7 480546816 488397134 7850319 3.7G Linux swap
/dev/sdb8 376901632 480546815 103645184 49.4G Linux filesystem
/dev/sdb9 83904512 125847551 41943040 20G Linux filesystem
Partition table entries are not in disk order.
Disk /dev/sdc: 465.76 GiB, 500107862016 bytes, 976773168 sectors
Disk model: Portable SSD T5
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 33553920 bytes
Disklabel type: gpt
Disk identifier: 2F608C60-8B36-4A8A-ADCA-714530D7DADD
Device Start End Sectors Size Type
/dev/sdc1 65535 131069 65535 32M BIOS boot
/dev/sdc2 131070 346680149 346549080 165.2G Linux filesystem
/dev/sdc3 346680150 451536149 104856000 50G Linux filesystem
/dev/sdc4 451536150 468313109 16776960 8G Linux swap>
localhost:~ #
localhost:~ # mount /dev/sdb2 /mnt>
localhost:~ # chroot /mnt
localhost.localdomain:/ # grub-mkconfig -o /boot/grub/grub.cfg
bash: grub-mkconfig: command not found
localhost.localdomain:/ # grub-install /dev/sdb
bash: grub-install: command not found
localhost.localdomain:/ # update-grub
bash: update-grub: command not found
localhost.localdomain:/ # exit
localhost:~ #
Let me tell you my experience, and you can decide how much, if any of this, is applicable to you.
Early on, when I was setting up and tuning my external SSD enclosure (which has a 1 TB SSD inside) I managed to somehow mess up the LEAP-15.6 grub boot configuration on my laptop’s SSD. I posted about this a thread about my external SSD enclosure.
The external SSD thou (also with LEAP-15.6) was in good shape and I could boot to it.
So with my laptop’s power off, I connected the external SSD enclosure to my laptop, and I booted to the external SSD’s LEAP-15.6.
Running LEAP from the external SSD, I could see in YaST that the external SSD’s partitions were labelled nvme0n1px (where x was 1 to 7). I could see in YaST that the internal SSD partitions ere all labelled sdax (where x was 1 to 4).
My recollection is I opened a bash shell, and did the following:
oldcpu@lenovo:~> sudo su -
lenovo:~ # grub2-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=openSUSE_Internal --recheck
Installing for x86_64-efi platform.
Installation finished. No error reported.
As opposed to starting with sudo su - you could just put sudo in front of each command.
I then followed it up with grub2-mkconfig (see below)
lenovo:~ # grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found theme: /boot/grub2/themes/openSUSE/theme.txt
Found linux image: /boot/vmlinuz-6.4.0-150600.23.53-default
Found initrd image: /boot/initrd-6.4.0-150600.23.53-default
Found linux image: /boot/vmlinuz-6.4.0-150600.23.47-default
Found initrd image: /boot/initrd-6.4.0-150600.23.47-default
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
5010.132769 | DM multipath kernel driver not loaded
Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
Found openSUSE Leap 15.6 on /dev/sda3
Adding boot menu entry for UEFI Firmware Settings ...
done
lenovo:~ #
So, you may well ask why did I do this? I do NOT know this stuff off of the top of my head, but I did know before such was and is doable. So this is a summary of what I read on the internet:
The openSUSE command ( grub2-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=openSUSE_Internal --recheck ) installs the GRUB2 bootloader for UEFI systems. Here is a break down each part:
- grub2-install - The main command that installs GRUB2 bootloader files
--target=x86_64-efi- Specifies the target platform as 64-bit x86 UEFI (as opposed to legacy BIOS or other architectures)--efi-directory=/boot/efi- Points to the EFI System Partition mount point where UEFI bootloader files will be installed. This is typically a FAT32 partition mounted at /boot/efi … given your PC has two SSDs I do not know how much of this is applicable to you.--bootloader-id=openSUSE_Internal- Sets a custom identifier for this bootloader entry. This creates a directory called openSUSE_Internal in the EFI partition and registers it with the UEFI firmware. If successful, this should appear in the system’s boot menu--recheck- Forces GRUB to re-examine the device map and partition layout, ensuring it has current information about available drives and partitions
I read this command is typically used when:
- Installing openSUSE on a UEFI system
- Repairing a broken GRUB installation
- Setting up a custom bootloader configuration
- Moving from BIOS to UEFI boot mode
The “Internal” suffix in the bootloader ID suggests this might be for an internal testing or development setup rather than a standard end-user installation.
=== BUT that was not the only command I sent - also sent grub-mkconfig … Why?
The command ( grub2-mkconfig -o /boot/grub2/grub.cfg ) generates a new GRUB2 configuration file for openSUSE LEAP 15.6:
grub2-mkconfig- The utility that automatically generates GRUB2 configuration by scanning a system-o /boot/grub2/grub.cfg- Specifies the output file location where the generated configuration will be written. This is GRUB2’s main configuration file that it reads during boot
I read that here is what happens when this command runs:
1st - System Scanning:
- it detects all installed operating systems (Linux kernels, Windows, etc.)
- it finds available kernel versions in /boot
- it checks for recovery/rescue kernels
- it looks for other bootable operating systems on different partitions
2nd - Configuration Generation:
- it creates boot menu entries for each found kernel
- it sets up proper kernel parameters and initrd paths
- it applies settings from /etc/default/grub (timeout, default boot option, etc.)
- it includes any custom entries from /etc/grub.d/ scripts
openSUSE LEAP 15.6 Specifics:
- it will typically find the main kernel and any installed kernel flavors
- it may include YaST2 bootloader settings
- it creates entries for normal boot and recovery modes
This command is commonly run after:
- Installing a new kernel
- Changing GRUB settings in /etc/default/grub
- Adding/removing operating systems
- The previous grub2-install command (to ensure the newly installed bootloader has current configuration)
The combination of these two commands essentially reinstalls GRUB2 and rebuilds its configuration from scratch.
I have not (yet) examined your computer’s partitioning structure in detail - so I can not say with confidence that this approach will work for you. If it were me, in this case, if I were you, I probably would check this a bit more.
I am looking at this which you provided:
/dev/sda1 * 2048 104447 102400 50M 7 HPFS/NTFS/exFAT
and
/dev/sdb1 2048 18431 16384 8M BIOS boot
and
/dev/sdc1 65535 131069 65535 32M BIOS boot
where I understand on your PC, sda is for MS-Windows, sdb1 is internal SSD, and sdc1 is external SSD. Do I have that right. I am surprised to see no nvme … which makes me suspect you booted the external SSD in a legacy mode? But I am not certain.
Given that, I believe the command I used (to recover my setup) will NOT work on your setup.
I think you need to provide more information on your setup.
Before your LEAP 15.6 reinstall problem, when your internal SSD was working and you could see the GRUB menu with both LEAP 15.5 and 15.6 options (when the external SSD was not connected), did you have to press F12 to select the openSUSE SSD, or could you get to the GRUB menu without pressing F12?
If you had to press F12: Then in that case I speculate that your system was likely using Legacy/BIOS boot mode (F12 = legacy boot device selection)
If you could get GRUB without F12: Then I speculate your system was likely using UEFI boot mode (UEFI boot manager handling the menu)
You mentioned pressing F12 to select the openSUSE SSD BEFORE you had the problem. What exactly did you see in that F12 menu - was it a simple list of drives/devices, or did it show boot entries with names like ‘openSUSE’?
Also …
If the menu was a simple drive list = It suggests a Legacy/BIOS boot
If the menu named boot entries = It suggests a UEFI boot
For me, with my limited knowledge, it is important to know if your original working setup used Legacy (–target=i386-pc) or UEFI (–target=x86_64-efi) boot mode.
Show the actual screen with error(s).
Thanks oldcpu. Seeing your post after a long time.
Yes, you are correct, I am sticking to legacy boot.
And as mentioned in my earlier post sda is for the Windows 10. sdb is for the OpenSUSE, sdb2 is / for Leap 15.5 with home at sdb6, Leap 15.6 / is at sdb3 with home at sdb8. Swap sdb7, sdb 5,7 and 9 are where I store working data and mount as required. sdc is the portable SSD. F12 only presented simple drive list, SSDs or attached external devices to boot from. So legacy it is.
The version of Grub 2 (sdb1) used for booting was from Leap 15.6 the later installation from where I could boot into any of the OSes However, when I updated 15.5 and it included a Grub update the system switched to the updated 15.5 entry. To get back to 15.6 entry, after booting to 15.6 I only had to adjust the boot loader waiting time by a second up or down.
I will have to read your posts carefully a few times to really understand the contents, which I will certainly do.
PrakashC
Thanks arvidjaar. But with no OS running and only limited Grub commands available how do I do that?
PrakashC
You take photo.
Thinking out of the box is important. Should have thought of it!
Will do so now.
Given this is a legacy system, I am still puzzling. But with regards to what I quoted of yours … YES, I believe it is inexact.
I think that approach has some issues:
-
Wrong command name: In openSUSE, the command is
grub2-install, notgrub-install -
Possibly Wrong target for legacy GPT: You used
/dev/sdb(whole disk) when maybe < unsure > you use/dev/sdb1(the BIOS boot partition) -
Missing target specification: You didn’t specify
--target=i386-pcfor legacy boot
If I can speculate, following what you attempted to do (which I do not believe is the way I would do this) what you could do instead (after booting from external openSUSE SSD):
Mount the LEAP-15.5 partition
sudo mount /dev/sdb2 /mnt
sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
Chroot and run the correct command
sudo chroot /mnt
grub2-install --target=i386-pc /dev/sdb1
Or alternatively, you could target the whole disk and perhaps grub2 would find the efi:
grub2-install --target=i386-pc /dev/sdb
Exit chroot and unmount
exit
sudo umount /mnt/sys /mnt/proc /mnt/dev /mnt
But in all honesty … I am speculating above in an area in which I have not done such for 2 decades !! So do not know if it is really necessary to do such that way.
I might be tempted to try from a bash shell (without chroot) when running from external SSD’s LEAP-15.6 (and avoid chroot):
1.mount the partition with LEAP-15.5’s grub configuration file (where I am assuming we are referring to sdb2 here):
sudo mkdir -p /mnt
sudo mount /dev/sdb2 /mnt
2.Install GRUB bootloader to the BIOS boot partition
sudo grub2-install --target=i386-pc --boot-directory=/mnt/boot --recheck /dev/sdb1
3.Generate GRUB configuration file
sudo grub2-mkconfig -o /mnt/boot/grub2/grub.cfg
4.Unmount the partition
sudo umount /mnt
5 Remove the mount point if you created it
sudo rmdir /mnt
I am not 100% certain this will work as i am not 100% certain this is what you want.
I based this on my understanding that you think your internal SSD’s LEAP15.6 is totally broken? … To say I have limited experience in rebuilding grub would be an understatement. I have very little.
Rather than rush and try what i suggested, you could wait another day or two so to read if other’s point out flaws in what I typed.
Hopefully when doing this, your external SSD does not give you a black screen because it has gone to sleep.
Your memory is not that bad ![]()
FYI, a couple of things:
- No need to create
/mnt, it’s there by default - After the mounts/bind mounts, chroot the user can simply invoke
yastthe System - Bootloader, check the values, hit OK and the bootloader and it’s config will be rewriten.
I just noted the contents of the screen and typed those in as under.
GRUB loading . . .
Welcome to Grub
Error: …/…/grub-core/fs/btrfs.c:2159:file ‘normal.mod’ not found
Entering Rescue mode…
grub rescue> -
I think I understand that! I will try that. Thanks.
Run bootinfoscript from a live image, upload RESULTS.txt to the https://paste.opensuse.org/
Luckily I have taken time to go through the posts of oldcpu and knurpth of 6 Aug again and now request confirmation that I have understood the advice correctly. ![]()
The steps from 1 to 4 in the last part of oldcpu’s post excepting creating /mnt are recommended. However, the binding of mounts is not mentioned in this part.
Or do I try the earlier part which includes binding (all the four) with an option to call up yast (which I suppose will bring boot loader from 15.5).
I really wish to avoid damaging the partitions containing my working data.
PrakashC