2

Appreciate any help. Very slow boot on Ubuntu 16.04.3 with SSD still. when I run

    systemd-analyze blame

I get

    40.044s snapd.refresh.service
     29.529s apt-daily.service
      6.510s NetworkManager-wait-online.service
      2.469s apt-daily-upgrade.service
      1.814s snapd.service
      1.649s tor@default.service
       936ms dev-sda2.device
       168ms ufw.service
       131ms ModemManager.service
       126ms lightdm.service
        86ms swapfile.swap
        83ms apport.service
        81ms systemd-fsck@dev-disk-by\x2duuid-BE45\x2d57DB.service
        78ms dev-loop0.device
        77ms speech-dispatcher.service
        71ms snap-core-2844.mount
        69ms alsa-restore.service
        69ms lm-sensors.service
        65ms pppd-dns.service
        64ms apparmor.service
        64ms rsyslog.service
        63ms accounts-daemon.service
        63ms systemd-user-sessions.service

when I run

    snap list

I get

    Name                        Version        Rev   Developer       Notes
    core                        16-2.27.6      2898  canonical       core
    keepassxc                   2.2.0          23    keepassxreboot  -
    ufw                         0.36pre-16.10  14    canonical       -
    ultimate-media-downloader2  1              1     keshavnrj       -

I am not familiar with snap or what to do. Can I disable or edit

     40.044s snapd.refresh.service
     29.529s apt-daily.service
      6.510s NetworkManager-wait-online.service

to make my boot faster? Appreciate any help beacuse my boot feels very slow. {But after the slow boot is completed the ssd does feel snappier inside Ubuntu,and I already am on AHCI boot mode in BIOS}. Please help. Appreciate any guidance.

Update 1:

Boot still takes over 1.5 minutes. I tried all this and still no change and boot very slow. I did

    sudo systemctl disable snapd.refresh.service
    sudo systemctl disable NetworkManager-wait-online.service

Run sudoedit /etc/rc.local and added this before line with exit 0 :

    rfkill block bluetooth

and I have tried this also

    sudo systemctl edit apt-daily.timer 

and pasted the following text into the editor window:

   # apt-daily timer configuration override
   [Timer]
   OnBootSec=15min
   OnUnitActiveSec=1d
   AccuracySec=1h
   RandomizedDelaySec=30min

But my boot is still very slow takes over 1.5 minutes. Now when I run systemd-analyze blame I get

     1.503s snapd.service
      1.246s tor@default.service
       989ms virtualbox.service
       872ms dev-sda2.device
       674ms systemd-rfkill.service
       455ms dev-loop3.device
       149ms snap-core-2844.mount
       126ms lightdm.service
       119ms snap-core-2898.mount
       107ms accounts-daemon.service
       102ms apparmor.service
       100ms snap-core-2774.mount
        98ms ufw.service
        97ms ModemManager.service
        92ms snap-ufw-14.mount
        86ms systemd-fsck@dev-disk-by\x2duuid-BE45\x2d57DB.service
        86ms grub-common.service
        85ms swapfile.swap
        68ms plymouth-quit-wait.service
        59ms console-setup.service
        56ms preload.service
        54ms irqbalance.service
        52ms apport.service

But when I run systemd-analyze I get Startup finished in 5.179s (firmware) + 2.884s (loader) + 8.072s (kernel) + 3min 504ms (userspace) = 3min 16.641s

Boot is still very slow. Says my (userspace) takes 3mins? 3min 504ms (userspace) = 3min 16.641s Any advice please? (I am on SSD with noatime,trim and AHCI all already set).

Update 2:

When I run cat /var/log/syslog it goes crazy too fast I can't copy it but it is repeating same thing. So I run less /var/log/syslog I get

    Sep 25 07:30:04 jon kernel: [  473.457872] pcieport 0000:00:1c.2:   device [8086:a112] error status/mask=00000001/00002000
    Sep 25 07:30:04 jon kernel: [  473.457873] pcieport 0000:00:1c.2:    [ 0] Receiver Error         (First)
    Sep 25 07:30:04 jon kernel: [  473.457876] pcieport 0000:00:1c.2: AER: Corrected error received: id=00e2
    Sep 25 07:30:04 jon kernel: [  473.458511] pcieport 0000:00:1c.2: can't find device of ID00e2
    Sep 25 07:30:04 jon kernel: [  473.458574] pcieport 0000:00:1c.2: AER: Corrected error received: id=00e2
    Sep 25 07:30:04 jon kernel: [  473.458577] pcieport 0000:00:1c.2: PCIe Bus Error: severity=Corrected, type=Physical Layer, id=00e2(Receiver ID)
    Sep 25 07:30:04 jon kernel: [  473.458579] pcieport 0000:00:1c.2:   device [8086:a112] error status/mask=00000001/00002000Sep 25 07:30:04 jon kernel: [  473.458580] pcieport 0000:00:1c.2:    [ 0] Receiver Error         (First)
    Sep 25 07:30:04 jon kernel: [  473.460512] pcieport 0000:00:1c.2: AER: Corrected error received: id=00e2
    Sep 25 07:30:04 jon kernel: [  473.460515] pcieport 0000:00:1c.2: PCIe Bus Error: severity=Corrected, type=Physical Layer, id=00e2(Receiver ID)
    Sep 25 07:30:04 jon kernel: [  473.460518] pcieport 0000:00:1c.2:   device [8086:a112] error status/mask=00000001/00002000

(Additional information: Before I realized my logs (with thousands of pcie Bus error logs) were taking over 100Gb (!) space of my 250Gb SSD. Now I used logrotate and limited logs to 100M and set logrotate to run daily and my disk usage has gone from 180Gb to 80Gb.)

I know the pcie Bus error is a know bug. So is that what is delaying my boot? Appreciate advice.

Update 3

When I run lspci I get

    00:00.0 Host bridge: Intel Corporation Device 5910 (rev 05)
    00:01.0 PCI bridge: Intel Corporation Sky Lake PCIe Controller (x16) (rev 05)
    00:02.0 VGA compatible controller: Intel Corporation Device 591b (rev 04)
   00:04.0 Signal processing controller: Intel Corporation Skylake Processor Thermal Subsystem (rev 05)
   00:14.0 USB controller: Intel Corporation Sunrise Point-H USB 3.0 xHCI Controller (rev 31)
   00:14.2 Signal processing controller: Intel Corporation Sunrise Point-H Thermal subsystem (rev 31)
   00:15.0 Signal processing controller: Intel Corporation Sunrise Point-H LPSS I2C Controller #0 (rev 31)
  00:15.1 Signal processing controller: Intel Corporation Sunrise Point-H LPSS I2C Controller #1 (rev 31)
  00:16.0 Communication controller: Intel Corporation Sunrise Point-H CSME HECI #1 (rev 31)
  00:17.0 SATA controller: Intel Corporation Sunrise Point-H SATA Controller [AHCI mode] (rev 31)
  00:1c.0 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #1 (rev f1)
  00:1c.2 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #3 (rev f1)
  00:1c.3 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #4 (rev f1)
  00:1f.0 ISA bridge: Intel Corporation Sunrise Point-H LPC Controller (rev 31)
  00:1f.2 Memory controller: Intel Corporation Sunrise Point-H PMC (rev 31)
  00:1f.3 Audio device: Intel Corporation Device a171 (rev 31)
  00:1f.4 SMBus: Intel Corporation Sunrise Point-H SMBus (rev 31)
  01:00.0 3D controller: NVIDIA Corporation GM107M [GeForce GTX 950M] (rev a2)
  03:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8723BE PCIe Wireless Network Adapter
  04:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. Device 5287 (rev 01)
  04:00.1 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 12)

Update 4

I happened to try the workaround from AER: Corrected error received PCIe Bus Error

"Current workaround is to add pci=noaer to your kernel command line:

  1. edit /etc/default/grub and and add pci=noaer to the line starting with GRUB_CMDLINE_LINUX_DEFAULT. It will look like this: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash pci=noaer"
  2. run sudo update-grub
  3. reboot"

That worked in stopping the syslog from being flooded and spammed with the pcieport 0000:00:1c.2: AER: Corrected error received: id=00e2 messages.

Thats great. I don't see those error messages on boot anymore either.

But my boot start-up time is still 90 seconds.

When I now run systemd-analyze I get

Startup finished in 6.232s (firmware) + 3.306s (loader) + 8.247s (kernel) + 3min 551ms (userspace) = 3min 18.337s still.

I am on Asus laptop model X550V i7-7700HQ Skylake cpu (with Geforce GTX Nividia 950M on Samsung 850 Evo 250Gb SSD) on Kernel 4.13.3-041303-generic. I had the same problem on 4.10.0-35 kernel so thats why I switched to 4.13 kernel to see if there was any improvement, but it is same issue still slow boot.

Do I still need to add pci=nomsi to Grub also as suggested in comments below, if I don't have the pcie buss error messages anymore?

Will that help my still slow boot time?

`

Kulfy
  • 17,696

2 Answers2

2

I went through a similar (although not as drastic) experience.

From the terminal you need to use:

sudo systemctl disable snapd.refresh.service
sudo systemctl disable NetworkManager-wait-online.service

If you aren't using snapd disabling it isn't a problem. As per my own experience disabling NetworkManager-wait-online-service during boot isn't a problem.

As far as apt-daily.service goes it's a known bug. It wasn't designed to be run during boot but fifteen minutes into your session. There are a couple of different answers to that problem but as I've never encountered it cannot say which is better. (I would go with the one with the most upvotes though).

Although SSD boot took my time from 45 seconds to 11 seconds, I'm sorry you bought one thinking it would solve this particular problem. You'll still enjoy it though because applications will load in a few seconds instead of 15 seconds.

  • Before I proceed will disabling snapd.refresh.service in boot affect the items supposed to be in my aforementioned "snap list" (i.e. core, keepassxc,ufc, ultimate-media-downloader2)? I don't recall using snapd ever so I am not sure how those items got in the snap list... – jon anotter88998889 Sep 24 '17 at 06:26
  • @jonanotter88998889 removing the snapd refresh service doesn't delete any programs (snaps) rather it stops them from being auto-updated during boot. Later on you will still need to remove the snaps from your system if you truly don't want them. If you do want them updated then you'll need to set them up to refresh 15 to 45 minutes after boot like apt-daily-refresh service. – WinEunuuchs2Unix Sep 24 '17 at 06:45
  • yes i installed 'keepassxc' and 'ufc' the firewall gui via the Ubuntu Software app...I was not aware it was therefore installed by snapd. Strange that all the other apps I installed via the Ubuntu Software app are not included in the list when I run in terminal 'snap list' .. – jon anotter88998889 Sep 24 '17 at 06:49
  • @jonanotter88998889 snaps are just another way of installing programs. However most conventional programs like word processors, spreadsheets, web browsers, file managers, games and utilities are still installed the same way with sudo apt install via the terminal or behind the scenes using that command via the software center GUI. See this bug report: https://askubuntu.com/questions/801077/disable-snapd-refresh-service-on-16-04-to-speed-up-boot-no-snap-packages-in-use – WinEunuuchs2Unix Sep 24 '17 at 06:52
  • I tried the code you suggested to disable snapd.refresh.service NetworkManager-wait-online.service but my boot time is still slow 90 seconds... – jon anotter88998889 Sep 25 '17 at 06:10
  • @jonanotter88998889 We need to review /var/log/syslog that contains the time each program starts up to see which one is taking up the 90 seconds or so. – WinEunuuchs2Unix Sep 25 '17 at 10:28
  • @WinEunuuchsUnix I updated info /var/log/syslog as you requested. – jon anotter88998889 Sep 25 '17 at 12:05
  • Simply edit sysllog with your favorite editor and scroll through it to find time gaps larger than a few seconds. Then paste that section. – WinEunuuchs2Unix Sep 25 '17 at 12:35
  • basically my whole syslog is: kernel: [ 473.256784] pcieport 0000:00:1c.2: PCIe Bus Error: severity=Corrected, type=Physical Layer, id=00e2(Receiver ID) and kernel: [ 1071.824530] pcieport 0000:00:1c.2: [ 0] Receiver Error (First) Sep 25 07:40:03 jon kernel: [ 1071.838974] pcieport 0000:00:1c.2: AER: Multiple Corrected error received: id=00e2 it is repeated thousands of times non-stop. even in boot-up process and shutdown I see it briefly.I have conky showing my syslog and it is non-stop every second same pcie bus error. (I am using i7 -7700HQ Skylake CPU on Asus x550V). – jon anotter88998889 Sep 25 '17 at 13:53
  • What brand/model system? Some need boot parameter. Asus x555u w/o pci=nomsi - space issue on drive and runaway log files filling drive https://ubuntuforums.org/showthread.php?t=2327103&page=3 & https://ubuntuforums.org/showthread.php?t=2327570 – oldfred Sep 25 '17 at 15:13
  • @jonanotter88998889 Sorry I didn't notice the lines were repeating when at first glance. As oldfred says, there is a bug report on this from 2015. Follow the instructions in Fred's links or the bug report if better. Fred thanks for jumping in with your wealth of knowledge. – WinEunuuchs2Unix Sep 25 '17 at 22:57
  • update 4 added above. TL DRI triedpci=noaerbefore I saw your comments and that workaround happened to stop thePCIe Bus ErrorandAER: Corrected error receivedmessages...syslog` not flooded anymore....but boot still at least 90 seconds. – jon anotter88998889 Sep 26 '17 at 03:26
  • Solved. Appreciate all the help. – jon anotter88998889 Sep 26 '17 at 05:02
2

[SOLVED]

After trying all of the above and thus fixing the PCIe Bus Error and AER Corrected error recieved messages that were flooding my syslog , and after using`

sudo systemctl disable snapd.refresh.service
sudo systemctl disable NetworkManager-wait-online.service

as suggested above to remove more boot time, my boot was still 80 or so seconds.

Then I noticed when I ran less /var/log/syslog this error also in my syslog

    systemd[1]: Dependency failed for Cryptography Setup for cryptswap1.
    systemd[1]: Dependency failed for dev-mapper-cryptswap1.device.

Seems my boot was also looking for cryptswap which I replaced with a swapfile a while ago. I missed that error thanks to the PCIe Bus Error and AER error messages that were flooding my syslog and that was taking up almost 100Gb of my disk space (!)

The final solution here on removing cryptswap and How to disable Crytswap following this explanation.

Seems I had already commented out the cryptswap1 line in fstab which was not in use, but had not yet commented out the line in /etc/crypttab .so I did as follows;

    sudo cryptsetup remove /dev/mapper/cryptswap1
    sudo vim /etc/crypttab
    *comment out the `cryptswap1 UUID= .... ` line*

now my boot is 10-15 seconds! Appreciate all the help.