TranslateProject/sources/tech/20190808 Find Out How Long Does it Take To Boot Your Linux System.md
DarkSun 4ff7eded08 选题: 20190808 Find Out How Long Does it Take To Boot Your Linux System
sources/tech/20190808 Find Out How Long Does it Take To Boot Your Linux System.md
2019-08-08 02:01:24 +08:00

4.6 KiB
Raw Blame History

Find Out How Long Does it Take To Boot Your Linux System

When you power on your system, you wait for the manufacturers logo to come up, a few messages on the screen perhaps (booting in insecure mode), Grub screen, operating system loading screen and finally the login screen.

Did you check how long did it take? Perhaps not. Unless you really need to know, you wont bother with the boot time details.

But what if you are curious to know long long your Linux system takes to boot? Running a stopwatch is one way to find that but in Linux, you have better and easier ways to find out your systems start up time.

Checking boot time in Linux with systemd-analyze

Like it or not, systemd is running on most of the popular Linux distributions. The systemd has a number of utilities to manage your Linux system. One of those utilities is systemd-analyze.

The systemd-analyze command gives you a detail of how many services ran at the last start up and how long they took.

If you run the following command in the terminal:

systemd-analyze

Youll get the total boot time along with the time taken by firmware, boot loader, kernel and the userspace:

Startup finished in 7.275s (firmware) + 13.136s (loader) + 2.803s (kernel) + 12.488s (userspace) = 35.704s

graphical.target reached after 12.408s in userspace

As you can see in the output above, it took about 35 seconds for my system to reach the screen where I could enter my password. I am using Dell XPS Ubuntu edition. It uses SSD storage and despite of that it takes this much time to start.

Not that impressive, is it? Why dont you share your systems boot time? Lets compare.

You can further breakdown the boot time into each unit with the following command:

systemd-analyze blame

This will produce a huge output with all the services listed in the descending order of the time taken.

7.347s plymouth-quit-wait.service
6.198s NetworkManager-wait-online.service
3.602s plymouth-start.service
3.271s plymouth-read-write.service
2.120s apparmor.service
1.503s [email protected]
1.213s motd-news.service
 908ms snapd.service
 861ms keyboard-setup.service
 739ms fwupd.service
 702ms bolt.service
 672ms dev-nvme0n1p3.device
 608ms [email protected]:intel_backlight.service
 539ms snap-core-7270.mount
 504ms snap-midori-451.mount
 463ms snap-screencloud-1.mount
 446ms snapd.seeded.service
 440ms snap-gtk\x2dcommon\x2dthemes-1313.mount
 420ms snap-core18-1066.mount
 416ms snap-scrcpy-133.mount
 412ms snap-gnome\x2dcharacters-296.mount

Bonus Tip: Improving boot time

If you look at this output, you can see that both network manager and plymouth take a huge bunch of boot time.

Suggested read  How To Fix: No Unity, No Launcher, No Dash In Ubuntu Linux

Plymouth is responsible for that boot splash screen you see before the login screen in Ubuntu and other distributions. Network manager is responsible for the internet connection and may be turned off to speed up boot time. Dont worry, once you log in, youll have wifi working normally.

sudo systemctl disable NetworkManager-wait-online.service

If you want to revert the change, you can use this command:

sudo systemctl enable NetworkManager-wait-online.service

Now, please dont go disabling various services on your own without knowing what it is used for. It may have dangerous consequences.

Now that you know how to check the boot time of your Linux system, why not share your systems boot time in the comment section?


via: https://itsfoss.com/check-boot-time-linux/

作者:Abhishek Prakash 选题:lujun9972 译者:译者ID 校对:校对者ID

本文由 LCTT 原创编译,Linux中国 荣誉推出