Page 3 of 3 FirstFirst 123
Results 21 to 28 of 28

Thread: 13.2 RC-1 sparse file

  1. #21

    Default Re: 13.2 RC-1 sparse file

    Quote Originally Posted by Konfekt View Post
    The bug was reported four years ago but its status is still "Wishlist".
    Thus, as it is a problem of grub itself, it is unresovled.
    Why is a 4 year old, still open, Ubuntu wishlist item a problem of grub itself and applies to openSUSE? I don't follow your logic.
    And you haven't answered my question: did you ever see this key request (on openSUSE).

    I haven't read the whole bug report, but it also mixes a few things AFAICS. E.g. even a similar problem with reiserfs is mentioned. I use reiserfs since twelve years, with grub2 since 3 years, and never had such an issue.

    Again, grub2 cannot write to a btrfs partition. That's a fact, that's a missing feature in grub2 itself, and causes the problem that a set boot entry will be permanent.
    And again, there is a workaround in openSUSE for the case of hibernate/resume.

    Because the error, including the key press request, reproduced itself
    as indicated at the bug report and the workaround applied as well,
    I suspected them to be related.
    Sigh.
    There is no key press request in openSUSE's grub2 AFAIK.
    And as I already wrote, I think this key press request has been removed in grub2 itself.

    Just because it has been mentioned in a Ubuntu bug report _4_ years ago and that bug report is still open, doesn't mean that this is still the case, on openSUSE in particular.

    So in theory there is a script executed at shutdown that prevents this error,
    No, there is not.
    There is a script executed on resume from hibernation that prevents this error.

    but[/FONT][/COLOR]
    in practice with

    GRUB_DEFAULT=saved

    the error occurred as described at the bug report.
    The error only occurs if you (or some program) explicitely set an entry to be booted on the next boot. Either via grub2-once, grub2-restart, or KDE's restart menu.

    The script run on hibernation does so as well, to prevent you booting a different entry and loose data (because you might mount a hibernated partition).
    The same script is run on resume then again, and resets grubenv to prevent this problem.
    So if you have this problem after hibernation, this script didn't run for some reason (probably because you didn't resume the system at all).
    I already pointed you to a bug in this regard, where the script could set an incorrect entry which would cause your system to not resume at all.
    But again, this does not happen as long as you boot the default kernel, not one from "Advanced Options".

    Normally this problem will _not_ occur (on openSUSE) even with "GRUB_DEFAULT=saved"

    And to "fix" it completely, grub2 would have to gain write support for btrfs (the same problem exists with certain other filesystems and LVM as well though AFAIK), or the "environment block" (grubenv) would need to be saved by grub2 in a different way such that it can change it even when /boot is on btrfs.

    But I don't see any point in discussing this further here.
    The problem is clear, it is not what you seem to think it is, but it apparently is not trivial to solve either.

  2. #22
    Join Date
    Dec 2014
    Location
    Paris
    Posts
    52

    Default Re: 13.2 RC-1 sparse file

    Quote Originally Posted by wolfi323 View Post
    And you haven't answered my question: did you ever see this key request (on openSUSE).
    I used openSUSE 13.2 and now use openSUSE Tumbleweed and saw the key request under both of these.

    By gparted I shrank shrink the btrfs partition and enlarged the swap partition (to make hibernation work more reliably
    because the standard install created a 2GB swap partition when there are 8GB RAM). Then updated the MBR by
    grub2 and there it was, the key request. Until the offending line `GRUB_DEFAULT=saved` was changed.

    Quote Originally Posted by wolfi323 View Post
    There is a script executed on resume from hibernation that prevents this error.
    This is interesting (though offtopic) because cron and anacron lack a target for resume.
    Where is the script? Can you make a script execute on resume as a user (but not root)?
    This was discussed and answered negatively at

    https://forums.opensuse.org/showthre...peruser-rights

  3. #23

    Default Re: 13.2 RC-1 sparse file

    Quote Originally Posted by Konfekt View Post
    I used openSUSE 13.2 and now use openSUSE Tumbleweed and saw the key request under both of these.

    By gparted I shrank shrink the btrfs partition and enlarged the swap partition (to make hibernation work more reliably
    because the standard install created a 2GB swap partition when there are 8GB RAM).
    There should be some option in the installer to "enlarge the swap for hibernation" or similar. At least there was in earlier versions.

    Then updated the MBR by
    grub2 and there it was, the key request. Until the offending line `GRUB_DEFAULT=saved` was changed.
    I have no idea what you did exactly when you "updated the MBR by grub2", but this still doesn't convinve me that the key request was related to the "sparse file" error that appears when grub2 tries to write back grubenv.

    Again, I never saw any key request by grub2, and I'm using it on btrfs for over 14 months as well (with GRUB_DEFAULT=saved).

    This is interesting (though offtopic) because cron and anacron lack a target for resume.
    Where is the script?
    For pm-utils it is located in /usr/lib/pm/sleep.d/99Zgrub, for systemd it is /usr/bin/systemd-sleep-grub (called by /usr/lib/systemd/system/hibernate.service).

    But as you may know, you can create your own scripts in /usr/lib/pm-utils/sleep.d/ (or better /etc/pm/sleep.d/) that are called on suspend/hibernate/resume. systemd offers something similar, it uses /usr/lib/systemd/system-sleep/.

    Can you make a script execute on resume as a user (but not root)?
    Not that I know of.
    Those hibernate/resume scripts are called as root.
    You might try to use "sudo" to execute things as a different user though. This won't work with graphical applications that should run inside the user's graphical session of course.

    A (hackish) way would be to replace KDE's screenlocker by a script (by default, "lock screen after hibernate" is turned on), but that would of course being run every time you lock the screen.
    See here: https://forum.kde.org/viewtopic.php?t=61217
    Last edited by wolfi323; 30-Jan-2015 at 04:48.

  4. #24
    Join Date
    Dec 2014
    Location
    Paris
    Posts
    52

    Default Re: 13.2 RC-1 sparse file

    Quote Originally Posted by wolfi323 View Post
    I have no idea what you did exactly when you "updated the MBR by grub2"

    Again, I never saw any key request by grub2, and I'm using it on btrfs for over 14 months as well (with GRUB_DEFAULT=saved).
    Booted by the openSUSE 13.2 LiveCD and executed

    sudo grub2-mkconfig -o /boot/grub2/grub.cfg

    Since then, if GRUB_DEFAULT=saved, then the sparse file error message and the key press request appears.
    If grub_env exists but GRUB_DEFAULT=0 then only the sparse file error message.

  5. #25

    Default Re: 13.2 RC-1 sparse file

    Quote Originally Posted by Konfekt View Post
    Booted by the openSUSE 13.2 LiveCD and executed

    sudo grub2-mkconfig -o /boot/grub2/grub.cfg
    I did this a 100 times and do not have a problem (even with GRUB_DEFAULT=saved).
    And why should there be a difference when you run it manually than when the installer runs it?

    Btw, grub2-mkconfig does _not_ install grub2 and in particular not to the MBR.
    It just generates grub.cfg.

    You have to run "sudo grub2-install /dev/sda" (or similar) to actually _install_ grub2.

    Probably you are not using openSUSE's grub at all?

  6. #26
    Join Date
    Dec 2014
    Location
    Paris
    Posts
    52

    Default Re: 13.2 RC-1 sparse file

    Okay you got me thereI didn't recall the command to restore the MBR correctly, it was

    sudo grub2-install /dev/sda

    How to verify if I am using grub? Because the changes to boot.cfg are reflected ( for example to GRUB_DEFAULT) by the boot sequence, it seemed so to me.

  7. #27

    Default Re: 13.2 RC-1 sparse file

    Quote Originally Posted by Konfekt View Post
    How to verify if I am using grub? Because the changes to boot.cfg are reflected ( for example to GRUB_DEFAULT) by the boot sequence, it seemed so to me.
    Well, you obviously did use grub2 (I think you would notice if not... ), but the question is which version...

    I don't think there's a way to find out other than disassembling the code in the MBR (or the PBR of the active partition, if the MBR contains generic boot code).

    The bootloader code in the MBR (or PBR) loads some grub2 code directly from the sectors on the hard disk (the MBR itself is much too small to contain the actual code, even just the code for reading files from a filesystem).
    Only then does it read grub.cfg from /boot.

    So it might be possible that you used (at least parts of) some older version (maybe even from a different distribution), but that did read your current config files.

    Please note that I don't know grub2 in full detail, so I'm not 100% sure whether this makes complete sense.

    I am quite sure though that what you described is not the normal behaviour on an openSUSE installation.

  8. #28

    Thumbs up Re: 13.2 RC-1 sparse file

    [QUOTE=wolfi323;2668822]Remove the file /boot/grub2/grubenv and the menu should reappear.

    Thank you very much. It's worked perfect.

Page 3 of 3 FirstFirst 123

Posting Permissions

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