Skip to content

, ,

Given the breadth of hardware and operating system wrinkles at play with Linux, it is all too common to see recurring and minor errors pop up about some setting or hardware snafu that really does not matter.

For my desktop computer, I was seeing log files of 2 to 4 gigs in size. Here is how I tracked this problem, discovered the cause, and found a solution (at least for the ballooning log files).

Log files

For Linux systems, there are log files that record what the system is doing all the time. For Ubuntu systems, those log files are found in the /var/log/ directory. Key log files will be:

  • boot.log
  • dmesg
  • kern.log
  • syslog
  • journalctl

Within a terminal window, you can view the most recent entries in these log files (other than journalctl, discussed below) with the following command:

$ less -r dmesg 

Note: Replace dmesg with the specific log file you want to view.

The -r option for the less command stands for displaying entries in reverse (newest entries first) order. As these files (other than journalctl) are plain text files, less is fine for displaying the contents of the files.

journalctl

With the advent of systemd, a binary log file system has been implemented. This log file is viewable (in reverse order, aka newest entries first) via this special command:

$ sudo journalctl -r

Sudo is needed, as this file is not viewable otherwise. To see all possible options for navigating journalctl, press h.

Note: the same help mechanism and nearly identical keyboard commands are also available for less.

Log errors

A recurring error will lead to mushrooming log and journalctl files — sometimes these files will suddenly be several gigabytes in size (a log file several dozen megabytes in size, on the other hand, can be normal). So, it is good practice to check the size of these files on occasion to see if they are suddenly growing to an unexpected size.

For most log files, a simple ls command in the /var/log directory will work:

/var/log$ ls
total 20M
4.0K alternatives.log        112K kern.log.4.gz
8.0K alternatives.log.1       24K lastlog
4.0K alternatives.log.10.gz  4.0K lightdm/
4.0K alternatives.log.11.gz     0 mail.err
4.0K alternatives.log.12.gz  4.0K mail.err.1
4.0K alternatives.log.2.gz   4.0K mail.err.2.gz
4.0K alternatives.log.3.gz   4.0K mail.err.3.gz
4.0K alternatives.log.4.gz   4.0K mail.err.4.gz
4.0K alternatives.log.5.gz      0 mail.log
4.0K alternatives.log.6.gz   4.0K mail.log.1
4.0K alternatives.log.7.gz   4.0K mail.log.2.gz
4.0K alternatives.log.8.gz   4.0K mail.log.3.gz
4.0K alternatives.log.9.gz   4.0K mail.log.4.gz
4.0K apt/                    8.0K oem-config.log
12K auth.log                4.0K openvpn/
52K auth.log.1                 0 pm-powersave.log
8.0K auth.log.2.gz           8.0K pm-powersave.log.1
8.0K auth.log.3.gz           4.0K pm-powersave.log.2.gz
8.0K auth.log.4.gz           4.0K pm-powersave.log.3.gz
0 boot.log                4.0K pm-powersave.log.4.gz
12K boot.log.1                 0 pm-suspend.log
24K boot.log.2               24K pm-suspend.log.1
12K boot.log.3              4.0K pm-suspend.log.2.gz
12K boot.log.4              4.0K pm-suspend.log.3.gz
24K boot.log.5              4.0K pm-suspend.log.4.gz
12K boot.log.6              4.0K private/
12K boot.log.7              4.0K speech-dispatcher/
0 btmp                    276K syslog
0 btmp.1                  2.1M syslog.1
4.0K chrony/                 1.3M syslog.2.gz
4.0K clamav/                 5.7M syslog.3.gz
4.0K cups/                   384K syslog.4.gz
4.0K dist-upgrade/           160K syslog.6.gz
96K dmesg                    88K syslog.7.gz
96K dmesg.0                  12K system76-driver.log
24K dmesg.1.gz               12K tallylog
24K dmesg.2.gz              4.0K tor/
24K dmesg.3.gz                 0 ubuntu-advantage-license-check.log
24K dmesg.4.gz                 0 ubuntu-advantage.log
28K dpkg.log                8.0K ubuntu-advantage.log.1
132K dpkg.log.1              8.0K ubuntu-advantage.log.2.gz
20K dpkg.log.10.gz          8.0K ubuntu-advantage.log.3.gz
12K dpkg.log.11.gz          8.0K ubuntu-advantage.log.4.gz
12K dpkg.log.12.gz          8.0K ubuntu-advantage.log.5.gz
12K dpkg.log.2.gz            12K ubuntu-advantage.log.6.gz
16K dpkg.log.3.gz              0 ubuntu-advantage-timer.log
12K dpkg.log.4.gz           4.0K ubuntu-advantage-timer.log.1
16K dpkg.log.5.gz           4.0K ubuntu-advantage-timer.log.2.gz
12K dpkg.log.6.gz           4.0K ubuntu-advantage-timer.log.3.gz
16K dpkg.log.7.gz           4.0K ubuntu-advantage-timer.log.4.gz
12K dpkg.log.8.gz           4.0K ubuntu-advantage-timer.log.5.gz
12K dpkg.log.9.gz           4.0K ubuntu-advantage-timer.log.6.gz
4.0K firebird/               4.0K unattended-upgrades/
12K fontconfig.log          4.0K upgrade/
4.0K gpu-manager.log         1.2M uvcdynctrl-udev.log
4.0K hp/                     948K wtmp
4.0K installer/               24K wtmp.1
4.0K journal/                 36K Xorg.0.log
76K kern.log                 68K Xorg.0.log.old
536K kern.log.1               32K Xorg.1.log
820K kern.log.2.gz            44K Xorg.1.log.old
4.8M kern.log.3.gz

Note: this file listing is with ls set as an alias to ls -Fskh. This listing of /var/log/ is with no apparent errors occurring, so this file listing is what you should expect to be “normal” output in the xubuntu world.

For journalctl, use the following command:

sudo journalctl --disk-usage

To clear up disk space with journalctl, use the –vacuum-files option, which deletes all but the specified number of journal files. For example, to retain only three files:

sudo journalctl --vacuum-files=3

Determine what the error is

Of course, a ballooning log file means there is an error of some kind that needs to be identified. Look for an entry repeating endlessly, whether an error or not. Once you have identified the problem, then you need to find the cause of the problem.

As usual, searching the web for the error you are seeing will usually lead to some answers. In my case I had a recurring error in many log and journal files. So, I searched for the recurring error I saw in one of my log files I was seeing on my desktop computer:

syslog pcieport 0000:00:1d.0: AER: Corrected error received: 0000:00:1d.0

As noted here, it is good practice to include the log file in question — syslog — as well as the actual text of the error appearing in that log file pcireport 0000 . . . when searching for clues.

Look at the results to see if others already found the error and what solution they came up

There were numerous hits from my search, and the results that explained the error were the following:

As indicated in these posts, the problem for me was a pci bus error that needed to be turned off — pcie_aspm=off. To fix the problem, based on the information in these posts, I had to edit my grub file (which runs at boot) via this command:

$ sudo emacs -nw /etc/default/grub

Based on the advice at second post above, I added pci=noaer at the end of GRUB_CMDLINE_LINUX_DEFAULT. The edited line now reads:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash pci=noaer"

After saving the changes made and exiting, grub was then updated via:

$ sudo update-grub

And then a reboot was needed for the changes to take effect.

Log files that mushroomed in size in a few days now stay withing expected file size limits. Problem solved (or at least the ballooning log files problem has been solved).

__ATA.cmd.push(function() {
__ATA.initVideoSlot(‘atatags-370373-66be8a66c24f6’, {
sectionId: ‘370373’,
format: ‘inread’
});
});

 

__ATA.cmd.push(function() {
__ATA.initDynamicSlot({
id: ‘atatags-26942-66be8a66c258c’,
location: 120,
formFactor: ‘001’,
label: {
text: ‘Advertisements’,
},
creative: {
reportAd: {
text: ‘Report this ad’,
},
privacySettings: {
text: ‘Privacy’,

}
}
});
});