[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: removing modules



On 2021-07-03 18:12, Greg Wooledge wrote:
On Sat, Jul 03, 2021 at 05:50:44PM +0100, mick crane wrote:
I did think that modules are for the kernel to interact with hardware.
There is for example "dell_smm_hwmon" followed "0" which you'd think was to
be used by software for monitoring the PC hardware.

Use modinfo(8) to learn what a module does, or at least a very brief
description of it.

In this case:

unicorn:~$ modinfo dell_smm_hwmon
filename:
/lib/modules/5.10.0-7-amd64/kernel/drivers/hwmon/dell-smm-hwmon.ko
alias:          i8k
license:        GPL
description:    Dell laptop SMM BIOS hwmon driver
[...]

I know, it's not a lot.

This is definitely a PC so this must be the installer thinking it might be a laptop.

I looked because "apt upgrade" failed to install things in /boot because no
room left. I deleted the oldest kernel stuff of the 3 there and "apt
upgrade" worked.
I was thinking then to remove the unwanted modules to make the kernels
smaller.

Modules are sitting on disk waiting to be loaded into memory if they're
needed.

lsmod shows the ones that are currently loaded into memory.

Removing one from memory with rmmod(8) or an equivalent will not reduce
the amount of disk space they take up.  All it will do is free a tiny
bit of RAM, and sacrifice the functionality being provided by the module.

If disk space is a serious issue for you, rmmod(8) will not help.

this is after <cough> deleting the very oldest.

root@pumpkin:/boot# ls -la
total 148944
drwxr-xr-x  4 root root     1024 Jul  3 16:53 .
drwxr-xr-x 20 root root     4096 Jul  3 16:45 ..
-rw-r--r--  1 root root   236065 Apr  9 19:17 config-5.10.0-6-amd64
-rw-r--r--  1 root root   236188 May 28 09:31 config-5.10.0-7-amd64
drwxr-xr-x  5 root root     1024 Jul  3 16:45 grub
-rw-r--r--  1 root root 68868137 Jul  1 16:17 initrd.img-5.10.0-6-amd64
-rw-r--r--  1 root root 68909875 Jul  3 16:53 initrd.img-5.10.0-7-amd64
drwx------  2 root root    12288 Nov 21  2020 lost+found
-rw-r--r--  1 root root       83 Apr  9 19:17 System.map-5.10.0-6-amd64
-rw-r--r--  1 root root       83 May 28 09:31 System.map-5.10.0-7-amd64
-rw-r--r--  1 root root  6824192 Apr  9 19:17 vmlinuz-5.10.0-6-amd64
-rw-r--r--  1 root root  6818304 May 28 09:31 vmlinuz-5.10.0-7-amd64
root@pumpkin:/boot# du -h /boot
12K	/boot/lost+found
2.1M	/boot/grub/i386-pc
2.3M	/boot/grub/fonts
4.3M	/boot/grub/locale
11M	/boot/grub
157M	/boot
root@pumpkin:/boot# df -h /boot
Filesystem      Size  Used Avail Use% Mounted on
/dev/sdb1       236M  159M   65M  71% /boot

Can I not *just* move the older ones out of the way so upgrade doesn't run out of space ?
mick
--
Key ID    4BFEBB31


Reply to: