Question about slow Startup on a Thinkpad W530

EDIT: i fixed it by reinstalling with ext4 as format, which now decreased the boot time to a stable 5s.

I recently installed Arch on my Thinkpad W530, and set it up with 24GB of RAM and a 240GB SSD (some random brand).

The root partition is formatted as btrfs, so i already masked the fsck root systemd unit.

The home partition is located on an older wd scorpio blue 500gb from 2009, which i scavenged from my old external usb, it also is formatted with btrfs.

I am still left with a bootup which looks like this:

Startup finished in 6.964s (kernel) + 2min 50.981s (userspace) = 2min 57.946s
graphical.target reached after 2min 43.224s in userspace

output of blame:

    1min 2.733s man-db.service                                      
    1min 2.439s systemd-update-done.service                         
    46.868s updatedb.service                                    
    33.393s udisks2.service                                     
    30.555s NetworkManager.service                              
    29.394s vmware-networks-configuration.service               
    29.207s logrotate.service                                   
    27.777s systemd-journal-catalog-update.service              
    22.649s NetworkManager-wait-online.service                  
    22.084s mariadb.service                                     
    21.659s vmware-networks.service                             
    19.133s org.cups.cupsd.service                              
     6.877s systemd-udev-settle.service                         
     5.834s polkit.service                                      
     5.492s systemd-journal-flush.service                       
     5.095s dev-sda2.device                                     
     3.160s wpa_supplicant.service                              
     3.039s teamviewerd.service                                 
     2.709s avahi-daemon.service                                
     2.706s bluetooth.service                                   
     2.305s systemd-logind.service                              
     2.154s systemd-udevd.service                               
     1.885s upower.service                                      
     1.455s vmware-authd.service                                
     1.438s vmware-hostd-certificates.service                   
     1.158s nginx.service                                       
      886ms rtkit-daemon.service                                
      762ms home.mount                                          
      616ms systemd-random-seed.service                         
      326ms systemd-sysusers.service                            
      321ms systemd-timesyncd.service                           
      309ms lvm2-activation-early.service                       
      277ms systemd-journald.service                            
      223ms php-fpm.service            

critical-chain:

graphical.target @2min 43.224s
└─multi-user.target @2min 43.224s
  └─teamviewerd.service @2min 40.184s +3.039s
    └─network-online.target @2min 40.180s
      └─NetworkManager-wait-online.service @2min 17.529s +22.649s
        └─NetworkManager.service @1min 46.972s +30.555s
          └─dbus.service @1min 46.970s
            └─basic.target @1min 46.965s
              └─sockets.target @1min 46.964s
                └─org.cups.cupsd.socket @1min 46.964s
                  └─sysinit.target @1min 46.959s
                    └─systemd-timesyncd.service @16.742s +321ms
                      └─systemd-tmpfiles-setup.service @16.678s +58ms
                        └─local-fs.target @16.676s
                          └─home.mount @15.912s +762ms
                            └─local-fs-pre.target @15.909s
                              └─systemd-tmpfiles-setup-dev.service @8.928s +43ms
                                └─systemd-sysusers.service @8.600s +326ms
                                  └─systemd-remount-fs.service @8.428s +162ms
                                    └─systemd-journald.socket @8.410s
                                      └─system.slice @8.380s
                                        └─-.slice @8.380s

if you need any other information, tell me, and i can edit the post

Posted Sep 23, 2019, 7:51 PM UTC · edited

510

Is it hanging, whilst it waits for a network connection to be made? Do other devices take a while to get an ip address from your router?

2
eeleaterOP•

Other devices work fine, but I only use this Laptop on Wifi, so I don't know if that changes anything.

1

Might be some kind of conflict going on.

Also MariaDB looks awfully slow at 22s.

It's going to be worth checking the logs/journal to see if there are any errors being thrown up, and if not, going through one by one disabling services to see if it makes a difference.

journal -b

1
invisibleinfant•
2
eeleaterOP•

haveged is already installed and enabled, so that's probably not it.

1
DeadLink404•

I think your HDD may be dying. I would back it up.

1
eeleaterOP•

the smart values are all still in the good territory, so that's probably not it either

i also already had that hdd in my previous laptop without any issues

1
DeadLink404•

Why else would every service be so slow. It's got to be IO bound. Or is btrfs just that much slower then ext4?

1
eeleaterOP•

possibly, the previous laptop had the same arch config, but with ext4 root, and was very fast in bootup

1
totemcatcher•

I can give you some ideas.

The long wait on udisks2 is a tell. So look into both:

SSD

I would first look into what exactly this SSD is. "some random brand" is a good tell. If it has no internal caching/monitoring to spread NAND usage, then it is failing fast.

Smart error metrics can rise fast while still within an ideal threshold. I would check the rate of change in errors before and after multiple tests and multiple reboots and see how that plots. e.g. hdparm or sdparm and a GiB: dd if=/dev/zero of=tmpfile bs=1M count=1024;dd if=tmpfile of=/dev/null bs=1M count=1024;

Are the partitions aligned properly? This has a huge impact on SSD performance regardless of what people say about how that's only related to advanced format on HDDs. Ideally, any partition should start on a "sector" divisible by both 4096 and either 524288 or 1048576 for quick erasing (depending on device) just to be safe regardless of device. Further tuning is possible.

Are you using swap?

HDD

Even though the system is installed on SSD and the HDD is just home, the HDD can still affect boot times during mounting (and relevant disc checks) and if any starting service searches for user configurations. systemd does that, and maybe Network Manager.

Network

Speaking of Network Manager, if it isn't just an drive access problem (above), how the heck is it taking so long? I don't use it so I don't have experience, but that's a huge red flag.

Check journalctl for any hints.

1