Bug 31155 - Would remove-old-kernel remove the only working kernel ?
Summary: Would remove-old-kernel remove the only working kernel ?
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: Normal enhancement
Target Milestone: ---
Assignee: Barry Jackson
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-20 15:45 CET by GG HH
Modified: 2022-11-21 16:25 CET (History)
1 user (show)

See Also:
Source RPM: remove-old-kernels-0.99.2-3.mga9.src.rpm
CVE:
Status comment:


Attachments
Screen shot where a kernel would be removed if not running. (142.68 KB, image/png)
2022-11-21 15:00 CET, Barry Jackson
Details
Screen shot in advanced mode (143.06 KB, image/png)
2022-11-21 15:14 CET, Barry Jackson
Details

Description GG HH 2022-11-20 15:45:32 CET
Would it remove old kernels possibly including the current running one ?
Reading the man page, it would - I did not test it.

If so, it may happen that newer kernels are installed and the system not restarted.
In such a situation, new kernels might have "pushed out" the current one and later fail to boot or broke major features including wifi
That may lead rollbacks harder - or impossible for inexperienced users.
This is especially true when running cauldron as "test" kernel land more often.

If remove-old-kernel would not remove the running one, it would be safer.
Of, course not totally safe as corner cases exist (eg. rebooting with a new kernel, network broken and the scheduled remove-old-kernel task is run.

thanks for reading.
GG HH 2022-11-20 15:45:43 CET

CC: (none) => boulshet

Comment 1 Thomas Backlund 2022-11-20 17:08:44 CET
no, it has checks in place that prevents the running kernel from being removed.
Comment 2 Thomas Backlund 2022-11-20 17:11:27 CET
if the manpage states / implies something like that, it needs to be updated / clarified

Assignee: bugsquad => zen25000

Comment 3 GG HH 2022-11-20 17:24:06 CET
if does not explicitely but does neither state that it would remove old kernels *but* the running one. So my assumption was it would remove it.
Comment 4 Barry Jackson 2022-11-20 23:56:51 CET
It will never remove the running kernel.

If the running kernel has been removed by some means since boot, (which is possible see: https://bugs.mageia.org/show_bug.cgi?id=31015) then it will abort with an error message and remove nothing.

Check that you have the latest man page as due to a packaging error on my part the wrong (old) man page was included with 0.99.2.1. The latest package has the correct one although it is still being worked on and can still be improved or corrected.

I have just inserted the following into the draft of the next release of the man page:

"It will never remove the running kernel.

If the running kernel has been accidentally removed by some utility since boot then it will report this and abort, removing nothing."

So closing as fixed.

Please feel free to re-open or report any other issues or concerns.

Thanks for contributing!

Resolution: (none) => FIXED
Status: NEW => RESOLVED

Comment 5 GG HH 2022-11-21 13:22:51 CET
thanks a lot
In doubt i was somewhat reluctant to use it.
FYI, I currently only have 0.99.2 on the mirrors
thanks !
Comment 6 Barry Jackson 2022-11-21 15:00:22 CET
Created attachment 13527 [details]
Screen shot where a kernel would be removed if not running.

Here is a screen shot of the situation that concerned you.

Here the running kernel is the earliest installed and also the 4th kernel, with the 'number to remove' set to the default of 3, so it would be removed if it was not running.

The -devel file in red is the 4th and oldest so it WILL be removed.
In 'advanced mode' it would not be removed because the matching kernel is also installed and not being removed on this occasion.

If you need to keep various kernels and the matching -devels installed then you can easily turn on advanced mode with 'rok -Q1' as root.

I hope that helps.
Comment 7 Barry Jackson 2022-11-21 15:14:21 CET
Created attachment 13528 [details]
Screen shot in advanced mode

This is the same machine in advanced mode, where nothing would be removed at all.
Column 3 shows the key to the reasons why all are being kept (except where it is simply the number of kernels setting).
K (for -devel packages) indicates that the kernel is still installed.

The key to column 3 is in the help -h or -? option.
Comment 8 Barry Jackson 2022-11-21 16:25:30 CET
In comment #6 I meant 'number to keep set to ....'  Oops!

Note You need to log in before you can comment on or make changes to this bug.