Score:3

Ubuntu 20.04 freezes for exactly 10 seconds during boot, then works normally

in flag

I have a notebook LG Gram 14z980 with Windows 10 by default. I installed Ubuntu 20.04 with dual boot and I notice that the boot time in Windows were much faster than Ubuntu (about 10 seconds). Then, I investigated dmesg and guess what... Ubuntu freezes exactly 10 seconds doing "nothing", then continues booting normally.

Example of dmesg:

[    2.561970] usb 1-8: Manufacturer: FPC 
[   12.934435] input: Logitech USB Receiver as /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4:1.0/0003:046D:C52B.0002/input/input6

I've recently upgraded it with an additional SSD NVme (Crucial P5) and 16 GB RAM (Kingston Fury) and the behavior keeps the same, even with a fresh Ubuntu installation.

Dmesg screenshot

Does anyone have an advice on what I should do to fix this?

[BEGIN UPDATE]

I tried the following commands and I realized that NetworkManager-wait-online.service was taking 6.237s during boot. Then, I disabled it, but dmesg keeps showing 10 sec freezing as I posted.

Some new details of the current status:

$ systemd-analyze blame
3.119s plymouth-quit-wait.service                                               
2.093s snap-spotify-56.mount                                                    
2.092s snap-gtk\x2dcommon\x2dthemes-1519.mount                                  
2.068s snap-pycharm\x2dcommunity-261.mount                                      
1.890s snap-snapd-12704.mount                                                   
1.762s snap-gtk\x2dcommon\x2dthemes-1515.mount                                  
1.754s snap-snapd-14066.mount                                                   
1.645s snap-snap\x2dstore-547.mount                                             
1.463s dev-loop0.device                                                         
1.452s snap-snap\x2dstore-558.mount     
...

$ systemd-analyze critical-chain

graphical.target @6.535s
└─multi-user.target @6.535s
  └─snapd.seeded.service @4.605s +731ms
    └─snapd.service @3.296s +1.307s
      └─basic.target @3.261s
        └─sockets.target @3.261s
          └─snapd.socket @3.260s +847us
            └─sysinit.target @3.255s
              └─systemd-timesyncd.service @2.531s +163ms
                └─systemd-tmpfiles-setup.service @2.505s +21ms
                  └─local-fs.target @2.498s
                    └─snap-spotify-56.mount @394ms +2.093s
                      └─dev-loop16.device @2.483s +6ms

None of them seems to take 10 seconds...

[END UPDATE]

Bests, Evandro

waltinator avatar
it flag
Look at all the startup logs: `sudo journalctl -b 0`. Find the timestamps that are 10 seconds apart. Also `sudo systemd-analyze blame`.
Evandro Macedo avatar
in flag
Thank you for your comment, @waltinator I tried the commands you sent but they were not sufficient to solve the problem. The command blame helped to identify that the `NetworkManager-wait-online.service` was taking 6.237s during boot. Then, I disabled it, but dmesg keeps showing 10 sec freezing as I posted. I checked the command `sudo systemd-analyze critical-chain`, which confirmed `NetworkManager-wait-online.service @4.311s +6.237s`
Score:1
in flag

I would recommend disabling snapd at boot and Waiting for Network to come up.

There are other steps to speed up boot.

All three of these links provide a wealth of information. The links are all in Ask Ubuntu so they will not disappear until this answer does.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.