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

Thread: How does one reinstall grub2 in / ?

  1. #1

    Cool How does one reinstall grub2 in / ?

    I have installed LEAP 42.1 (x86_64) from the distribution DVD on an HP 8570w laptop. I am using Terabyte BIBM as the boot manager (6 bootable partitions in an eMBR), so I installed grub2 in the / partition. Booting and execution then had no problems.

    I next took the updates (138 updates including 50 security updates). The process did not appear to end normally. Even after closing all active windows, the System Monitor showed 15% CPU activity, with one of the CPUs showing pulses of 50% cpu activity. It would not settle down to normal idle behavior. When I rebooted, the system immediately aborted. It appeared to die in grub2. The screen never got to normal bootup logging.

    The SuperGrub Disk 2.02s4 has no problem reading the grub2 configuration and booting the system. However, it provides no way to install the correct grub2 configuration, and RescaTux 0.40b7 is only capable of installing grub2 in the MBR. Running "grub2-install /dev/sda1" in the booted system gets:
    Warning: File system 'ext2' doesn't support embedding.
    ...
    error: Will not proceed with blocklists.
    I have the un-updated installation backed up, so I can redo the update through YaST with selected updates excluded, but I would prefer to learn how to do the grub2 update directly, since I have had problems like this before. Also, if this problem has not been found before, I am willing to see if I can localize the bug in the updates, if I can get some suggestions on where to look.

    Help, please. Thanks!

  2. #2

    Default Re: How does one reinstall grub2 in / ?

    I would suggest that you revert to your backup, then run as root (from a terminal)

    Code:
    zypper up
    instead of updating via YaST

  3. #3
    Join Date
    Sep 2012
    Posts
    5,908

    Default Re: How does one reinstall grub2 in / ?

    Boot from any Linux live distro, chroot into real root, make sure /sys, /dev, /proc, /run and (of necessary) /boot are mounted in chroot, run "update-bootloader --reinit" or, if you prefer, directly "grub2-install /dev/sda1", or whatever your root partition is.

  4. #4
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    27,134

    Default Re: How does one reinstall grub2 in / ?

    Quote Originally Posted by bbuolder View Post
    I would suggest that you revert to your backup, then run as root (from a terminal)

    Code:
    zypper up
    instead of updating via YaST
    What is the dufference between both?
    Henk van Velden

  5. #5

    Default Re: How does one reinstall grub2 in / ?

    No difference, of course. But there may have been a power outage during the update, so it is worth trying again (with either method, but zypper might give more info).

  6. #6
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    27,134

    Default Re: How does one reinstall grub2 in / ?

    Quote Originally Posted by bbuolder View Post
    ... but zypper might give more info).
    Correct and usefull hint. Maybe, next time, explaining this with your suggestion might inform the OP about why you suggest it.
    Henk van Velden

  7. #7

    Default Re: How does one reinstall grub2 in / ?

    First try. Boot from LEAP 42.1 media. Rescue. Mount /dev/sda1. chroot to it. "update-bootloader --reinit" Result:
    Cannot open directory '/mounts/mp_0001/boot/grubw/i3i6-pc': no such file or directory.
    Second try. Chroot as above. "grub-install /dev/sda1" Result:
    Cannot find a device for /boot/grub2 (is /dev mounted?)
    Yes, it's mounted. I am trying to update grub2 in the root partition.
    Third try. Restore original install. Log in as root. "zypper up" Result:
    PackageKit is blocking zypper ... Tell PackageKit to quit?
    (a) PackageKit won't quit. There is no way I can see to force it.
    (b) In the message popup, the software installer has only one button: Install. There is no way to tell it to go away.
    (c) "ps -ef | grep PackageKit" finds only the grep task. Ditto "Kit." Typing ".. grep kit" finds only two daemons, neither of which appear relevant.
    (d) There are several hundred tasks running, so it is not practical to read them and try to guess which one to kill.
    (e) YaST does not appear to have any way to disable the running updater.
    (f) Typing "init 1" to get to single-user mode gives me a "login:" prompt followed immediately by "Welcome to Rescue Mode!..." and an unresponsive keyboard. I apparently can't log in.

    Suggestions?

  8. #8

    Default Re: How does one reinstall grub2 in / ?

    It gets more interesting ...
    The inability to "init 1" may have been due to my use of an external wireless keyboard. I got into single-user mode after several tries. Then 'zypper up' installed 476 packages... and rendered the system unbootable.

    I watched the installs scroll through the screen when zipper ran, and I am certain I saw a message that mentioned grub2 and contained the phrase "unable to install." I will explain what I suspect below. However, I opened /var/log/zypper.log (7.4 MB) and searched for "unable." There were zero hits on that string. I saw another message shortly before that reported "This may not be an error ... swap."

    Please note: I have openSuSE 13.2 in another partition, and I have taken all updates via the KDE update app. This problem has not occurred there. Something in the change from 13.2 to 42.1 has broken the grub2 update mechanism. Furthermore, the error messages documenting the breakage do not make it into zypper.log.

    Here is what is "odd" about my configuration. The install was done with 3 partitions: sda1=root, sda2=swap and sda3=data (NTFS). I have 6 bootable partitions. (Switching is handled by BIBM and an eMBR.) Each uses this layout. I have 2 nearly identical laptops. I can back up a linux partition from any one of 10, and restore it to any other. The 42.1 (and the 13.2) installs were made with the default, UUID=" in fstab. I then replaced the first parameter in each fstab definition with /dev/sda1 and 2 and 3. openSuSE 13.2 has no problem with that. LEAP 42.1 clearly does. The UUID of the root partition is unchanged, but that apparently is not enough for the grub2 update, perhaps because it is not referenced in fstab.

    Both the KDE update app and zypper are trying to install an update that fails, and the failure does not appear in the zypper log. YaST might show me the name in a list, so I can stop it, but I do not know what it is.

    Here is what I would particularly like to know:
    1. How to shut off the KDE updater, at boot or when it's running.
    2. What the offending grub2 update is called, what it does, and whether it is essential.
    3. How to tell update-bootloader to use /boot/grub2/i386-pc/. The man page doesn't show how.
    4. How to install or update grub2 independent of the RPM update process.
    The process suggested above via chroot looked promising, since it reported:
    (sda1) mounted filesystem with ordered data mode. Opts: (null)
    That might get around grub2's problem with writing to the (ext4) partition, but I don't see how the root partition can be unmounted to allow the write, while still having access to it to run the grub2-install or update-bootloader tool.

  9. #9

    Default Re: How does one reinstall grub2 in / ?

    This worked for me, for a different problem. Boot from the install disc in rescue mode, login as root. Issue:

    Code:
    mkdir /tmp/mydir
    mount /dev/sda1 /tmp/mydir
    mount --bind /dev /tmp/mydir/dev
    mount --bind /proc /tmp/mydir/proc
    mount --bind /sys /tmp/mydir/sys
    chroot /tmp/mydir
    grub2-install /dev/sda
    exit
    NOTE the grub2-install /dev/sda, NOT /dev/sda1

  10. #10

    Default Re: How does one reinstall grub2 in / ?

    Indeed, I "NOTE the grub2-install /dev/sda, NOT /dev/sda1"
    Doesn't that write outside the /dev/sda1 partition? grub is presently in the sda1/boot, and I want to keep it there.

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

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