How to find boot up time in Ubuntu. Get Linux boot up time and find if the Ubuntu is taking long time to boot. Using the systemd” command you can find if Ubuntu is taking too much time to boot and then fix it.
Find How Much Time It Takes To Boot Linux System
Ubuntu users can easily find the Linux boot up time using systemd-analyze command. Simply run the command:
systemd-analyze
When you run the command you will then see the boot up time the system takes.
systemd
systemd is a system and service manager for Linux operating systems. When run as first process on boot (as PID 1), it acts as init system that brings up and maintains userspace services.
For compatibility with SysV, if systemd is called as init and a PID that is not 1, it will execute telinit and pass all command line arguments unmodified. That means init and telinit are mostly equivalent when invoked from normal login sessions. See telinit(8) for more information.
When run as a system instance, systemd interprets the configuration file system.conf and the files in system.conf.d directories; when run as a user instance, systemd interprets the configuration file user.conf and the files in user.conf.d directories.
The command systemd-analyze is used to analyze system boot-up performance. The command has the following syntax:
1. systemd-analyze [OPTIONS…] [time]
2. systemd-analyze [OPTIONS…] blame
3. systemd-analyze [OPTIONS…] critical-chain [UNIT…]
4. systemd-analyze [OPTIONS…] plot [> file.svg]
5. systemd-analyze [OPTIONS…] dot [PATTERN…] [> file.dot]
6. systemd-analyze [OPTIONS…] dump
7. systemd-analyze [OPTIONS…] set-log-level LEVEL
8. systemd-analyze [OPTIONS…] set-log-target TARGET
9. systemd-analyze [OPTIONS…] verify [FILES…]
systemd-analyze may be used to determine system boot-up performance statistics and retrieve other state and tracing information from the system and service manager, and to verify the correctness of unit files.
systemd-analyze time prints the time spent in the kernel before userspace has been reached, the time spent in the initial RAM disk (initrd) before normal system userspace has been reached, and the time normal system userspace took to initialize. Note that these measurements simply measure the time passed up to the point where all system services have been spawned, but not necessarily until they fully finished initialization or the disk is idle.
systemd-analyze blame prints a list of all running units, ordered by the time they took to initialize. This information may be used to optimize boot-up times. Note that the output might be misleading as the initialization of one service might be slow simply because it waits for the initialization of another service to complete.
systemd-analyze critical-chain [UNIT…] prints a tree of the time-critical chain of units (for each of the specified UNITs or for the default target otherwise). 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. Note that the output might be misleading as the initialization of one service might depend on socket activation and because of the parallel execution of units.
Another command argument to use is:
systemd-analyze blame
This command displays the output with all the services listed in the descending order.