[opensuse-factory] /lib/modules never cleaned up ?
I recently noticed that my /lib/modules folder has a lot of cruft: bobbie@p72:~> ls /lib/modules/ 4.19.12-1-default 4.20.12-1-default 5.0.10-1-default 5.0.2-1-default 5.0.8-1-default 5.1.15-1-default 5.1.5-1-default 5.2.14-1-default 5.2.5-1-default 5.3.11-1-default 5.3.2-1-default 5.3.6-1-default 5.4.12-1-default 5.4.14-2-default 5.5.2-1-default 4.20.0-1-default 4.20.13-1-default 5.0.11-1-default 5.0.5-1-default 5.0.9-1-default 5.1.2-1-default 5.1.7-1-default 5.2.2-1-default 5.2.7-1-default 5.3.1-1-default 5.3.4-1-default 5.3.9-1-default 5.4.13-1-default 5.4.7-1-default 5.5.4-1-default 4.20.10-1-default 4.20.6-1-default 5.0.1-1-default 5.0.6-1-default 5.1.10-1-default 5.1.4-1-default 5.2.1-1-default 5.2.3-1-default 5.2.9-1-default 5.3.12-1-default 5.3.5-1-default 5.4.10-1-default 5.4.14-1-default 5.5.1-1-default bobbie@p72:~> du -hs /lib/modules/ 3.6G /lib/modules/ Modules from all kernel versions since I installed TW more than one year ago are there, totalling 3.6G ! That is not expected, right ? Or am I missing something ? -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Thu, 20 Feb 2020 17:11:48 +0100, Michael Pujos <pujos.michael@gmail.com> wrote:
I recently noticed that my /lib/modules folder has a lot of cruft:
bobbie@p72:~> ls /lib/modules/ 4.19.12-1-default 4.20.12-1-default 5.0.10-1-default 5.0.2-1-default 5.0.8-1-default 5.1.15-1-default 5.1.5-1-default 5.2.14-1-default 5.2.5-1-default 5.3.11-1-default 5.3.2-1-default 5.3.6-1-default 5.4.12-1-default 5.4.14-2-default 5.5.2-1-default 4.20.0-1-default 4.20.13-1-default 5.0.11-1-default 5.0.5-1-default 5.0.9-1-default 5.1.2-1-default 5.1.7-1-default 5.2.2-1-default 5.2.7-1-default 5.3.1-1-default 5.3.4-1-default 5.3.9-1-default 5.4.13-1-default 5.4.7-1-default 5.5.4-1-default 4.20.10-1-default 4.20.6-1-default 5.0.1-1-default 5.0.6-1-default 5.1.10-1-default 5.1.4-1-default 5.2.1-1-default 5.2.3-1-default 5.2.9-1-default 5.3.12-1-default 5.3.5-1-default 5.4.10-1-default 5.4.14-1-default 5.5.1-1-default
bobbie@p72:~> du -hs /lib/modules/ 3.6G /lib/modules/
Modules from all kernel versions since I installed TW more than one year ago are there, totalling 3.6G !
Which TW are you running, as my current TW is pretty clean Linux 5.5.4-1-default [openSUSE Tumbleweed 20200218] /lib/modules$ du -sk * 69576 5.4.13-1-default 69640 5.4.14-1-default 69636 5.4.14-2-default 70076 5.5.1-1-default 70080 5.5.2-1-default 71816 5.5.4-1-default
That is not expected, right ? Or am I missing something ?
Note that 15.1 is far worse. (very) old folders are (near) empty, but I too would like to see those being cleaned when needed: Linux 4.12.14-lp151.28.36-default [openSUSE Leap 15.1] /lib/modules$ du -sk * 4 3.11.10-11-default 8 3.11.10-11-desktop 4 3.11.10-11-xen 4 3.11.10-17-default 8 3.11.10-17-desktop 4 3.11.10-17-xen 4 3.11.10-21-default 8 3.11.10-21-desktop 4 3.11.10-21-xen 8 3.11.10-25-default 8 3.11.10-25-desktop 4 3.11.10-25-xen 8 3.11.10-29-default 8 3.11.10-29-desktop 4 3.11.10-29-xen 4 3.11.10-34-xen 4 3.11.10-7-default 8 3.11.10-7-desktop 4 3.11.10-7-xen 8 3.12.59-47-default 8 3.12.59-47-desktop 8 3.12.62-52-default 8 3.12.62-52-desktop 4 3.4.11-2.16-default 24 3.4.11-2.16-desktop 4 3.4.11-2.16-xen 4 3.4.28-2.20-default 20 3.4.28-2.20-desktop 4 3.4.28-2.20-xen 4 3.4.33-2.24-default 20 3.4.33-2.24-desktop 4 3.4.33-2.24-xen 4 3.4.42-2.28-default 20 3.4.42-2.28-desktop 4 3.4.42-2.28-xen 4 3.4.47-2.38-default 20 3.4.47-2.38-desktop 4 3.4.47-2.38-xen 4 3.4.63-2.44-default 24 3.4.63-2.44-desktop 4 3.4.63-2.44-xen 15368 4.12.14-lp150.12.79-default 888 4.12.14-lp151.28.10-default 276772 4.12.14-lp151.28.36-default 8 4.1.31-30-default 8 4.1.34-33-default 8 4.1.36-41-default 8 4.1.36-44-default 8 4.1.38-47-default 8 4.1.38-50-default 10512 4.4.176-96-default 4708 4.4.73-18.17-default 4708 4.4.74-18.20-default 4708 4.4.79-18.26-default 4712 4.4.87-18.29-default 4712 4.4.90-18.32-default 4712 4.4.92-18.36-default -- H.Merijn Brand http://tux.nl Perl Monger http://amsterdam.pm.org/ using perl5.00307 .. 5.31 porting perl5 on HP-UX, AIX, and Linux https://useplaintext.email https://tux.nl http://www.test-smoke.org http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/
On 2/20/20 5:30 PM, H.Merijn Brand wrote:
On Thu, 20 Feb 2020 17:11:48 +0100, Michael Pujos <pujos.michael@gmail.com> wrote:
I recently noticed that my /lib/modules folder has a lot of cruft:
bobbie@p72:~> du -hs /lib/modules/ 3.6G /lib/modules/
Modules from all kernel versions since I installed TW more than one year ago are there, totalling 3.6G ! Which TW are you running, as my current TW is pretty clean
I run latest TW as of today. Looking more closely, this is the nvidia modules that are never removed (see end of mail), and since they take quite a bit of space (around 70 MB) if takes a huge amount of space quickly. These modules are part of the regular nvidia-gfxG05-kmp-default package. So is the issue in that package not removing old modules, or a more general issue higher up in the distro with the removal of old kernels not removing relevant /lib/modules/ folders ? //////// bobbie@p72:~> ls -lR /lib/modules/4.19.12-1-default/ /lib/modules/4.19.12-1-default/: total 0 drwxr-xr-x 1 root root 104 Jan 16 2019 updates /lib/modules/4.19.12-1-default/updates: total 72588 -rw-r--r-- 1 root root 4920472 Jan 11 2019 nvidia-drm.ko -rw-r--r-- 1 root root 29869496 Jan 11 2019 nvidia.ko -rw-r--r-- 1 root root 1868472 Jan 11 2019 nvidia-modeset.ko -rw-r--r-- 1 root root 37661888 Jan 11 2019 nvidia-uvm.ko -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Thu, 20 Feb 2020 17:36:46 +0100, Michael Pujos <pujos.michael@gmail.com> wrote:
On 2/20/20 5:30 PM, H.Merijn Brand wrote:
On Thu, 20 Feb 2020 17:11:48 +0100, Michael Pujos <pujos.michael@gmail.com> wrote:
I recently noticed that my /lib/modules folder has a lot of cruft:
[...]
3.6G /lib/modules/
Modules from all kernel versions since I installed TW more than one year ago are there, totalling 3.6G ! Which TW are you running, as my current TW is pretty clean
I run latest TW as of today.
Looking more closely, this is the nvidia modules that are never removed (see end of mail), and since they take quite a bit of space (around 70 MB) if takes a huge amount of space quickly.
For me all the 3.x folders contained *only* the (empty) folder kernel/drivers/char/drm - I removed those, which already looks much better I have no nVidia. Deliberately. On none of my boxes.
These modules are part of the regular nvidia-gfxG05-kmp-default package. So is the issue in that package not removing old modules, or a more general issue higher up in the distro with the removal of old kernels not removing relevant /lib/modules/ folders ?
After cleanup, I looked into the oldest folder on 15.1: 4.4.73-18.17-default 4.4.73-18.17-default/misc 4.4.73-18.17-default/misc/vmmon.ko 4.4.73-18.17-default/misc/vmnet.ko and on TW I cleared out the old empty folders weak-updates/extra I still have these left: 68M 5.4.13-1-default 69M 5.4.14-1-default 69M 5.4.14-2-default 69M 5.5.1-1-default 69M 5.5.2-1-default 71M 5.5.4-1-default and those are all way more than just video drivers -- H.Merijn Brand http://tux.nl Perl Monger http://amsterdam.pm.org/ using perl5.00307 .. 5.31 porting perl5 on HP-UX, AIX, and Linux https://useplaintext.email https://tux.nl http://www.test-smoke.org http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/
Michael Pujos wrote:
I run latest TW as of today.
Looking more closely, this is the nvidia modules that are never removed (see end of mail), and since they take quite a bit of space (around 70 MB) if takes a huge amount of space quickly.
These modules are part of the regular nvidia-gfxG05-kmp-default package. So is the issue in that package not removing old modules, or a more general issue higher up in the distro with the removal of old kernels not removing relevant /lib/modules/ folders ?
The issue is, they are not part of the package. They are compiled by the init/trigger scripts of the package, so they do not 'belong' to any package. And thus don't get removed :o And removing tham *can* be dangerous, if the weak-updates method is used, as that only creates links to the original module. AFAIK at least in TW the weak-updates is not used anymore, no idea how that is for Leap. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
21.02.2020 13:32, Peter Suetterlin пишет:
Michael Pujos wrote:
I run latest TW as of today.
Looking more closely, this is the nvidia modules that are never removed (see end of mail), and since they take quite a bit of space (around 70 MB) if takes a huge amount of space quickly.
These modules are part of the regular nvidia-gfxG05-kmp-default package. So is the issue in that package not removing old modules, or a more general issue higher up in the distro with the removal of old kernels not removing relevant /lib/modules/ folders ?
The issue is, they are not part of the package.
They most certainly are, at least today: bor@bor-Latitude-E5450:~/Загрузки$ rpm -q --qf '[%{filenames} flags=%{fileflags:fflags}\n]' -p nvidia-gfxG05-kmp-default-440.59_k5.5.1_1-24.2.x86_64.rpm | grep /lib/modules /lib/modules/5.5.1-1-default flags= /lib/modules/5.5.1-1-default/updates flags= /lib/modules/5.5.1-1-default/updates/nvidia-drm.ko flags=g /lib/modules/5.5.1-1-default/updates/nvidia-modeset.ko flags=g /lib/modules/5.5.1-1-default/updates/nvidia-uvm.ko flags=g /lib/modules/5.5.1-1-default/updates/nvidia.ko flags=g bor@bor-Latitude-E5450:~/Загрузки$ flags 'g' == %ghost - file payload is not delivered with package but file should be removed when package is removed. It is possible that this was not the case in the past.
They are compiled by the init/trigger scripts of the package, so they do not 'belong' to any package. And thus don't get removed :o
And removing tham *can* be dangerous, if the weak-updates method is used, as that only creates links to the original module.
I doubt kernel ABI remained stable between 4.19 and 5.5, so if weak updates actually created links it looks like an own issue by itself.
AFAIK at least in TW the weak-updates is not used anymore, no idea how that is for Leap.
-- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Andrei Borzenkov wrote:
21.02.2020 13:32, Peter Suetterlin пишет:
The issue is, they are not part of the package.
They most certainly are, at least today:
bor@bor-Latitude-E5450:~/Загрузки$ rpm -q --qf '[%{filenames} flags=%{fileflags:fflags}\n]' -p nvidia-gfxG05-kmp-default-440.59_k5.5.1_1-24.2.x86_64.rpm | grep /lib/modules /lib/modules/5.5.1-1-default flags= /lib/modules/5.5.1-1-default/updates flags= /lib/modules/5.5.1-1-default/updates/nvidia-drm.ko flags=g /lib/modules/5.5.1-1-default/updates/nvidia-modeset.ko flags=g /lib/modules/5.5.1-1-default/updates/nvidia-uvm.ko flags=g /lib/modules/5.5.1-1-default/updates/nvidia.ko flags=g
Indeed, it seems since 5.5 that has changed. Seems the 5.5.1 modules had been removed with the update to 5.5.2, but the older ones ar still around here...
And removing tham *can* be dangerous, if the weak-updates method is used, as that only creates links to the original module.
I doubt kernel ABI remained stable between 4.19 and 5.5, so if weak updates actually created links it looks like an own issue by itself.
No, not for this case, and/or Tumbleweed. That was a more general remark spotting possible traps.... -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Fri, Feb 21, 2020 at 11:32:59AM +0100, Peter Suetterlin wrote:
AFAIK at least in TW the weak-updates is not used anymore, no idea how that is for Leap.
The weak-updates mechanism uses the fact that we preserve kABI so that module built against older kernel can be used against any newer update. In Tumbleweed we do not preserve kABI (we cannot possibly on version upgrades and it would make little sense to try too hard to preserve it between them) so weak-updates would break too often. Michal Kubecek -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Do you have the purge-kernels service enabled? Andreas. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different." -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On 2/20/20 5:54 PM, Andreas Schwab wrote:
Do you have the purge-kernels service enabled?
Andreas.
Yes I do. It does not seem to remove non-standard modules, suc as nvidia modules. Maybe it should ? -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Thu, Feb 20, 2020 at 05:59:32PM +0100, Michael Pujos wrote:
On 2/20/20 5:54 PM, Andreas Schwab wrote:
Do you have the purge-kernels service enabled?
Andreas.
Yes I do. It does not seem to remove non-standard modules, suc as nvidia modules. Maybe it should ?
I don't think so. It just uninstall "old" kernel packages according to configured rules. Uninstall of a kernel package does not delete files the package did not install. I'm using the script below (slightly modified) from time to time to clean up leftover out-of-tree modules. Michal Kubecek ------------------------------------------------------------------------ #!/bin/bash cd /lib/modules || exit 2 for v in *; do test -d "$v" || continue test -f "/boot/vmlinuz-${v}" || rm -rf "$v" done ------------------------------------------------------------------------ -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Michael Pujos wrote 20.02.2020 17:11:
I recently noticed that my /lib/modules folder has a lot of cruft:
Mine too! Thanks for your message. I managed to delete about 4 GB of old modules, going back to 2017 (there were also a few from 2015, but they were empty). No longer will I need to live in fear of running out of disk space when ‘zypper dup’ reports that 1,500 packages needs upgrading … :) Karl Ove Hufthammer -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Karl Ove Hufthammer wrote:
Michael Pujos wrote 20.02.2020 17:11:
I recently noticed that my /lib/modules folder has a lot of cruft:
Mine too! Thanks for your message. I managed to delete about 4 GB of old modules, going back to 2017 (there were also a few from 2015, but they were empty).
No longer will I need to live in fear of running out of disk space when ‘zypper dup’ reports that 1,500 packages needs upgrading … :)
Optimist :D But you might also want to check /usr/{lib,lib64}/libnvidia* /usr/{lib,lib64}/nvidia/ for older versions of the versioned libraries -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
participants (7)
-
Andreas Schwab
-
Andrei Borzenkov
-
H.Merijn Brand
-
Karl Ove Hufthammer
-
Michael Pujos
-
Michal Kubecek
-
Peter Suetterlin