2

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:

enter image description here

Disks smart data & self tests:

enter image description here

Any tips from where to start and what should I do will help me out.

Zanna
  • 70,465
M.A.K. Ripon
  • 3,139
  • 1
    Looks like you are spending about one minute simply mounting your disks. Check your /etc/fstab and verify that every automounted UUIDs is correct. – user535733 Apr 17 '20 at 16:44
  • @user535733 added that details can you please identify the problem for me. – M.A.K. Ripon Apr 17 '20 at 17:48
  • 1
  • 1
    Your /etc/fstab looks OK. I would however recommend running a filesystem check and fixing errors. – Raffa Apr 17 '20 at 19:28
  • 1
    Also to be on the safe side, check your UUID by running sudo blkid and compare it to your /etc/fstab entry. Make sure they match or otherwise update the /etc/fstab entry. – Raffa Apr 17 '20 at 19:41
  • 1
    Where is your swap? – heynnema Apr 17 '20 at 20:11
  • @Raffa I added sudo blkid can you clear me out what should I check please. – M.A.K. Ripon Apr 18 '20 at 12:38
  • @heynnema I've added swap details for you. please can you help me anything from it. – M.A.K. Ripon Apr 18 '20 at 12:44
  • Ah! I think I see your problem. Edit your question and show me a screenshot of gparted, and output of ls -al /swapfile. – heynnema Apr 18 '20 at 13:34
  • @heynnema from ls -al /swapfile output isls: cannot access '/swapfile': No such file or directory and GParted image is now given. thanks for your help. – M.A.K. Ripon Apr 18 '20 at 14:01
  • 1
    Do not use 0 for grub, set ot 2 or 3 sec so if you have to get to grub menu you can. With 0 you cannot get to grub menu in an emergency. Slow boot issues see: https://askubuntu.com/questions/1187117/slow-boot-boot-19-10-tried-almost-everything & https://askubuntu.com/questions/1018576/what-does-networkmanager-wait-online-service-do & https://askubuntu.com/questions/800479/ubuntu-16-04-slow-boot-apt-daily-service – oldfred Apr 18 '20 at 14:22
  • @M.A.K.Ripon Please see my answer. If it's helpful, please remember to accept it by clicking on the checkmark icon that appears just to the left of my answer. Thanks! – heynnema Apr 18 '20 at 14:26
  • If your root partition is /dev/sda3 then th UUID looks correct and you do not need to do anything in this regard. Best option is to follow the links I provided above and disable the suggested services. Start with disabling NetworkManager-wait-online.service then reboot and see how it goes. – Raffa Apr 18 '20 at 19:00

2 Answers2

1

Run systemd-analyze blame and you will see which applications/programs are taking how much time at startup.

  • I've already given that report. Please can you go through that report and suggest me where to look and which part need to be solved. thanks for the help. – M.A.K. Ripon Apr 17 '20 at 16:23
1

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.

heynnema
  • 70,711