Announcement

Collapse
No announcement yet.

Fresh 20.04 Install On Old Apple MacBook - Everything OK Except Boot Time?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Fresh 20.04 Install On Old Apple MacBook - Everything OK Except Boot Time?

    Hi,

    Just installed Kubuntu 20.04 LTS 64Bit onto a very old Apple MacBook A1181 laptop.
    Apple laptop has a Intel Core 2 Duo 2-core CPU, Intel HD GPU, 2GB RAM, & 160GB HDD.

    Everything works 100%, but the boot time is pretty long - about 2 minutes?
    Anything I can do to improve boot time?

    I did a fresh install of Kubuntu, the notebook had an unlicensed Windows 7 32Bit before.
    Let me know, thanks!

    Jesse

    #2
    systemd-analyze
    and
    systemd-analyze blame

    The first will show how long each part of booting takes, from powering on.
    The last shows the individual bits of item load times post-grub, in descending order. This can help find if one particular service or item is slowing down or waiting for something.
    Note that this is not a concurrent list, as multiple items are loaded in parallel.

    Here is mine as an example:

    Code:
    [FONT=monospace][COLOR=#54FF54][B]claydoh@claydoh-Pavilion590[/B][/COLOR][COLOR=#000000]:[/COLOR][COLOR=#5454FF][B]~[/B][/COLOR][COLOR=#000000]$ systemd-analyze  [/COLOR]
    Startup finished in 12.008s (firmware) + 5.540s (loader) + 4.751s (kernel) + 3.460s (userspace) = 25.760s
    graphical.target reached after 3.456s in userspace
    
    [/FONT]
    Note my PC takes 12 seconds to get past the bios.


    Code:
    [FONT=monospace][COLOR=#54FF54][B]claydoh@claydoh-Pavilion590[/B][/COLOR][COLOR=#000000]:[/COLOR][COLOR=#5454FF][B]~[/B][/COLOR][COLOR=#000000]$ systemd-analyze blame[/COLOR]
              1.693s NetworkManager-wait-online.service
               677ms dev-nvme0n1p2.device
               603ms snapd.service
               426ms vboxdrv.service
               362ms fwupd.service
               349ms systemd-logind.service
               340ms media-stuff.mount
               285ms dev-loop1.device
               228ms dev-loop4.device
               224ms dev-loop3.device
               223ms dev-loop2.device
               193ms dev-loop5.device
               191ms systemd-journal-flush.service
               158ms upower.service
               156ms apt-daily.service
               151ms snap-core-9066.mount
               151ms snap-deadbeef\x2dvs-5.mount
               138ms libvirtd.service
    
    [/FONT]

    Comment


      #3
      Hi,

      It's faster than I thought, but still slow:

      Code:
      user@User-MacBook:~$ systemd-analyze
      Startup finished in 7.206s (kernel) + 42.855s (userspace) = 50.061s 
      graphical.target reached after 42.807s in userspace
      user@User-MacBook:~$
      Code:
      user@User-MacBook:~$ systemd-analyze blame
      17.908s snapd.service                                        
      16.770s networkd-dispatcher.service                          
      14.819s udisks2.service                                      
      13.322s accounts-daemon.service                              
      12.841s NetworkManager-wait-online.service                   
      11.356s dev-mapper-vgkubuntu\x2droot.device                  
      11.053s tor@default.service                                  
      10.101s polkit.service                                       
      9.386s avahi-daemon.service                                 
      9.375s bluetooth.service                                    
      9.339s NetworkManager.service                               
      8.501s thermald.service                                     
      8.490s systemd-logind.service                               
      8.479s wpa_supplicant.service                               
      7.754s ModemManager.service                                 
      7.688s systemd-resolved.service                             
      5.038s grub-common.service                                  
      4.763s gpu-manager.service                                  
      4.182s upower.service                                       
      4.164s apport.service                                       
      3.756s grub-initrd-fallback.service                         
      3.351s rsyslog.service                                      
      3.192s packagekit.service                                   
      2.115s systemd-journal-flush.service                        
      2.017s systemd-timesyncd.service                            
      1.923s systemd-udevd.service                                
      1.750s systemd-journald.service                             
      1.504s e2scrub_reap.service                                 
      1.204s apparmor.service                                     
      1.056s user@1000.service                                    
      1.041s alsa-restore.service                                 
      1.029s keyboard-setup.service                               
      1.029s pppd-dns.service                                     
       944ms systemd-modules-load.service                         
       874ms systemd-udev-trigger.service                         
       856ms systemd-rfkill.service                               
       627ms systemd-tmpfiles-setup.service                       
       564ms systemd-sysusers.service                             
       560ms systemd-random-seed.service                          
       489ms setvtrgb.service                                     
       452ms systemd-tmpfiles-setup-dev.service                   
       418ms systemd-sysctl.service                               
       355ms ufw.service                                          
       320ms snapd.seeded.service                                 
       308ms lvm2-monitor.service                                 
       292ms plymouth-quit.service                                
       285ms systemd-backlight@backlight:intel_backlight.service  
       249ms systemd-remount-fs.service                           
       234ms console-setup.service                                
       222ms kmod-static-nodes.service                            
       204ms sddm.service                                         
       194ms systemd-user-sessions.service                        
       176ms dev-hugepages.mount                                  
       174ms dev-mqueue.mount                                     
       174ms systemd-update-utmp.service                          
       172ms sys-kernel-debug.mount                               
       171ms sys-kernel-tracing.mount                             
       167ms systemd-fsck@dev-disk-by\x2duuid-36B0\x2d3582.service
       166ms blk-availability.service                             
       153ms plymouth-read-write.service                          
       118ms dev-mapper-vgkubuntu\x2dswap_1.swap                  
       112ms boot-efi.mount                                       
       102ms kerneloops.service                                   
        96ms snapd.apparmor.service                               
        81ms lvm2-pvscan@8:2.service                              
        70ms user-runtime-dir@1000.service                        
        37ms tor.service                                          
        36ms sys-fs-fuse-connections.mount                        
        29ms systemd-update-utmp-runlevel.service                 
        27ms rtkit-daemon.service                                 
        27ms plymouth-start.service                               
        16ms sys-kernel-config.mount                              
         6ms snapd.socket                                         
      user@User-MacBook:~$

      Comment


        #4
        That is slow, but then again it is what, 14 years old?
        *everything* is slow, but a common culprit of slower boot is the networking services.

        https://askubuntu.com/questions/1166...166492#1166492
        and
        https://askubuntu.com/questions/1181...182196#1182196


        others will blindly jump in and yell about Snapd, but i think this is also related to the networking
        if you don't use snaps, then it would be good to uninstall snap related things, I am sure this is extra overhead not amenable for such 'vintage' hardware specs.

        Comment


          #5
          Pardon me for jumping into this thread with my own question, but I tried the second command and found that man-db.service takes 23.504 sec to load. Is this normal? What is man-db.service anyway?

          Comment


            #6
            It periodically updates the database that has all the info for all the manpages . Could be a one time thing, after an update, or called by a timer to keep it up to date.
            See if this persists
            Note that this time of 23 seconds is not necessarily pre-boot times, this may still be finishing up once the desktop loads and is usable, so it is not adding those 23 seconds to your boot time but is probably just how long it takes to finish the task. Unlike services such as the networking ones, which can actually keep later items from running.

            Also see the command systemd-analyze critical-chain for more


            on my quicker-booting laptop this time:

            Code:
            [B]dohbuoy@dohbuoy-FLEX-15IIL:[/B]~$ systemd-analyze 
            Startup finished in 3.461s (firmware) + 1.191s (loader) + 2.703s (kernel) + 783ms (userspace) = 8.139s
            graphical.target reached after 778ms in userspace
            
            
            [FONT=monospace][B]dohbuoy@dohbuoy-FLEX-15IIL[/B][COLOR=#000000]:[/COLOR][COLOR=#5454FF][B]~[/B][/COLOR][COLOR=#000000]$ systemd-analyze critical-chain  [/COLOR]
            The time after the unit is active or started is printed after the "@" character.
            [COLOR=#ff0000][U][B]The time the unit takes to start is printed after the "+" character.
            [/B][/U][/COLOR]
            graphical.target @778ms
            └─multi-user.target @778ms
              └─[COLOR=#FF5454][B]snapd.seeded.service @769ms +8ms[/B][/COLOR]
                └─[COLOR=#FF5454][B]snapd.service @616ms +152ms[/B][/COLOR]
                  └─basic.target @595ms
                    └─sockets.target @595ms
                      └─[COLOR=#FF5454][B]snapd.socket @594ms +1ms[/B][/COLOR]
                        └─sysinit.target @593ms
                          └─[COLOR=#FF5454][B]apparmor.service @515ms +78ms[/B][/COLOR]
                            └─local-fs.target @514ms
                              └─[COLOR=#FF5454][B]boot-efi.mount @510ms +4ms[/B][/COLOR]
                                └─[COLOR=#FF5454][B]systemd-fsck@dev-disk-by\x2duuid-0A4B\x2dAE5A.service @476ms +31ms[/B][/COLOR]
                                  └─dev-disk-by\x2duuid-0A4B\x2dAE5A.device @476ms
            
            [/FONT]
            Good lordy having an nvme m.2 drive makes things so much zippier.
            Some of JeZ-l-Lee's lack of boot speed is also due to the (lack of) speed of his 'ancient' peripherals.
            Last edited by Snowhog; Jun 18, 2020, 01:03 PM.

            Comment


              #7
              A lot of those 10+ second services will take less time as you use your system. Man-db is indexing the man pages. When it is done its boot time will shrink significantly.
              Take a look at man-db on my system:
              Code:
              $ systemd-analyze blame
              889ms smartmontools.service                                                                    
              723ms tor@default.service                                                                      
              [COLOR=#ff0000]699ms man-db.service  [/COLOR]                                                                         
              694ms systemd-logind.service                                                                   
              563ms apt-daily-upgrade.service                                                                
              534ms dev-sda1.device                                                                          
              513ms upower.service                                                                           
              484ms networkd-dispatcher.service                                                              
              481ms udisks2.service                                                                          
              418ms systemd-journald.service                                                                 
              389ms systemd-timesyncd.service                                                                
              379ms systemd-resolved.service                                                                 
              361ms gpu-manager.service                                                                      
              347ms accounts-daemon.service                                                                  
              294ms logrotate.service                                                                        
              289ms systemd-fsck@dev-disk-by\x2duuid-ce2b5741\x2dc01e\x2d4b3d\x2db6ba\x2d401ad7f7fcdf.service
              250ms systemd-journal-flush.service                                                            
              231ms avahi-daemon.service                                                                     
              224ms NetworkManager.service                                                                   
              218ms polkit.service                                                                           
              196ms cwdaemon.service
              Like Claydoh says, purging snapd, which will remove chromium-browser because they are joined at the hip, will also eliminate 10 loop devices.

              sudo systemctl stop snapd
              sudo apt autoremove --purge snapd
              rm -vrf ~/snap (might fail if you haven't used the snap store)
              sudo systemctl disable snapd.service
              sudo systemctl mask snapd.service
              sudo systemctl disable snapd.seed.service
              sudo systemctl mask snapd.seed.service
              sudo apt-mark hold snapd
              Then reboot.
              The last command will prevent any update from reinstalling snapd.
              "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
              – John F. Kennedy, February 26, 1962.

              Comment


                #8
                Shaved some of the boot time from your suggestions:
                Anything else can be done?

                Code:
                user@User-MacBook:~$ systemd-analyze
                Startup finished in 7.395s (kernel) + 33.866s (userspace) = 41.262s 
                graphical.target reached after 33.831s in userspace
                user@User-MacBook:~$
                Code:
                user@User-MacBook:~$ systemd-analyze blame
                11.005s udisks2.service                                      
                10.178s accounts-daemon.service                              
                7.444s dev-mapper-vgkubuntu\x2droot.device                  
                6.939s systemd-resolved.service                             
                6.637s polkit.service                                       
                6.561s avahi-daemon.service                                 
                6.551s ModemManager.service                                 
                6.475s NetworkManager.service                               
                6.041s thermald.service                                     
                6.031s systemd-logind.service
                6.006s wpa_supplicant.service                               
                4.554s grub-common.service                                  
                4.544s gpu-manager.service                                  
                4.486s apport.service                                       
                3.925s upower.service                                       
                3.855s packagekit.service                                   
                3.738s grub-initrd-fallback.service                         
                3.432s rsyslog.service                                      
                3.261s systemd-journal-flush.service                        
                2.647s systemd-udevd.service                                
                2.409s e2scrub_reap.service                                 
                2.070s apparmor.service                                     
                2.011s systemd-timesyncd.service                            
                1.599s systemd-journald.service                             
                1.388s systemd-rfkill.service                               
                1.282s user@1000.service                                    
                1.081s pppd-dns.service                                     
                954ms keyboard-setup.service                               
                922ms systemd-modules-load.service                         
                911ms systemd-fsck@dev-disk-by\x2duuid-36B0\x2d3582.service
                868ms systemd-tmpfiles-setup.service                       
                736ms systemd-udev-trigger.service                         
                679ms alsa-restore.service                                 
                593ms systemd-sysusers.service                             
                576ms systemd-random-seed.service                          
                501ms systemd-backlight@backlight:intel_backlight.service  
                499ms dev-mapper-vgkubuntu\x2dswap_1.swap                  
                401ms systemd-tmpfiles-setup-dev.service                   
                398ms console-setup.service                                
                373ms systemd-sysctl.service                               
                336ms lvm2-monitor.service                                 
                290ms ufw.service                                          
                287ms sys-kernel-tracing.mount                             
                287ms dev-hugepages.mount                                  
                286ms dev-mqueue.mount                                     
                284ms sys-kernel-debug.mount                               
                282ms blk-availability.service                             
                275ms kmod-static-nodes.service                            
                221ms setvtrgb.service                                     
                221ms kerneloops.service                                   
                213ms systemd-remount-fs.service                           
                198ms plymouth-read-write.service                          
                152ms systemd-user-sessions.service                        
                148ms sddm.service                                         
                146ms lvm2-pvscan@8:2.service                              
                136ms systemd-update-utmp.service                          
                110ms boot-efi.mount                                       
                 83ms user-runtime-dir@1000.service                        
                 46ms plymouth-quit.service                                
                 41ms rtkit-daemon.service                                 
                 33ms sys-fs-fuse-connections.mount                        
                 29ms systemd-update-utmp-runlevel.service                 
                 27ms plymouth-start.service                               
                 21ms sys-kernel-config.mount                              
                user@User-MacBook:~$

                Comment


                  #9
                  Not really, imo. Not with a slow cpu, slow ram, slow HDD, plus disk encryption.
                  ~40 seconds ain't bad at all, imo. considering the vintage.

                  Comment


                    #10
                    I should be happy this 13 year old Apple notebook works...
                    ...I tried to install Windows 10 Pro 64Bit from USB and it was a complete failure...

                    Comment


                      #11
                      needz moar ramzes!

                      Comment

                      Working...
                      X