• Automatic creation of last-known-good boot configuration

    From Jens Schmidt@21:1/5 to All on Wed Jul 10 13:40:01 2024
    On Debian testing I've been bitten by the systemd upgrade and the
    systemd package split recently, rendering my dracut-LUKS-based
    system unbootable. I know that my warranty is void since I'm on
    testing, but both these issues would have been much easier to cope
    with if there had been some good backup of my initramfs and kernel
    below /boot.

    So I thought that there might be some automatism like this:

    If the currently used kernel and initramfs have been in use
    already N times and if the boot time has been lower then M
    minutes each time (and if some other conditions are fulfilled),
    then consider that kernel and initramfs good and save them away
    where they will not be overwritten by regular kernel/initramfs
    maintenance.

    Scripting something like that shouldn't be too hard, but I wonder
    if there already is a package implementing that? A cursory search
    hasn't brought up anything. There is package dracut-config-rescue,
    but that only configures a variable that does not seem to be used
    by dracut itself.

    Please CC me when replying.

    Thanks!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michel Verdier@21:1/5 to Jens Schmidt on Wed Jul 10 14:10:01 2024
    On 2024-07-10, Jens Schmidt wrote:

    So I thought that there might be some automatism like this:

    If the currently used kernel and initramfs have been in use
    already N times and if the boot time has been lower then M
    minutes each time (and if some other conditions are fulfilled),
    then consider that kernel and initramfs good and save them away
    where they will not be overwritten by regular kernel/initramfs
    maintenance.

    I compile my kernel adding a version suffixe. But the problem is the same
    if I compile a new version without a different suffixe.

    Perhaps a better way would be to save the "good" kernel in /boot with an additionnal suffixe. Then generate a grub entry for it (update-grub
    should does it). So you can directly boot with it. It supposes enough
    available space in /boot.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nicolas George@21:1/5 to All on Wed Jul 10 15:40:01 2024
    Jens Schmidt (12024-07-10):
    On Debian testing I've been bitten by the systemd upgrade and the
    systemd package split recently, rendering my dracut-LUKS-based
    system unbootable. I know that my warranty is void since I'm on
    testing, but both these issues would have been much easier to cope
    with if there had been some good backup of my initramfs and kernel
    below /boot.

    So I thought that there might be some automatism like this:

    If the currently used kernel and initramfs have been in use
    already N times and if the boot time has been lower then M
    minutes each time (and if some other conditions are fulfilled),
    then consider that kernel and initramfs good and save them away
    where they will not be overwritten by regular kernel/initramfs
    maintenance.

    Scripting something like that shouldn't be too hard, but I wonder
    if there already is a package implementing that? A cursory search
    hasn't brought up anything. There is package dracut-config-rescue,
    but that only configures a variable that does not seem to be used
    by dracut itself.

    I will say: this is probably not possible with Debian, since an apt-get (dist-)uupgrade replaces distributed files, and initrds are rebuilt,
    etc.

    You can consider using a LVM snapshot, but you can only make one
    reliably when the system is read-only. You can consider using a
    filesystem snapshot, but filesystems that support snapshots have their
    own set of problems.

    On the other hand, I can say it is a feature of NixOS, I saw it last
    week when somebody asked me “I made a mistake, our VM doesn't boot
    anymore, can I access the GRUB console?” and they just rebooted on the previous configuration. But NixOS is not Debian, it is barely Unix as
    far as I can see.

    Regards,

    --
    Nicolas George

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dan Ritter@21:1/5 to Jens Schmidt on Wed Jul 10 15:40:01 2024
    Jens Schmidt wrote:
    On Debian testing I've been bitten by the systemd upgrade and the
    systemd package split recently, rendering my dracut-LUKS-based
    system unbootable. I know that my warranty is void since I'm on
    testing, but both these issues would have been much easier to cope
    with if there had been some good backup of my initramfs and kernel
    below /boot.

    So I thought that there might be some automatism like this:

    If the currently used kernel and initramfs have been in use
    already N times and if the boot time has been lower then M
    minutes each time (and if some other conditions are fulfilled),
    then consider that kernel and initramfs good and save them away
    where they will not be overwritten by regular kernel/initramfs
    maintenance.

    Are you using grub as your bootloader? Normally apt upgrade
    leaves the last N (N=5?) kernels and initramfs in /boot, and
    configures grub to make them available. apt dist-upgrade, on the
    other hand, tries to remove the oldest unused kernel and
    initramfs each time.

    -dsr-

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From songbird@21:1/5 to Dan Ritter on Thu Jul 11 01:00:01 2024
    Dan Ritter wrote:
    Jens Schmidt wrote:
    On Debian testing I've been bitten by the systemd upgrade and the
    systemd package split recently, rendering my dracut-LUKS-based
    system unbootable. I know that my warranty is void since I'm on
    testing, but both these issues would have been much easier to cope
    with if there had been some good backup of my initramfs and kernel
    below /boot.

    So I thought that there might be some automatism like this:

    If the currently used kernel and initramfs have been in use
    already N times and if the boot time has been lower then M
    minutes each time (and if some other conditions are fulfilled),
    then consider that kernel and initramfs good and save them away
    where they will not be overwritten by regular kernel/initramfs
    maintenance.

    Are you using grub as your bootloader? Normally apt upgrade
    leaves the last N (N=5?) kernels and initramfs in /boot, and
    configures grub to make them available. apt dist-upgrade, on the
    other hand, tries to remove the oldest unused kernel and
    initramfs each time.

    i do tell apt specifically to not remove any kernel images
    by using the option NeverAutoRemove in apt.conf

    =========
    APT
    {

    NeverAutoRemove { "linux-image.*"; }; // packages that should never
    // considered for autoRemove
    };
    =========

    usually after each kernel upgrade i'll remove the third oldest one
    leaving me the most current one and the one that i used previously
    if it seems to have been stable enough. i like doing some things
    manually and this is one of them. the other one i prefer to do
    myself is bring up the network connection. sometimes i don't need
    it so prefer to leave the connection off...

    also, just out of a good idea i usually keep a stable booting
    partition. this saves me at times.


    songbird

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)