Tech

Accelerate Linux system startup – how it works


Relative to other waiting times on the PC caused by network, backups, updates, program starts, a hesitant computer start seems rather irrelevant. But first, it can never go fast enough, second, there are really annoying brakes.

System developers are constantly working on boot optimization. To name just a few examples: Ubuntu recently worked on the compression method, the init daemon Systemd enables parallel loading of the system services, Windows uses a hybrid shutdown to accelerate startup. If it is still not fast enough, faster hardware, troubleshooting or alternative start-up methods as described here will help. More general optimization measures that are not clearly related to the computer start can be found in the previous article.

Boot performance and hardware

The data carrier for the system partition is primarily responsible for the quick or tough system start, followed by the processor in second place. Modern SSDs and processors guarantee a quick arrival at the login screen at Ubuntu & Co.: Ten seconds and less are the ideal, 15 seconds can also be reached with components that are no longer fresh.

An SSD cannot be avoided by users who value fast boot times and general system performance. But it does not have to be a still relatively expensive SSD with two or four terabytes or more, which should then also record the complete user data: A Linux system manages permanently with 128 GB, making relatively inexpensive SSDs from 500 GB to one TB perfect sufficient (50 to 100 euros). A slow mechanical hard disk can then be used for the user data – a sensible combination that is also found today in many complete offers.

Detect boat brakes

The start of Ubuntu / Mint should take no longer than 20 to 40 seconds depending on the hardware, the latter without an SSD. In order to detect possible boat brakes, you should force a talkative boot process. This is permanently possible via the file “/ etc / default / grub” by deactivating the line with the entry “quiet splash” with the comment character “#”. A one-time ad-hoc analysis can be achieved at system start-up by selecting “Advanced Options …” and underneath the entry with the note “recovery mode”. Querying the kernel messages can also be illuminating

when booting, you should note the exact time and seconds when the boat trailer appears. Dmesg shows the time of all system events to the second, which you can then assign exactly.

However, extremely long loading times often have a simple cause that is relatively easy to remedy: They speak for an incorrect entry in the “/ etc / fstab” file that occurs either after installation or after manual editing. Proof of this is the message “A start job is running for dev-disk-by …”, which is revealed when the start is suspended by pressing the Esc key or by a system start via “Extended options -› recovery mode “. The system wants to mount a hard drive that it cannot find. The first remedy is to comment out the relevant line in the “fstab” (with “#”). If the hard disk has to be mounted, use lsblk -f to determine the correct UUID ID and enter it. Also check the mount point, since a non-existent mount directory also causes start hangers.

Linux desktops 2020:

Which one suits you?

Reduce bootloader waiting time

In multiboot environments, the Grub boot loader waits by default for ten seconds for a selection before it automatically selects the first, top default system. Especially if you mainly use this system, it makes sense to make the entry

in the file “/ etc / default / grub” to about 3 (seconds) and then with

reinitialize the boot environment.

Simplified start options

Auto-log-in: This is only worthwhile if the keychain also receives an empty password. All account protection is thus eliminated, unless the system is Luks-encrypted.

Enlarge

Auto-log-in: This is only worthwhile if the keychain also receives an empty password. All account protection is thus eliminated, unless the system is Luks-encrypted.

The following three solutions do not start the system faster, but it can be used faster:

Luks system without system login: If a desktop system with disk encryption has been installed, the system drive must be unlocked with the Luks password each time the system is booted. This access protection is sufficient so that the regular system registration can be omitted. You can therefore set up an automatic login – for example in Ubuntu under “System Settings -› Details – ›Users”, in Linux Mint under “Login window”. To really save time, you also have to define an empty password under “Passwords and encryption” (seahorse) after right-clicking on “Login” and “Change password”. Otherwise, the keychain that is normally opened by logging in will ask for the password every time.

Open system without system registration: A PC at home can also start without registering on the desktop. The setup is the same as described above for Luks. Here, too, the keychain password must be “empty” in order to be able to get started without any query. However, a system set up in this way dispenses with any protection of account and password data.

PC on permanent standby: If you want to operate your system as quickly as possible at any time, you simply cannot shut it down. The relevant idle state is called “standby” (technically “Suspend to RAM”) and restores the previous session state in a few (usually two to three) seconds after pressing a button or clicking the mouse. We measure a total of 0.7 watts of power consumption for a “standby” notebook. That would be hardly two euros additional electricity costs throughout the year, provided you do not switch off the device at all.

The automatic system start

The system is already running when you need it: The rtcwake tool ends and starts a computer automatically, saving you waiting times.

Enlarge

The system is already running when you need it: The rtcwake tool ends and starts a computer automatically, saving you waiting times.

With a relatively reliable usage time of a server or desktop PC, there is a nice alternative to no longer worry about shutdown and restart. The Linux tool rtcwake, which is usually preinstalled, can switch off a computer (or put it into an idle state) and start it again at the desired time. The “rtc” in the name stands for Real Time Clock and refers to the physical hardware clock. This also runs when the computer is completely switched off and can trigger a restart when a defined point in time has been reached. Under Linux this time is stored in the file “/ sys / class / rtc / rtc0 / wakealarm”.

Following terminal command

sudo rtcwake -m off -s 60 

is well suited to test whether the hardware is compatible (x86 hardware practically always, ARM computer not always). The switch “-m” determines the ACPI mode. Possible values ​​are “standby”, “mem”, “disk” or “off” (switch off completely). The second parameter here is “-s” (“seconds”) with a subsequent time in seconds. The above test command will shut down the system and restart after one minute (60 seconds). Although exact times can be specified with the “-t” switch, we recommend always specifying the planned restart with the “-s” parameter. It is little effort to convert around ten hours in seconds (10 * 3600 = 36,000).

To automate shutdown and start, the scheduler Cron comes into play: After calling the crontab editor with

switches the following entry

0 22 * * * /usr/sbin/rtcwake -m off -s 36000 

the computer daily at 10:00 p.m. and starts it again after 36,000 seconds (ten hours) – exactly at 8:00 a.m.

Tags

Related Articles

Back to top button
Close
Close