Improving performance/Boot process

From ArchWiki
Jump to: navigation, search

zh-CN:Improve Boot Performance Template:Temporary i18n Template:Article summary start Template:Article summary text Template:Article summary end


Improving the boot performance of a system can provide reduced boot wait times and a means to learn more about how certain system files and scripts interact with one another. This article attempts to aggregate methods on how to improve the boot performance of an Arch Linux system.

Modifying boot files


Asynchronous startup

Note: Using this means there are no guarantees that daemons are all started before X. This can cause problems if your setup expects D-Bus to be running (ck-launch-session, GNOME, KDE, etc.).

The initscripts can be started asynchronously instead of running in a strict order.

# use once instead of wait
su:S:once:/sbin/sulogin -p

TTY terminal management

agetty is Arch Linux's default terminal manager. By default it will generate six terminals, which can be accessed by typing Template:Keypress. To increase performance you can comment out unused terminals. It is important to not comment out the first two terminals (i.e. tty1 and tty2).

c1:2345:respawn:/sbin/agetty -8 38400 tty1 linux
c2:2345:respawn:/sbin/agetty -8 38400 tty2 linux
#c3:2345:respawn:/sbin/agetty -8 38400 tty3 linux
#c4:2345:respawn:/sbin/agetty -8 38400 tty4 linux
#c5:2345:respawn:/sbin/agetty -8 38400 tty5 linux
#c6:2345:respawn:/sbin/agetty -8 38400 tty6 linux

Additionally, consider using a lighter terminal manager such as fgettyAUR, which consists of the minimal tty manager, mingetty, that has been stripped of printfs and compiled against dietlibc.

Note: fgettyAUR currently does not support SHA-512 password hashing by default; a patched fgetty-pamAUR is available in the AUR. See SHA password hashes for more information.

You can install fgettyAUR from the AUR.

Then replace agetty with fgetty on the following lines:

 c1:2345:respawn:/sbin/fgetty tty1 linux
 c2:2345:respawn:/sbin/fgetty tty2 linux


This file lets you modify the kernel command line at boot. A couple of ways to speed up boot time using this file to modify the kernel command line is to remove framebuffer entries and to set the kernel to use a low level of logging with quiet. Remove existing vga= framebuffer resolution entries and logo.nologo, parameters to the desired kernel:

kernel /vmlinuz-linux root=/dev/disk/by-uuid/UUID ro logo.nologo quiet

For more kernel parameters and /boot/grub/menu.lst examples check out the page on Boot Debugging using GRUB.


Delete the HOOKS you do not need, and consider using just base (sometimes udev is needed too) along with the MODULES you need for your root device (and keyboard, instead of usbinput).

Warning: Read more about what hooks are required in the mkinitcpio article. Removing required hooks can render your system unusable!


In the network section, make sure you only load the network interface you need. Manually configuring your network with a static IP address is also faster than using DHCP.

Then find and remove all DAEMONS that you do not need.

DAEMONS=(alsa network gdm)

Next, move your login manager (in this case gdm) to the front, and background all DAEMONS.

DAEMONS=(@gdm @alsa @network)

Another thing you could do about daemons is finding the best, or rather, "sweetest" arrangement.

DAEMONS=(syslog-ng @acpid arptables iptables network pdnsd @alsa @dbus @mpd @crond @sensors @ntpd @dropboxd)

You should try to background as many DAEMONS as possible, making sure to start dependent DAEMONS after what they require (in the above example, pdnsd depends on network, ntpd and dropboxd depend on pdnsd and network, because is the DNS server). You can still background daemons that are required by other things (dbus is required by Xorg), but they need enough time to start (it can take some experimentation to get it all to work well).


This script is responsible for the majority of output you see during boot, meaning this is a system-critical configuration file which looks up other files like /etc/rc.conf and loads modules, sets up mounts, handles errors, and basically tries to be your best friend.

There are certain lines here which you may not need. Removing or commenting them out may save you a few seconds at most. Do this at your own risk. For example, if you do not have RAID, LVM or encryption, then you would not need any lines concerning that.

It is also possible to add some ampersands (&) to make it more asynchronous, but be careful - lots of things are expected to be finished during later parts of the script.

Compiling a Custom Kernel

To decrease boot time, a stripped kernel is a must. Read more about compiling a kernel.

Additional Resources