0

I am using Ubuntu 18.04 on a HP laptop dual booted with Windows 10, with 40 GB of disk space for Ubuntu and a 20 GB of SWAP area since I have an 8 GB of RAM. I am using a HDD. Out of the 40 GB, 32.5 GB is still available and free. I have freshly installed the OS a few weeks back. The shutdown time is really short, say 5 seconds, but the time it takes to boot up goes up to 1 minute. I have edited /etc/initramfs-tools/initramfs.conf and changed MODULES=dep. This has greatly reduced time taken by initramfs. I'm not sure how else to improve it and reduce the time taken.

Boot time from systemd-analyze blame:

 23.512s dev-sda6.device
 21.462s plymouth-quit-wait.service
 18.832s systemd-udevd.service
 18.395s apparmor.service
 17.486s systemd-tmpfiles-setup.service
  6.801s NetworkManager-wait-online.service
  6.732s plymouth-start.service
  5.873s plymouth-read-write.service
  4.169s udisks2.service
  3.890s networking.service
  3.889s accounts-daemon.service
  3.013s speech-dispatcher.service
  2.573s networkd-dispatcher.service
  2.527s NetworkManager.service
  2.453s avahi-daemon.service
  2.449s thermald.service
  2.446s alsa-restore.service
  2.446s systemd-logind.service
  2.443s pppd-dns.service
  2.438s gpu-manager.service
  2.434s rsyslog.service
  2.016s apport.service
  1.426s wpa_supplicant.service
  1.388s dns-clean.service
  1.276s grub-common.service
  1.269s keyboard-setup.service
  1.056s tlp.service
  1.007s systemd-random-seed.service
   987ms packagekit.service
   896ms fwupd.service
   878ms systemd-tmpfiles-setup-dev.service
   779ms systemd-remount-fs.service
   758ms dev-mqueue.mount
   714ms sys-kernel-debug.mount
   712ms dev-hugepages.mount
   694ms systemd-modules-load.service
   590ms polkit.service
   579ms iio-sensor-proxy.service
   574ms systemd-sysctl.service
   442ms colord.service
   434ms systemd-journal-flush.service
   379ms systemd-timesyncd.service
   332ms dev-disk-by\x2duuid-72e62aa6\x2deefa\x2d49e1\x2daba3\x2d858b0e7dfbd3.swap
   330ms upower.service
   321ms systemd-journald.service
   312ms systemd-backlight@backlight:intel_backlight.service
   230ms setvtrgb.service
   217ms ufw.service
   209ms user@1000.service
   179ms systemd-resolved.service
   174ms bolt.service
   141ms gdm.service
   106ms kmod-static-nodes.service
    87ms console-setup.service
    73ms systemd-update-utmp.service
    56ms systemd-udev-trigger.service
    52ms kerneloops.service
    22ms systemd-user-sessions.service
    20ms sys-fs-fuse-connections.mount
    19ms rtkit-daemon.service
    19ms sys-kernel-config.mount
     8ms systemd-update-utmp-runlevel.service

free --human:

              total        used        free      shared  buff/cache   available
Mem:           7.7G        1.2G        5.4G        148M        1.1G        6.3G
Swap:           19G          0B         19G

Output of ls /etc/apparmor.d/:

abstractions  force-complain  tunables         usr.bin.man                           usr.lib.libreoffice.program.soffice.bin  usr.sbin.cupsd     usr.sbin.tcpdump
cache         local           usr.bin.evince   usr.lib.libreoffice.program.oosplash  usr.lib.libreoffice.program.xpdfimport   usr.sbin.ippusbxd
disable       sbin.dhclient   usr.bin.firefox  usr.lib.libreoffice.program.senddoc   usr.sbin.cups-browsed                    usr.sbin.rsyslogd

NOTE:

  • In order to improve the time taken by systemd-journal-flush.service I have reduced the MAX file size the journal flush service uses to 50M.
  • sda6 is the partition where I have installed Ubuntu on my HDD
  • I do not use Thunderbolt on my machine
  • I don't use SSD

EDIT: Added benchmark results

sudo hdparm -Tt /dev/sda :

/dev/sda:
 Timing cached reads:   11730 MB in  2.00 seconds = 5876.89 MB/sec
 Timing buffered disk reads: 322 MB in  3.00 seconds = 107.22 MB/sec

sudo hdparm -v /dev/sda :

/dev/sda:
 multcount     = 16 (on)
 IO_support    =  1 (32-bit)
 readonly      =  0 (off)
 readahead     = 256 (on)
 geometry      = 121601/255/63, sectors = 1953525168, start = 0

dd if=/dev/zero of=/tmp/output bs=8k count=10k; rm -f /tmp/output :

10240+0 records in
10240+0 records out
83886080 bytes (84 MB, 80 MiB) copied, 0.0681511 s, 1.2 GB/s

Graphical Results Image Here

  • 8
    Please don't post screenshots of text. Instead copy & paste the text here and use code formatting. – pomsky May 18 '18 at 17:59
  • 2
    Welcome to Ask Ubuntu! ;-) Please [edit] your post, remove the screenshot, add the full text of the output and add the output to sudo lshw and free --human. Please help us in helping you! :-) – Fabby May 18 '18 at 20:19
  • @EODCraftStaff - mine is taking me 1.15 mins – Praveen Kumar May 20 '18 at 00:39
  • @Fabby - I have attached the requested details – Praveen Kumar May 20 '18 at 00:39
  • I would try this over here: https://askubuntu.com/questions/1037457/slow-boot-with-ssd-and-lvm-on-new-install-of-18-04/1037962#1037962] – Dave May 20 '18 at 01:06
  • 30 seconds: is this on a HDD or SSD? Is the boot drive nearly full? Do you use Thunderbolt on your machine? What's the output of ls /etc/apparmor.d/ Mine currently is 12 seconds. @EODCraftStaff Are you using a striped/mirrored SSD? – Fabby May 20 '18 at 08:16
  • @fabby SSD Intel® Core™ i3-4150 CPU @ 3.50GHz × 4 . – EODCraft Staff May 20 '18 at 09:37
  • 5 seconds! @EODCraftStaff Is that a striped SSD? I've got an i7-7700HQ CPU @ 2.80GHz and come at 12 seconds (non-optimised) – Fabby May 20 '18 at 10:02
  • I re-timed it, it's closer to 12...Sry. Nothing I get impatient waiting on like Windoz! – EODCraft Staff May 20 '18 at 10:06
  • @Fabby , I have updated the question and made it clear. I do not use SSD. I use HDD. The boot drive has a lot of free space 32.5 GB of free space out of 40 GB. I don't use Thunderbolt. I have attached the output of ls /etc/apparmor.d/ in the description. Thanks – Praveen Kumar May 20 '18 at 11:54
  • 20GB of swap is way too much. Please update that first and then add the following lines to the file in /etc/modprobe.d/blacklist-dma.conf: blacklist firewire-core[enter] blacklist thunderbolt and then report back. @PraveenKumar . Your main problem is the 11 seconds it takes your router to get an IP address to your machine though, so I won't be able to change that without you changing your router config. – Fabby May 20 '18 at 16:14
  • @Fabby , I have reduced the SWAP to 3GB. I have tried the commands you've suggested. I also disabled apparmor and networkmanager and masked it as well. I have also removed splash/plymouth on boot. However network manager has still connected my wifi on boot. The current top time consuming processes are: 22.855s dev-sda6.device 17.390s systemd-sysctl.service 16.961s systemd-udevd.service 7.608s NetworkManager.service 6.454s udisks2.service – Praveen Kumar May 20 '18 at 19:28
  • Follow this advice and report back. don't disable apparmor, that lowers your security! – Fabby May 20 '18 at 20:19
  • @Fabby , I have renabled AppArmor. I have also performed the benchmark tests and attached the results above in the edits. Thanks for the help! – Praveen Kumar May 21 '18 at 03:58

0 Answers0