5

I have following configuration installed on my system,

mercurial@providence:~$ neofetch
       _,met$$$$$gg.          mercurial@providence 
    ,g$$$$$$$$$$$$$$$P.       -------------------- 
  ,g$$P"     """Y$$.".        OS: Debian GNU/Linux 10 (buster) x86_64 
 ,$$P'              `$$$.     Host: XPS L501X A08 
',$$P       ,ggs.     `$$b:   Kernel: 4.19.0-6-amd64 
`d$$'     ,$P"'   .    $$$    Uptime: 7 mins 
 $$P      d$'     ,    $$P    Packages: 2883 (dpkg) 
 $$:      $$.   -    ,d$$'    Shell: bash 5.0.3 
 $$;      Y$b._   _,d$P'      Resolution: 1366x768 
 Y$$.    `.`"Y$$$$P"'         DE: MATE 
 `$$b      "-.__              WM: Metacity (Marco) 
  `Y$$                        WM Theme: TraditionalOk 
   `Y$$.                      Theme: Clearlooks [GTK2/3] 
     `$$b.                    Icons: gnome [GTK2/3] 
       `Y$$b.                 Terminal: mate-terminal 
          `"Y$b._             Terminal Font: Monospace 10 
              `"""            CPU: Intel i5 M 460 (4) @ 2.534GHz 
                              GPU: NVIDIA GeForce GT 420M 
                              GPU: Intel Core Processor 
                              Memory: 1062MiB / 3683MiB 




mercurial@providence:~$ uname -a
Linux providence 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u1 (2019-09-20) x86_64 GNU/Linux

Now the problem is system is taking way too long to boot, following is the startup plot.

mercurial@providence:~$ systemd-analyze
Startup finished in 38.520s (kernel) + 26.496s (userspace) = 1min 5.017s 
graphical.target reached after 26.478s in userspace

https://svgshare.com/i/FNK.svg

I tried to fix some of the stuff but couldn't get to the depth of it.

My boot log is as follows,

Gave up waiting for suspend/resume device
Debian: clean, 934549/7528448 files, 9966424/30091008 blocks
[  OK  ] Started Set console font and keymap.
[  OK  ] Started Tell Plymouth To Write Out Runtime Data.
[  OK  ] Started Create Volatile Files and Directories.
         Starting Update UTMP about System Boot/Shutdown...
         Starting Network Time Synchronization...
[  OK  ] Started Update UTMP about System Boot/Shutdown.
[  OK  ] Started udev Kernel Device Manager.
         Starting Show Plymouth Boot Screen...
[  OK  ] Started Load AppArmor profiles.
         Starting Raise network interfaces...
[  OK  ] Started Show Plymouth Boot Screen.
[  OK  ] Reached target Local Encrypted Volumes.
[  OK  ] Started Forward Password Requests to Plymouth Directory Watch.
[  OK  ] Started Network Time Synchronization.
[  OK  ] Reached target System Time Synchronized.
[  OK  ] Created slice system-systemd\x2dbacklight.slice.
         Starting Load/Save Screen Backlight Brightness of backlight:intel_backlight...
[  OK  ] Started Load/Save Screen Backlight Brightness of backlight:intel_backlight.
[  OK  ] Started Raise network interfaces.
         Starting Load/Save Screen Backlight Brightness of leds:dell::kbd_backlight...
[  OK  ] Listening on Load/Save RF Kill Switch Status /dev/rfkill Watch.
[  OK  ] Started Load/Save Screen Backlight Brightness of leds:dell::kbd_backlight.
         Starting Load/Save RF Kill Switch Status...
[  OK  ] Started Load/Save RF Kill Switch Status.
         Starting Show Plymouth Boot Screen...
         Starting Tell Plymouth To Write Out Runtime Data...
[  OK  ] Started Tell Plymouth To Write Out Runtime Data.
[  OK  ] Started Show Plymouth Boot Screen.
         Starting Tell Plymouth To Write Out Runtime Data...
         Starting Show Plymouth Boot Screen...
[  OK  ] Started Tell Plymouth To Write Out Runtime Data.
[  OK  ] Started Show Plymouth Boot Screen.
[  OK  ] Found device ST9500420AS 7.
         Activating swap /dev/disk/by-uuid/c0198c37-f28b-41f5-bb0f-37d575e86896...
[  OK  ] Activated swap /dev/disk/by-uuid/c0198c37-f28b-41f5-bb0f-37d575e86896.
[  OK  ] Reached target Swap.
[  OK  ] Reached target System Initialization.
[  OK  ] Started Trigger anacron every hour.
[  OK  ] Listening on Avahi mDNS/DNS-SD Stack Activation Socket.
[  OK  ] Listening on CUPS Scheduler.
[  OK  ] Started Daily Cleanup of Temporary Directories.
[  OK  ] Started Daily apt download activities.
[  OK  ] Started CUPS Scheduler.
[  OK  ] Reached target Paths.
[  OK  ] Listening on D-Bus System Message Bus Socket.
[  OK  ] Started Daily rotation of log files.
[  OK  ] Started Daily man-db regeneration.
[  OK  ] Listening on UUID daemon activation socket.
[  OK  ] Reached target Sockets.
[  OK  ] Reached target Basic System.
[  OK  ] Started CUPS Scheduler.
[  OK  ] Started Manage Sound Card State (restore and store).
         Starting Save/Restore Sound Card State...
         Starting System Logging Service...
[  OK  ] Started Run anacron jobs.
         Starting Bluetooth service...
         Starting Avahi mDNS/DNS-SD Stack...
[  OK  ] Started Regular background program processing daemon.
         Starting Modem Manager...
         Starting Accounts Service...
         Starting Restore /etc/resolv.conf if the system crashed before the ppp link was shut down...
         Starting Deferred execution scheduler...
         Starting Disk Manager...
[  OK  ] Started D-Bus System Message Bus.
         Starting Network Manager...
         Starting WPA supplicant...
         Starting Login Service...
[  OK  ] Started Daily apt upgrade and clean activities.
[  OK  ] Reached target Timers.
[  OK  ] Started System Logging Service.
[  OK  ] Started Save/Restore Sound Card State.
[  OK  ] Started Restore /etc/resolv.conf if the system crashed before the ppp link was shut down.
[  OK  ] Started Deferred execution scheduler.
[  OK  ] Started Login Service.
[  OK  ] Started WPA supplicant.
[  OK  ] Started Avahi mDNS/DNS-SD Stack.
[  OK  ] Started Bluetooth service.
[  OK  ] Reached target Bluetooth.
[  OK  ] Started Make remote CUPS printers available locally.
[  OK  ] Reached target Sound Card.
         Starting Authorization Manager...
         Starting Hostname Service...
[  OK  ] Started Network Manager.
         Starting Network Manager Wait Online...
[  OK  ] Reached target Network.
         Starting Permit User Sessions...
[  OK  ] Started Unattended Upgrades Shutdown.
[  OK  ] Started Permit User Sessions.
         Starting Hold until boot process finishes up...
         Starting Light Display Manager...
[  OK  ] Started Hostname Service.
         Starting Network Manager Script Dispatcher Service...
[  OK  ] Started Network Manager Script Dispatcher Service.
[  OK  ] Started Authorization Manager.
[  OK  ] Started Accounts Service.

Note that i searched something for that GAVE UP WAITING FOR... and someone directed towards this,

mercurial@providence:~$ sudo update-initramfs -u -k all
update-initramfs: Generating /boot/initrd.img-4.19.0-6-amd64
cryptsetup: ERROR: Couldn't resolve device 
    UUID=fee92c6d-7b60-4014-a66b-c48cd9094162
cryptsetup: WARNING: The initramfs image may not contain cryptsetup binaries 
    nor crypto modules. If that's on purpose, you may want to uninstall the 
    'cryptsetup-initramfs' package in order to disable the cryptsetup initramfs 
    integration and avoid this warning.
W: Possible missing firmware /lib/firmware/nvidia/gv100/acr/ucode_load.bin for module nouveau
I: The initramfs will attempt to resume from /dev/sda7
I: (UUID=c0198c37-f28b-41f5-bb0f-37d575e86896)
I: Set the RESUME variable to override this.
update-initramfs: Generating /boot/initrd.img-4.19.0-5-amd64
cryptsetup: ERROR: Couldn't resolve device 
    UUID=fee92c6d-7b60-4014-a66b-c48cd9094162
cryptsetup: WARNING: The initramfs image may not contain cryptsetup binaries 
    nor crypto modules. If that's on purpose, you may want to uninstall the 
    'cryptsetup-initramfs' package in order to disable the cryptsetup initramfs 
    integration and avoid this warning.
W: Possible missing firmware /lib/firmware/nvidia/gv100/acr/ucode_load.bin for module nouveau
I: The initramfs will attempt to resume from /dev/sda7
I: (UUID=c0198c37-f28b-41f5-bb0f-37d575e86896)
I: Set the RESUME variable to override this.

That /dev/sda7 is my swap file.

mercurial@providence:~$ sudo fdisk -l
Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Disk model: ST9500420AS     
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xc8000000

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1  *         2048    206847    204800   100M  7 HPFS/NTFS/exFAT
/dev/sda2          206848 170128349 169921502    81G  7 HPFS/NTFS/exFAT
/dev/sda3       170144408 337927335 167782928    80G  7 HPFS/NTFS/exFAT
/dev/sda4       337930238 976769023 638838786 304.6G  f W95 Ext'd (LBA)
/dev/sda5       337930240 727652351 389722112 185.9G 83 Linux
/dev/sda6       727654400 968382463 240728064 114.8G 83 Linux
/dev/sda7       968384512 976769023   8384512     4G 82 Linux swap / Solaris


mercurial@providence:~$ ls -la /dev/disk/by-uuid
total 0
drwxr-xr-x 2 root root 160 Oct  7 23:45 .
drwxr-xr-x 7 root root 140 Oct  7 23:45 ..
lrwxrwxrwx 1 root root  10 Oct  7 23:46 129C98019C97DE13 -> ../../sda3
lrwxrwxrwx 1 root root  10 Oct  7 23:46 3D9D2B1C080C3A89 -> ../../sda2
lrwxrwxrwx 1 root root  10 Oct  7 23:46 480488312682F440 -> ../../sda1
lrwxrwxrwx 1 root root  10 Oct  7 23:46 aec68856-488a-4c50-aa05-01af59b3ae0b -> ../../sda6
lrwxrwxrwx 1 root root  10 Oct  7 23:46 c0198c37-f28b-41f5-bb0f-37d575e86896 -> ../../sda7
lrwxrwxrwx 1 root root  10 Oct  7 23:46 d96d4546-92a2-49bf-b9d0-c00348d42395 -> ../../sda5

How can i boot faster, maybe in less than 10 seconds perharps?

3
  • 1
    Check systemd-analyze blame and systemd-analyze critical-chain
    – GAD3R
    Oct 7, 2019 at 18:45
  • It may have some delay but if its not an SSD 1 minute doesnt seem terribly slow.
    – john doe
    Oct 7, 2019 at 18:49
  • I have attached whole plot here also in the question, In userspace network manager and swap takes some time, but even my kernel is loading in 38 seconds. sudo update-initramfs -u -k all displays some error about missing UUID, which was previously UUID of my swap, which got changed when i installed another OS.
    – Mercurial
    Oct 7, 2019 at 18:49

3 Answers 3

2

I had the same issue, basically UUID's got mixed up after disabling and deleting my swap inside a virtualbox. This caused timeout issues and dependency failures, and it forced a file system check on each boot. I had to update my UUIDs accordingly.

If a swap partition is deleted (e.g. on purpose when migrating from HD to SSD), the file /etc/initramfs-tools/conf.d/resume should be either completely empty or read RESUME=. Delete any UUID number. RESUME=NONE is not valid. Whether or not you are using a swap the fix is in see below:

For troubleshooting (optional):

sudo cat /var/log/boot.log

List correct partition UUIDS:

sudo blkid -c /dev/null -o list

Make sure the following three files have the correct UUID set as listed by blkid, overwrite them with the correct UUID:

/etc/fstab                                      [for me swap was incorrect]
/etc/default/grub                               [for me RESUME=UUID was incorrect]
/boot/grub/grub.cfg                             [for me RESUME=UUID was incorrect]

Then update Initial Ram File-System:

update-initramfs -u

Editing the three files above also permanently solved my cryptsetup: error: couldn't resolve device errors when running update-initramfs

This should prevent the need of adding the UUID to /etc/initramfs-tools/conf.d/resume, however, in the case that you still have an issue consider adding a UUID for example: RESUME=UUID=c0198c37-f28b-41f5-bb0f-37d575e86896, or set RESUME= if you are using no swap file.

Then run:

update-initramfs -u

Also make sure /etc/default/grub has set to GRUB_TIMEOUT=0, to speed up boot process. After everything I describe here, it performed one final filesystem check on boot but but after that it booted in 10 seconds instead of 1 minute and 30 seconds.

1
mercurial@providence:~$ systemd-analyze
Startup finished in 7.913s (kernel) + 20.621s (userspace) = 28.534s 
graphical.target reached after 20.605s in userspace

enter image description here

This is what i have achieved after rectifying some of the problems. As you can see the startup time gradually decreases from 1 min 5 sec to 28 secs.

1. sudo update-initramfs -u -k all : Kernel Time

This was screaming at top of its lungs that i was trying to resume from a device which was not to be found, i.e. i had a resume block in my grub.cfg

cryptsetup: ERROR: Couldn't resolve device 
    UUID=fee92c6d-7b60-4014-a66b-c48cd9094162

This is just a bug,

cryptsetup: WARNING: The initramfs image may not contain cryptsetup binaries 
    nor crypto modules. If that's on purpose, you may want to uninstall the 
    'cryptsetup-initramfs' package in order to disable the cryptsetup initramfs 
    integration and avoid this warning.

And this nice line of code was asking me to declare the new swap partition so my system can resume from it,

I: The initramfs will attempt to resume from /dev/sda7
I: (UUID=c0198c37-f28b-41f5-bb0f-37d575e86896)
I: Set the RESUME variable to override this.

And so i did,

mercurial@providence:~$ cat /etc/initramfs-tools/conf.d/resume
RESUME=UUID=c0198c37-f28b-41f5-bb0f-37d575e86896

2. systemd-analyze blame : Userspace Time

My network manager was taking some time to come online, so all i had to do is mask it.

sudo systemctl mask NetworkManager-wait-online.service

RESULTS

Now i am down to 28 seconds boot time and following are my blame and critical chain,

mercurial@providence:~$ systemd-analyze critical-chain
The time after the unit is active or started is printed after the "@" character.
The time the unit takes to start is printed after the "+" character.

graphical.target @20.605s
└─udisks2.service @9.969s +10.636s
  └─basic.target @9.515s
    └─sockets.target @9.515s
      └─dbus.socket @9.515s
        └─sysinit.target @9.333s
          └─swap.target @9.333s
            └─dev-disk-by\x2duuid-c0198c37\x2df28b\x2d41f5\x2dbb0f\x2d37d575e86896.swap @8.843s +490ms
              └─dev-disk-by\x2duuid-c0198c37\x2df28b\x2d41f5\x2dbb0f\x2d37d575e86896.device @8.841s
mercurial@providence:~$ systemd-analyze blame
         10.636s udisks2.service
          6.628s dev-sda6.device
          5.486s ModemManager.service
          4.935s accounts-daemon.service
          4.346s exim4.service
          4.156s NetworkManager.service
          3.211s bluetooth.service
          3.203s atd.service
          3.174s apt-daily.service
          3.132s pppd-dns.service
          3.128s alsa-restore.service
          2.765s systemd-logind.service
          2.762s avahi-daemon.service
          2.751s rsyslog.service
          2.750s wpa_supplicant.service
          2.594s networking.service
          2.168s lightdm.service
          2.148s plymouth-quit-wait.service
          2.024s upower.service
          1.975s systemd-udevd.service
          1.955s apparmor.service
          1.718s polkit.service
          1.412s systemd-tmpfiles-setup.service
          1.161s colord.service
          1.000s systemd-rfkill.service

I believe there is alot of room for improvement, so i'll just wait for some hardcore system administrators to shed some light. Thanks.

0

Edit /etc/default/grub put profile in place of quit and splash Sudo update-grub Edit /etc/fstab chance 1 OR 2 in 0 Mask network manager wait online Mask Plymouth wait online Reboot

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .