How do I troubleshoot a slow boot?
I'm getting very slow boot, can't find out the exact reason but dmesg
shows apparmor profile loading is eating most of the time. I'm not sure its really making it or something else are reason behind. I've Dual boot Windows 10 & Ubuntu 18.04, but I've removed Windows and formatted the Windows drive completely because of the slow boot. Still it takes a minute or 2-3 to start.
Specifications:
OS: Ubuntu 18.04.4 LTS 64-bit with GNOME 3.28.2
RAM: 7.7 GiB
CPU: [Intel® Pentium(R) CPU G3250 @ 3.20GHz][1] × 2
GPU: AMD® Cedar
systemd-analyze time
~$ systemd-analyze time
Startup finished in 4.106s (kernel) + 1min 32.843s (userspace) = 1min 36.950s
graphical.target reached after 52.928s in userspace
Ubuntu Boot dmesg report here
systemd-analyze blame
systemd-analyze critical-chain
My Grub File details:
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'
GRUB_DISABLE_OS_PROBER="true"
GRUB_DEFAULT="Ubuntu"
GRUB_TIMEOUT_STYLE="hidden"
GRUB_TIMEOUT="0"
GRUB_DISTRIBUTOR="`lsb_release -i -s 2> /dev/null || echo Debian`"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash noresume"
GRUB_CMDLINE_LINUX=""
# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL="console"
# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE="640x480"
# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID="true"
# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"
# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
GRUB_SAVEDEFAULT="false"
/etc/fstab
file details
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda3 during installation
UUID=5d29f3ec-aff8-4903-ab70-b7f58471af1c / ext4 errors=remount-ro 0 1
sudo blkid
output details:
/dev/loop0: TYPE="squashfs"
/dev/loop1: TYPE="squashfs"
/dev/loop2: TYPE="squashfs"
/dev/loop3: TYPE="squashfs"
/dev/loop4: TYPE="squashfs"
/dev/loop5: TYPE="squashfs"
/dev/loop6: TYPE="squashfs"
/dev/loop7: TYPE="squashfs"
/dev/sda1: LABEL="System Reserved" UUID="08A428FBA428ED3E" TYPE="ntfs" PARTUUID="f066e382-01"
/dev/sda2: LABEL="New Born" UUID="1DFD554150872322" TYPE="ntfs" PTTYPE="dos" PARTUUID="f066e382-02"
/dev/sda3: UUID="5d29f3ec-aff8-4903-ab70-b7f58471af1c" TYPE="ext4" PARTUUID="f066e382-03"
/dev/sda5: LABEL="Free To Destroy" UUID="84C49E2AC49E1F0C" TYPE="ntfs" PARTUUID="f066e382-05"
/dev/sda6: LABEL="Talk With Ripon First" UUID="E642D35F42D33353" TYPE="ntfs" PARTUUID="f066e382-06"
/dev/sda7: LABEL="Mail" UUID="4418BE5E18BE4F24" TYPE="ntfs" PARTUUID="f066e382-07"
/dev/loop8: TYPE="squashfs"
/dev/loop9: TYPE="squashfs"
/dev/loop10: TYPE="squashfs"
/dev/loop11: TYPE="squashfs"
/dev/loop12: TYPE="squashfs"
/dev/loop13: TYPE="squashfs"
/dev/loop14: TYPE="squashfs"
/dev/loop15: TYPE="squashfs"
swap
details:
free -m
total used free shared buff/cache available
Mem: 7920 2470 2986 213 2463 4967
Swap: 0 0 0
GParted Screen capture:
Disks smart data & self tests:
Any tips from where to start and what should I do will help me out.
Run systemd-analyze blame
and you will see which applications/programs are taking how much time at startup.
It seems that you're missing a /swapfile or swap partition...
free -m
total used free shared buff/cache available
Mem: 7920 2470 2986 213 2463 4967
Swap: 0 0 0
Let's create a /swapfile...
In terminal
...
Note: Incorrect use of the dd
command can cause data loss. Suggest copy/paste.
Note: Since you don't have a /swapfile, the first two commands might show an error.
sudo swapoff -a # turn off swap
sudo rm -i /swapfile # remove old /swapfile
sudo dd if=/dev/zero of=/swapfile bs=1M count=4096
sudo chmod 600 /swapfile # set proper file protections
sudo mkswap /swapfile # init /swapfile
sudo swapon /swapfile # turn on swap
free -h # confirm 8G RAM and 4G swap
Add this line to /etc/fstab
...
/swapfile none swap sw 0 0
Then reboot and confirm proper operation.