I run Tumbleweed/KDE (no other OS) for several years on my old i386 (legacy boot) computer. Two weeks ago after the update grub2 was gone. The boot showed no grub screen and only attempted a PXE boot which of course failed. So I took out an old Tumbleweed DVD and went into rescue and reinstalled grub2. Last week we had no updates but yesterday I updated again (approx 850 packages or so) and when I tried to reboot grub2 was again gone. Again I needed the old Tumbleweed DVD to reinstall grub. What is happening here? Is it because I installed may be an old grub2 version (installed is now grub2-2.02-9.1.i586)or is something missing that ignores grub after an update? How can I avoid loosing grub after every update? Any help is appreciated.
I don’t know what happened. So I am guessing.
When the grub2 package updates, grub2 is reinstalled. And that has happened a few times recently on Tumbleweed.
My guess is that something went wrong with that reinstall, leaving you with a broken grub2. Your BIOS possibly falls back to PXE in that case.
I suggest that you check:
/etc/default/grub_installdevice
/boot/grub2/device.map
Both are text files. If they contain the wrong information, maybe that can affect how grub2 is reinstalled.
I can’t tell you what should be in those file, because it depends on the system.
In my case, “grub_installdevice” contains:
/dev/disk/by-uuid/75651cdf-1643-41b5-8bee-8beca67b9492
activate
I’m not sure what the second line does. The first line is the device special file (based on UUID) for the partition where grub is installed.
And “device.map” contains:
(hd0) /dev/sda
(hd1) /dev/sdb
That is supposed to give the order of the disks, as known to the BIOS when booting. In my case, there’s only one actual disk. That “/dev/sdb” is probably from the USB device that I used for the installer.
And note that I got that info from 42.3, not from Tumbleweed. But I’m pretty sure that it should be similar for Tumbleweed. Oh, and that’s from a 64-bit system. I no longer have any 32-bit systems around.
thank you, nrickert, I don’t know either hence this thread. It seems that the grub2 version I have is the latest (at least there is no later version available). The two files you list show:
**linux-top:/etc/default #** more grub_installdevice
/dev/disk/by-id/ata-WDC_WD2500BEVT-22ZCT0_WD-WXEY08CR3626-part2
activate
generic_mbr
**linux-top:/etc/default #** cat /boot/grub2/device.map
(hd0) /dev/sda
(hd1) /dev/sdb
**linux-top:/etc/default #**
So it looks pretty similar to yours. I agree that probably something went wrong with the reinstall/upgrade. But there must be something wrong in the system that this happens twice (or may be more often in future). I just wonder what it could be.
Okay. I now understand that “activate”. It means to set the active flag on that partition. And that “generic_mbr” means that generic boot code should be installed in the MBR. Probably used by Yast installer.
Check that “by-id” line. Specifically:
ls -l /dev/disk/by-id/ata-WDC_WD2500BEVT-22ZCT0_WD-WXEY08CR3626-part2
It should be a symbolic link to “/dev/sda2”, or probably to “…/…/sda2”.
However, maybe it doesn’t exist. There has been some change in the device id encoding recently, and perhaps that affected you. If that happened, it would explain your problem.
You can use:
ls -l /dev/disk/by-id | grep sda2
to find out what possible device-ids are available. Or use a suitable “by-uuid” instead.
It is:
**linux-top:/etc/default #** ls -l /dev/disk/by-id/ata-WDC_WD2500BEVT-22ZCT0_WD-WXEY08CR3626-part2
lrwxrwxrwx 1 root root 10 Oct 1 10:26 /dev/disk/by-id/ata-WDC_WD2500BEVT-22ZCT0_WD-WXEY08CR3626-part2
-> **../../sda2**
**linux-top:/etc/default #**
So far it looks OK and of course there is the chance that it is OK now. I am only worried since this happened twice after consecutive upgrades. On the bright side I am becoming quite good in reinstalling grub from the rescue disk :-).
If it happens again please run bootinfoscript before reinstalling grub2 and post RESULTS.txt to http://susepaste.org/:
https://github.com/arvidjaar/bootinfoscript
How do I run this script if the computer is not booting?
You run it from any live media. Somehow you managed to fix bootloader, which implies you were able to boot something.
OK, arvidjaar, it happened again after the last update yesterday. I ran the bootinfoscript before reinstalling grub2 and the full text is at https://paste.opensuse.org/97878254 but here are some of the error messages:
1. ERROR: Unable to open /proc/mounts or /etc/mtab
1. ERROR: finding sysfs mount point
1. mount: failed to read mtab: No such file or directory
1. mount: failed to read mtab: No such file or directory
1. umount: sda1: umount failed: No such file or directory.
1. umount: sda1: umount failed: No such file or directory.
1. mount: failed to read mtab: No such file or directory
1. mount: failed to read mtab: No such file or directory
1. umount: sda7: umount failed: No such file or directory.
1. umount: sda7: umount failed: No such file or directory.
1. ERROR: finding sysfs mount point
1. ERROR: Unable to open /proc/mounts or /etc/mtab
1. ERROR: finding sysfs mount point
1. /proc/mounts: _get_sysfs_dir fopen failed: No such file or directory
1. /proc/devices: fopen failed: No such file or directory
1. mdadm: cannot open /proc/partitions
1. mdadm: No devices listed in conf file were found.
1. mount: failed to read mtab: No such file or directory
After reinstalling grub2 everything works again - I am working on this computer right now. But I have no idea why this happens again and again.
Cheers
Uli
How exactly you reinstall grub2? Please give full step by step description what you did last time. This output shows that grub is installed in both MBR and sda2, which does not match your YaST bootloader configuration you showed earlier.
but here are some of the error messages:
They are unrelated - you probably run bootinfoscript from chroot and did not mount standard filesystems.
Thanks, arvidjaar, for the reinstallation of grub I followed the instructions from openSUSE.
Start with the install DVD and go to rescue, then check where the root partition is (fdisk -l) then mount this partition (in my case sda6) and use the following commands:
mount /dev/sda6 /mnt
mount --bind /dev /mnt/dev
chroot /mnt
grub2-mkconfig -o /boot/grub2/grub.cfg
grub2-install /dev/sda
exit
reboot
You need also /proc and /sys at the very least.
chroot /mnt grub2-mkconfig -o /boot/grub2/grub.cfg grub2-install /dev/sda
I’m rather surprised it worked, but well, grub has some fallbacks.
Anyway, you configured your system with bootloader on /dev/sda2 but reinstall it on /dev/sda. It is impossible to tell exactly what happens but one is certain - when grub2 package is updated it re-installs grub2 on /dev/sda2 (because that is what your system is configured to do) so whatever had been installed in /dev/sda no more matches. The effect is rather unexpected, but assuming grub2 somehow crashes during boot …
Either reconfigure your system to use MBR for bootloader (that is what you have now anyway) or install generic bootloader in MBR to match YaST configuration.
Yes the instructions say to use the commands mount /proc and mount /sys as well but they give an error message and so I tried without and it worked
Anyway, you configured your system with bootloader on /dev/sda2 but reinstall it on /dev/sda. It is impossible to tell exactly what happens but one is certain - when grub2 package is updated it re-installs grub2 on /dev/sda2 (because that is what your system is configured to do) so whatever had been installed in /dev/sda no more matches. The effect is rather unexpected, but assuming grub2 somehow crashes during boot …
Grub never loads and it falls back to PXE boot which of course fails
Either reconfigure your system to use MBR for bootloader (that is what you have now anyway) or install generic bootloader in MBR to match YaST configuration.
Thanks, arvidjaar, does that mean I should for the last command write “grub2-install /dev/sda2” ? How do I reconfigure the system for the use of the MBR bootloader?
This morning the computer booted without any problem. I checked the bootloader with YAST and there the tick was in “boot from Extended Partition” (which of course is sda2 and which contains sda6). I can put another tick in the box “boot from Master Boot Record” but as I said today it booted OK. THe question is what will happen when grub2 is updated again. With ticks in both boxes (Extended Partition and in MBR) what will happen - will it try at random or both?
Is there anyone in this forum who can help me with this issue - I have reinstalled grub at least 8 times now. May be I have to reinstall tumbleweed.
arvidjaar you wrote: “Either reconfigure your system to use MBR for bootloader (that is what you have now anyway) or install generic bootloader in MBR to match YaST configuration.”
I am sorry but I could not find anything on the internet which told me what to do. I have tried in YAST to put the second tick in the box “boot from master boot record” (I still left the tick in “boot from extended partition” which is sda2) and twice the computer booted without problem. Today it reverted back to PXE booting and I had to reinstall grub2 again. I could find no pattern in this behaviour. There was no update from the last time time it booted OK to today where it did not boot at all without reinstalling grub. Any help is appreciated!
It’s an old machine. Have you considered hardware problem??
Download latest install iso and do an upgrade from it. That should repair it if it is not hardware.
An upgrade will keep all installed programs
Thanks, gogalthorp, it is an old computer but since the only thing not working is this booting I had not considered it to be a hardware problem. Since I have already replaced another (not quite so old) i386 I would like to keep this computer working for a while. At the last login I made a complete backup of the home directory, so I will take your advice, but I think I do a complete new install and hopefully this machine will run another 12 years ;).
Cheers
Uli