Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

kern.log file is so huge in /var/log/ folder

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
pedronovaes
Posts: 44
Joined: 2019-08-07 17:49
Has thanked: 1 time

kern.log file is so huge in /var/log/ folder

#1 Post by pedronovaes »

Hy guys,

I'm seeing that my /var/log/ folder is taking up almost 53 Gb. I looked for the bigger files and saw that the kern.log file is almost 53 Gb. I would like to know what actions can I do with this file?

Thanks

User avatar
Hallvor
Global Moderator
Global Moderator
Posts: 2042
Joined: 2009-04-16 18:35
Location: Kristiansand, Norway
Has thanked: 149 times
Been thanked: 212 times

Re: kern.log file is so huge in /var/log/ folder

#2 Post by Hallvor »

Check what's filling it up:

Code: Select all

# tail /var/log/kern.log
[HowTo] Install and configure Debian bookworm
Debian 12 | KDE Plasma | ThinkPad T440s | 4 × Intel® Core™ i7-4600U CPU @ 2.10GHz | 12 GiB RAM | Mesa Intel® HD Graphics 4400 | 1 TB SSD

User avatar
sunrat
Administrator
Administrator
Posts: 6470
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 117 times
Been thanked: 474 times

Re: kern.log file is so huge in /var/log/ folder

#3 Post by sunrat »

Happened to me a long time ago, can't remember what caused it. First you need to find out why that log is so huge. Probably it is the same error or warning messages repeated thousands of times, so read the last 100 lines or so to see if it gives a clue:

Code: Select all

tail -n 100 /var/log/kern.log
Then try to fix whatever is causing the messages.
It's probably ok to delete the file but save a portion of it, say the last 1,000 lines to a file so you can check back in it.

Code: Select all

tail -n 1000 kern.log > <filename>
Post some of it here if you're not sure. Use a paste service and post the link if you feel you need to post a lot.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

pedronovaes
Posts: 44
Joined: 2019-08-07 17:49
Has thanked: 1 time

Re: kern.log file is so huge in /var/log/ folder

#4 Post by pedronovaes »

Code: Select all

tail /var/log/kern.log
output:

Sep 21 08:20:30 inspiron kernel: [ 85.426006] CPU6: Core temperature/speed normal
Sep 21 08:20:30 inspiron kernel: [ 85.426007] CPU2: Core temperature/speed normal
Sep 21 08:20:30 inspiron kernel: [ 85.426007] CPU7: Package temperature/speed normal
Sep 21 08:20:30 inspiron kernel: [ 85.426008] CPU3: Package temperature/speed normal
Sep 21 08:20:30 inspiron kernel: [ 85.426009] CPU2: Package temperature/speed normal
Sep 21 08:20:30 inspiron kernel: [ 85.426010] CPU6: Package temperature/speed normal
Sep 21 08:20:30 inspiron kernel: [ 85.426052] CPU0: Package temperature/speed normal
Sep 21 08:20:30 inspiron kernel: [ 85.426053] CPU4: Package temperature/speed normal
Sep 21 08:20:30 inspiron kernel: [ 85.426054] CPU1: Package temperature/speed normal
Sep 21 08:20:30 inspiron kernel: [ 85.426054] CPU5: Package temperature/speed normal

You can find the last 1000 lines of this file here: https://pastebin.pl/view/1be1693f

User avatar
sunrat
Administrator
Administrator
Posts: 6470
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 117 times
Been thanked: 474 times

Re: kern.log file is so huge in /var/log/ folder

#5 Post by sunrat »

There's a line relating to an unresolved nouveau bug - https://gitlab.freedesktop.org/xorg/dri ... issues/335

If you have systemd journalling enabled post the output from

Code: Select all

jounalctl -b -1 -p3
The '-1" will show data from the previous boot, "-p 3" will filter to only show errors. Enable journalctl if you haven't already.
Also install inxi and post

Code: Select all

inxi -Fx
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

pedronovaes
Posts: 44
Joined: 2019-08-07 17:49
Has thanked: 1 time

Re: kern.log file is so huge in /var/log/ folder

#6 Post by pedronovaes »

Code: Select all

sudo journalctl -b -1 -p3
output:

-- Logs begin at Sun 2020-09-20 19:10:30 -03, end at Mon 2020-09-21 09:30:27 -03. --
Sep 21 08:32:10 inspiron kernel: nouveau 0000:02:00.0: bus: MMIO read of 00000000 FAULT at 6013d4 [ IBUS ]
Sep 21 08:32:10 inspiron kernel: nouveau 0000:02:00.0: bus: MMIO read of 00000000 FAULT at 10ac08 [ IBUS ]
Sep 21 08:32:10 inspiron kernel: psmouse serio1: synaptics: Unable to query device: -5
Sep 21 08:32:10 inspiron kernel: nouveau 0000:02:00.0: DRM: Pointer to TMDS table invalid
Sep 21 08:32:11 inspiron kernel: iTCO_wdt iTCO_wdt: can't request region for resource [mem 0x00c5fffc-0x00c5ffff]
Sep 21 08:32:11 inspiron bluetoothd[590]: Sap driver initialization failed.
Sep 21 08:32:11 inspiron bluetoothd[590]: sap-server: Operation not permitted (1)
Sep 21 08:32:11 inspiron bluetoothd[590]: Failed to set mode: Blocked through rfkill (0x12)
Sep 21 08:32:12 inspiron dhclient[699]: Failed to get interface index: No such device
Sep 21 08:32:12 inspiron dhclient[699]:
Sep 21 08:32:12 inspiron dhclient[699]: If you think you have received this message due to a bug rather
Sep 21 08:32:12 inspiron dhclient[699]: than a configuration issue please read the section on submitting
Sep 21 08:32:12 inspiron dhclient[699]: bugs on either our web page at http://www.isc.org or in the README file
Sep 21 08:32:12 inspiron dhclient[699]: before submitting a bug. These pages explain the proper
Sep 21 08:32:12 inspiron dhclient[699]: process and the information we find helpful for debugging.
Sep 21 08:32:12 inspiron dhclient[699]:
Sep 21 08:32:12 inspiron dhclient[699]: exiting.
Sep 21 08:32:12 inspiron systemd[1]: Failed to start Raise network interfaces.
Sep 21 08:32:13 inspiron kernel: nouveau 0000:02:00.0: bus: MMIO read of 00000000 FAULT at 619444 [ IBUS ]
Sep 21 08:32:16 inspiron bluetoothd[590]: Failed to set mode: Blocked through rfkill (0x12)
Sep 21 08:32:25 inspiron kernel: nouveau 0000:02:00.0: bus: MMIO read of 00000000 FAULT at 6013d4 [ IBUS ]
Sep 21 08:32:26 inspiron bluetoothd[590]: RFCOMM server failed for Headset Voice gateway: rfcomm_bind: Address already in use (98)
Sep 21 08:32:26 inspiron bluetoothd[590]: RFCOMM server failed for :1.74/Profile/HSPHSProfile/00001108-0000-1000-8000-00805f9b34fb: rfcomm_bind: Address already in use (98)
Sep 21 08:32:27 inspiron bluetoothd[590]: Failed to set mode: Blocked through rfkill (0x12)
Sep 21 08:32:36 inspiron gnome-session-binary[803]: Unrecoverable failure in required component org.gnome.Shell.desktop
Sep 21 08:32:36 inspiron kernel: nouveau 0000:02:00.0: bus: MMIO read of 00000000 FAULT at 6013d4 [ IBUS ]
Sep 21 09:18:08 inspiron wpa_supplicant[595]: dbus: wpa_dbus_property_changed: no property SessionLength in object /fi/w1/wpa_supplicant1/Interfaces/1
Sep 21 09:18:08 inspiron wpa_supplicant[595]: nl80211: Failed to open /proc/sys/net/ipv4/conf/p2p-dev-wlo1/drop_unicast_in_l2_multicast: No such file or directory
Sep 21 09:18:08 inspiron wpa_supplicant[595]: nl80211: Failed to set IPv4 unicast in multicast filter
Sep 21 09:18:08 inspiron wpa_supplicant[595]: nl80211: Failed to open /proc/sys/net/ipv4/conf/p2p-dev-wlo1/drop_unicast_in_l2_multicast: No such file or directory
Sep 21 09:18:08 inspiron wpa_supplicant[595]: nl80211: Failed to set IPv4 unicast in multicast filter
Sep 21 09:19:33 inspiron kernel: nouveau 0000:02:00.0: bus: MMIO read of 00000000 FAULT at 6013d4 [ IBUS ]
Sep 21 09:19:33 inspiron wpa_supplicant[595]: nl80211: Failed to open /proc/sys/net/ipv4/conf/p2p-dev-wlo1/drop_unicast_in_l2_multicast: No such file or directory
Sep 21 09:19:33 inspiron wpa_supplicant[595]: nl80211: Failed to set IPv4 unicast in multicast filter
Sep 21 09:19:33 inspiron wpa_supplicant[595]: nl80211: Failed to open /proc/sys/net/ipv4/conf/p2p-dev-wlo1/drop_unicast_in_l2_multicast: No such file or directory
Sep 21 09:19:33 inspiron wpa_supplicant[595]: nl80211: Failed to set IPv4 unicast in multicast filter
Sep 21 09:19:33 inspiron wpa_supplicant[595]: dbus: wpa_dbus_property_changed: no property SessionLength in object /fi/w1/wpa_supplicant1/Interfaces/3

Code: Select all

inxi -Fx
output:
System: Host: inspiron Kernel: 4.19.0-10-amd64 x86_64 bits: 64 compiler: gcc v: 8.3.0 Desktop: Gnome 3.30.2
Distro: Debian GNU/Linux 10 (buster)
Machine: Type: Convertible System: Dell product: Inspiron 5482 v: N/A serial: <root required>
Mobo: Dell model: 0V8YD9 v: A01 serial: <root required> UEFI: Dell v: 2.2.0 date: 03/24/2019
Battery: ID-1: BAT0 charge: 29.1 Wh condition: 36.1/42.0 Wh (86%) model: SMP DELL Y3F7Y6B status: Discharging
Device-1: hid-0018:04F3:273D.0007-battery model: ELAN2097:00 04F3:273D charge: N/A status: N/A
CPU: Topology: Quad Core model: Intel Core i7-8565U bits: 64 type: MT MCP arch: Kaby Lake rev: B L2 cache: 8192 KiB
flags: lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 31872
Speed: 800 MHz min/max: 400/4600 MHz Core speeds (MHz): 1: 800 2: 800 3: 800 4: 800 5: 800 6: 800 7: 800 8: 800
Graphics: Device-1: Intel UHD Graphics 620 vendor: Dell driver: i915 v: kernel bus ID: 00:02.0
Device-2: NVIDIA GM108M [GeForce MX130] vendor: Dell driver: nouveau v: kernel bus ID: 02:00.0
Display: wayland server: X.Org 1.20.4 driver: nouveau resolution: 1920x1080~60Hz
OpenGL: renderer: Mesa DRI Intel HD Graphics (Whiskey Lake 3x8 GT2) v: 4.5 Mesa 18.3.6 direct render: Yes
Audio: Device-1: Intel Cannon Point-LP High Definition Audio vendor: Dell driver: snd_hda_intel v: kernel bus ID: 00:1f.3
Sound Server: ALSA v: k4.19.0-10-amd64
Network: Device-1: Intel Cannon Point-LP CNVi [Wireless-AC] driver: iwlwifi v: kernel port: 4000 bus ID: 00:14.3
IF: wlo1 state: up mac: 64:32:a8:80:e2:83
Drives: Local Storage: total: 238.47 GiB used: 120.34 GiB (50.5%)
ID-1: /dev/sda vendor: A-Data model: SU810NS38 SATA 256 GB size: 238.47 GiB temp: 34 C
RAID: Hardware-1: Intel 82801 Mobile SATA Controller [RAID mode] driver: ahci v: 3.0 bus ID: 00:17.0
Partition: ID-1: / size: 224.77 GiB used: 120.34 GiB (53.5%) fs: ext4 dev: /dev/sda2
ID-2: swap-1 size: 8.80 GiB used: 0 KiB (0.0%) fs: swap dev: /dev/sda3
Sensors: System Temperatures: cpu: 46.0 C mobo: N/A
Fan Speeds (RPM): cpu: 0
Info: Processes: 265 Uptime: 11m Memory: 15.36 GiB used: 3.19 GiB (20.8%) Init: systemd runlevel: 5 Compilers: gcc: 8.3.0
Shell: bash v: 5.0.3 inxi: 3.0.32

User avatar
sunrat
Administrator
Administrator
Posts: 6470
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 117 times
Been thanked: 474 times

Re: kern.log file is so huge in /var/log/ folder

#7 Post by sunrat »

Do you have firmware-linux package installed?
You have what appears to be Optimus graphics. Do you have Bumblebee installed? I've heard they can be suboptimal with Nouveau.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

pedronovaes
Posts: 44
Joined: 2019-08-07 17:49
Has thanked: 1 time

Re: kern.log file is so huge in /var/log/ folder

#8 Post by pedronovaes »

Do you have firmware-linux package installed?
Yes, you can see in this output:

pedro@inspiron:~$ sudo apt search firmware-linux
Sorting... Done
Full Text Search... Done
firmware-linux/stable,now 20190114-2 all [installed]
Binary firmware for various drivers in the Linux kernel (metapackage)

firmware-linux-free/stable,now 3.4 all [installed]
Binary firmware for various drivers in the Linux kernel

firmware-linux-nonfree/stable,now 20190114-2 all [installed]
Binary firmware for various drivers in the Linux kernel (meta-package)
You have what appears to be Optimus graphics. Do you have Bumblebee installed? I've heard they can be suboptimal with Nouveau.
No, I don't have Bumblebee installed. Indeed, I never used my nvidia card in this laptop.

pedro@inspiron:~$ sudo apt search bumblebee
[sudo] password for pedro:
Sorting... Done
Full Text Search... Done
bumblebee/stable 3.2.1-20 amd64
NVIDIA Optimus support for Linux

bumblebee-nvidia/stable 3.2.1-20 amd64
NVIDIA Optimus support using the proprietary NVIDIA driver

primus/stable 0~20150328-7 amd64
client-side GPU offloading for NVIDIA Optimus

pedronovaes
Posts: 44
Joined: 2019-08-07 17:49
Has thanked: 1 time

Re: kern.log file is so huge in /var/log/ folder

#9 Post by pedronovaes »

Can I delete the kern.log file? How can I prevent the file increase?

CwF
Global Moderator
Global Moderator
Posts: 2680
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 41 times
Been thanked: 196 times

Re: kern.log file is so huge in /var/log/ folder

#10 Post by CwF »

pedronovaes wrote:Can I delete the kern.log file?

Code: Select all

#cat /dev/null > kern.log

pedronovaes
Posts: 44
Joined: 2019-08-07 17:49
Has thanked: 1 time

Re: kern.log file is so huge in /var/log/ folder

#11 Post by pedronovaes »

CwF wrote:
pedronovaes wrote:Can I delete the kern.log file?

Code: Select all

#cat /dev/null > kern.log
Can this prevent the file increase?

CwF
Global Moderator
Global Moderator
Posts: 2680
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 41 times
Been thanked: 196 times

Re: kern.log file is so huge in /var/log/ folder

#12 Post by CwF »

pedronovaes wrote:Can this prevent the file increase?
No, that will preserve and zero the file. You then need to 'fix' the offending spammer.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: kern.log file is so huge in /var/log/ folder

#13 Post by Head_on_a_Stick »

I uninstall the rsyslog package and rely on systemd instead, it's much easier to limit the log sizes with that. But yes, you really should find the source of the problem rather than just remove the logs.
deadbang

Post Reply