Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: Lost grub2 twice after update

  1. #1

    Default Lost grub2 twice after update

    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.

  2. #2
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    15,677
    Blog Entries
    3

    Default Re: Lost grub2 twice after update

    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:
    Code:
    /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:
    Code:
    (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.
    openSUSE Leap 15.3; KDE Plasma 5.18.6;

  3. #3

    Default Re: Lost grub2 twice after update

    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:
    Code:
    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.

  4. #4
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    15,677
    Blog Entries
    3

    Default Re: Lost grub2 twice after update

    Quote Originally Posted by fuerstu View Post
    Code:
    linux-top:/etc/default # more grub_installdevice
    /dev/disk/by-id/ata-WDC_WD2500BEVT-22ZCT0_WD-WXEY08CR3626-part2
    activate
    generic_mbr
    
    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:
    Code:
    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:
    Code:
    ls -l /dev/disk/by-id | grep sda2
    to find out what possible device-ids are available. Or use a suitable "by-uuid" instead.
    openSUSE Leap 15.3; KDE Plasma 5.18.6;

  5. #5

    Default Re: Lost grub2 twice after update

    Quote Originally Posted by nrickert View Post
    Check that "by-id" line. Specifically:
    Code:
    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".
    It is:
    Code:
    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 :-).

  6. #6
    Join Date
    Sep 2012
    Posts
    7,104

    Default Re: Lost grub2 twice after update

    If it happens again please run bootinfoscript before reinstalling grub2 and post RESULTS.txt to http://susepaste.org/:
    https://github.com/arvidjaar/bootinfoscript

  7. #7

    Default Re: Lost grub2 twice after update

    Quote Originally Posted by arvidjaar View Post
    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?

  8. #8
    Join Date
    Sep 2012
    Posts
    7,104

    Default Re: Lost grub2 twice after update

    Quote Originally Posted by fuerstu View Post
    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.

  9. #9

    Default Re: Lost grub2 twice after update

    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:
    Code:
    1. ERROR: Unable to open /proc/mounts or /etc/mtab
    2. ERROR: finding sysfs mount point
    3. mount: failed to read mtab: No such file or directory
    4. mount: failed to read mtab: No such file or directory
    5. umount: sda1: umount failed: No such file or directory.
    6. umount: sda1: umount failed: No such file or directory.
    7. mount: failed to read mtab: No such file or directory
    8. mount: failed to read mtab: No such file or directory
    9. umount: sda7: umount failed: No such file or directory.
    10. umount: sda7: umount failed: No such file or directory.
    11. ERROR: finding sysfs mount point
    12. ERROR: Unable to open /proc/mounts or /etc/mtab
    13. ERROR: finding sysfs mount point
    14. /proc/mounts: _get_sysfs_dir fopen failed: No such file or directory
    15. /proc/devices: fopen failed: No such file or directory
    16. mdadm: cannot open /proc/partitions
    17. mdadm: No devices listed in conf file were found.
    18. 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

  10. #10
    Join Date
    Sep 2012
    Posts
    7,104

    Default Re: Lost grub2 twice after update

    Quote Originally Posted by fuerstu View Post
    I ran the bootinfoscript before reinstalling grub2 and the full text is at https://paste.opensuse.org/97878254
    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.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •