Fedora

為什麼開機慢?

  • March 19, 2016

我正在使用 Fedora 23,MATE 版。電腦感覺啟動很慢。我怎樣才能加快速度?

完整詳情http://i.imgur.com/vrLGXDp.jpg

$ systemd-analyze 
Startup finished in 16.571s (firmware) + 2.605s (loader) + 824ms (kernel) + 1.997s (initrd) + 48.466s (userspace) = 1min 10.464s

$ systemd-analyze blame
        31.448s mlocate-updatedb.service
        18.211s akmods.service
        16.019s firewalld.service
         9.127s systemd-journald.service
         7.709s accounts-daemon.service
         7.368s dev-sdd3.device
         7.037s systemd-udev-settle.service
         5.219s abrtd.service
         4.854s chronyd.service
         4.629s ModemManager.service
         4.081s livesys.service
         3.958s unbound-anchor.service
         3.920s systemd-logind.service
         3.823s rsyslog.service
         3.781s gssproxy.service
         3.780s akmods-shutdown.service
         3.698s avahi-daemon.service
         3.651s mcelog.service
         3.636s rtkit-daemon.service
         2.735s polkit.service
         2.163s systemd-udevd.service
         2.150s lvm2-monitor.service
         1.569s proc-fs-nfsd.mount

$ 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 @35.395s
└─lightdm.service @34.563s +830ms
 └─systemd-user-sessions.service @34.146s +129ms
   └─remote-fs.target @34.143s
     └─remote-fs-pre.target @34.143s
       └─iscsi-shutdown.service @34.128s
         └─network.target @34.019s
           └─NetworkManager.service @33.009s +1.009s
             └─firewalld.service @16.979s +16.019s
               └─polkit.service @17.870s +2.735s
                 └─basic.target @12.883s
                   └─sockets.target @12.864s
                     └─dbus.socket @12.844s
                       └─sysinit.target @12.704s
                         └─sys-fs-fuse-connections.mount @48.351s +3ms
                           └─system.slice
                             └─-.slice

這是已知問題,在Red Hat Bugzilla中有描述:

systemd 缺乏 cron 的隨機延遲功能正在打擊我們。我已經看到有一個功能請求。但在此之前,似乎在執行 updatedb 之前手動設置隨機睡眠是一種解決方法。我建議現在恢復使用 cron 來執行 updatedb,或者在執行 updatedb 之前放置一個隨機或特定的睡眠:例如 sleep 1h

解決方法

sed 's/daily/weekly/' /usr/lib/systemd/system/mlocate-updatedb.timer >/etc/systemd/system/mlocate-updatedb.timer

現在我只需要忍受週一的緩慢啟動。

引用自:https://unix.stackexchange.com/questions/270005