I've got my mom's computer running Ubuntu 12.04 LTS. It's been working just fine but all of the sudden syslog has been filling up. And by filling up I mean I just deleted a /var/log/syslog
that was 400GB in size. Yes - Gigabytes.
While I'm sure there was some useful information in there, I'm not sure that 400GB is any kind of information to sift through. And what's really amazing about it is that it happened within a period of 8 hours - I had ran df
around noon, and between then and now her drive filled up 30% (from just under 70% to 100%).
What could be causing this and how could I fix it?`
EDIT Looks like the usb is the offender:
Sep 8 08:52:10 pamela-desktop kernel: [ 6198.157829] usb 1-3: usbfs: process 1500 (demond_nscan) did not claim interface 3 before use
Sep 8 08:52:10 pamela-desktop kernel: [ 6198.157836] usb 1-3: usbfs: process 1500 (demond_nscan) did not claim interface 3 before use
Sep 8 08:52:10 pamela-desktop kernel: [ 6198.157842] usb 1-3: usbfs: process 1500 (demond_nscan) did not claim interface 3 before use
Sep 8 08:52:10 pamela-desktop kernel: [ 6198.157849] usb 1-3: usbfs: process 1500 (demond_nscan) did not claim interface 3 before use
Sep 8 08:52:10 pamela-desktop kernel: [ 6198.157857] usb 1-3: usbfs: process 1500 (demond_nscan) did not claim interface 3 before use
Sep 8 08:52:10 pamela-desktop kernel: [ 6198.157863] usb 1-3: usbfs: process 1500 (demond_nscan) did not claim interface 3 before use
Sep 8 08:52:10 pamela-desktop kernel: [ 6198.157870] usb 1-3: usbfs: process 1500 (demond_nscan) did not claim interface 3 before use
Sep 8 08:52:10 pamela-desktop kernel: [ 6198.157877] usb 1-3: usbfs: process 1500 (demond_nscan) did not claim interface 3 before use
Sep 8 08:52:10 pamela-desktop kernel: [ 6198.157884] usb 1-3: usbfs: process 1500 (demond_nscan) did not claim interface 3 before use
Sep 8 08:52:10 pamela-desktop kernel: [ 6198.157891] usb 1-3: usbfs: process 1500 (demond_nscan) did not claim interface 3 before use
Limit the size of logrotate
Open the
/etc/logrotate.d/rsyslog
config fileThe file looks sth. like
Add e.g.
size 100k
in the parenthesis. Afterwards it should look like:Note, that this limits the file size of the rotating files, and not the actual syslog file. Save the file. The next time the logrotate chron job starts, it will limit the size of the rotated logs.
Limit the size of the current syslog
To limit the size of
/var/log/syslog
, you have to edit the/etc/rsyslog.d/50-default.conf
, and set a fixed log size.Add or modify this setting, by changing the following line in
/etc/rsyslog.d/50-default.conf
:Here an excerpt of rsyslog manual :
Here the max-size is 1MB, place this line before the
*.*; ...
lineand change the
*.*; ...
line intoRestart rsyslogd ether with
or
To look at the rsyslog status type
You should find out what is causing the large amount of messages, as if you fix this issue then you fix the large log file.
However, until then you can put in a log rotation base on one of the below.
This will already be setup on the system by default: /etc/logrotate.d/rsyslog
From this you can see that it will rotate he /var/log/syslog file daily and keep 7 copies of the rotated file.
You can change this to be rotate on a size limit, say 1mb or reduce how many copies it stores.
Warning: This will not fix the root cause of your issue, however it will buy you some time as it will stop the file system from filling up.
I had the same problem with a Lexmark Pro915 for two weeks. I did two things, and it now works fine. I reinstalled the driver. (Don't think this was what helped.) I took out the USB extension I was using which made the total length almost 15' long and which might not have been entirely compatible. I suspect that the Lexmark driver for Linux systems might be detecting a poor, or poorly timed, signal and wanting to tell you about it 10 billion times a day. Try improving your connection somehow.
Logrotate and similar solutions didn't help me. Kern.log and syslog together were logging more than 1TB a day! Logrotate might help if you could set it to run every twelve minutes.