Speed-up boot

From ArchWiki

Jump to: navigation, search
i18n
English
Česky
Image:Tango-two-arrows.png This article is a candidate for merging.
It is suggested that this page or section be merged with Tweaking for a faster boot time. (Discuss)

This article contains some tips on how you can improve your boot performance.

Contents

Tweaking Boot Files

Mkinitcpio.conf

Open /etc/mkinitcpio.conf as root and delete the HOOKS you don't need.

HOOKS="base udev autodetect sata usbinput filesystems"

Read more about which HOOKS you can remove.

Rc.conf

Open /etc/rc.conf as root, scroll to the hardware section.

MOD_AUTOLOAD="yes"

If you autoload your modules, there is no point of manually selecting modules. So clear out MODULES like this.

MODULES=()

On the other hand, you can get a speed increase by disabling udev autoloading

MOD_AUTOLOAD="no"

and manually populate your MODULES=() line with the modules you need/use.

In the network section, make sure you only load the network interface you need. Manually configuring your network is also faster then using dhcp. Then find and remove all DAEMONS you don't need.

DAEMONS=(alsa network gdm)

Then move your Xdm to front, and background all DAEMONS.

DAEMONS=(@gdm @alsa @network)

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

syslog-ng @portmap @alsa @timidity++ hal networkmanager @cups @crond @archstatsrc @openntpd @fam

As you can see, the above tries to spend the least time as possible by placing independent daemons before those that are dependent. An exception here is fam, notice how it is near to the end. It is dependent on portmap, and since hal takes a considerable amount of time starting up dbus and acpi, it is safe to place the dependency before that period. In such a case, by the time fam needs to start, portmap would have already been started. The rest after networkmanager depend on a network connection so they are placed in that way. If you only have a local printer, then cups can be started early. If you were wondering, one could check /etc/rc.d/$daemon to see whether they depend on anything.

udev

Check out Speedup udev for optimizing udev. This simple modification improves boot time by around 5 - 7 seconds. The article applies to stock kernels but you should be able to get things working on other kernels as well.

Rc.sysinit

First of all, you need to understand what /etc/rc.sysinit does. This file is responsible for 90% of the output you see during boot, meaning this is a system-critical configuration file which looks up other files like 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 then you would not need any lines concerning that. You can also comment out depmod

#status "Updating Module Dependencies" /sbin/depmod -A

if you do that regularly. This is only an example.

Inittab

Open /etc/inittab as root and find the agetty terminal lines.

c1:2345:respawn:/sbin/agetty 38400 vc/1 linux
c2:2345:respawn:/sbin/agetty 38400 vc/2 linux
c3:2345:respawn:/sbin/agetty 38400 vc/3 linux
c4:2345:respawn:/sbin/agetty 38400 vc/4 linux
c5:2345:respawn:/sbin/agetty 38400 vc/5 linux
c6:2345:respawn:/sbin/agetty 38400 vc/6 linux

Agetty terminals are what you see when you press Ctrl+Alt+F1-6 Now, if you only need 2 or 3 then comment out the rest.

c1:2345:respawn:/sbin/agetty 38400 vc/1 linux
c2:2345:respawn:/sbin/agetty 38400 vc/2 linux
#c3:2345:respawn:/sbin/agetty 38400 vc/3 linux
#c4:2345:respawn:/sbin/agetty 38400 vc/4 linux
#c5:2345:respawn:/sbin/agetty 38400 vc/5 linux
#c6:2345:respawn:/sbin/agetty 38400 vc/6 linux

Compile a kernel

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

Here are some tips from XxX Owned XxX ( http://ubuntuforums.org/showpost.php?p=1174954&postcount=507 ). Warning: Some of these tips may cause your kernel to not compile properly. Use them at you own risk.

S=Select U=Unselect

Feel free to add some!

General Setup

S: Support for paging of anonymous memory. (swap)

Loadable Module Support

U: Module Versioning Support
U: Source checksum for all modules

Block Layer

U: Large Block Devices (Uncheck all if possible)
// IO Schedulers // 
U: Anticipatory I/O Schedulers
U: Deadline I/O Schedulers

Processor type and features

U: Symmetric processing support (Unless your processor(s) support(s) it)
U: Generic x86 support
S: HPET Timer Support
S: Voluntary Kernel Preemption (Desktop) (Under Preemption Model)
S: Local APCI support on uniprocessors
S: IOAPCI support on uniprocessors (Under Local APCI support)
S: Off (Under High Memory support if you have under 1 gig of ram)
S: Sparse Memory (Under Memory Model, some computers will not have this option)
S: MTRR support
S: Use register arguments
S: Enable seccomp to compute untrusted bytecode
S: 1000hz (Under Timer Frequency)
// Firmware Drivers // 
U: Anything that you don't need.

Bus Options

S: Message Signaled Interrupts (MSI and MSIX) (PCI_MSI)

Network

U: Anything/Everything in Amateur Radio, IrDA, and Bluetooth if you don't need it.
// Network Options // 
S: Packet socket:mmapped IO

Device Drivers

// ATA/ATAP/MFR/RLL support // 
S: Use PCI DMA by Default
U: IDE Taskfile Access
// Raid and LVM // 
U: Unselect if you do not need it.
// I2O support // 
U: Unselect if you do not need it. Most people do not.

Network Device support

U: EQL support
U: Universal TUN/TAP device driver support
U: FDDI Driver support
U: HIPPI driver support
U: SLIP (serial line) support
U: Traffic Support
U: Network console login support
// ARCnet support // 
U: Unselect if you do not require/need it.
// Ethernet Support (1000 MB) // 
U: Uselect the cards that you don't have.
// Ethernet Support (10000 MB) // 
U: Unselect what you do not need.
// Token Ring Devices // 
U: Unselect if you are not connected to a Token ring network.
// WAN interfaces support // 
U: Unselect the some cards/the whole thing if you do not need it.
// ISDN subsystem // 
U: ISDN support (If you do not require it)

Input device support

U: Touchscreen interface
U: Touchscreens (Under the TouchScreens subcategory)

Character Devices

U: Any video cards that you do not need.
// Watchdog cards // 
U: Watch Dog Timer support

Misc Devices

U: Device driver for IBM/RSA service drivers
// Video Capture Adapters // 
U: Unselect anything that you don't need.
// Radio Adapters // 
U: Unselect anything that you don't need.
// Digital Video Broadcasting Devices // 
U: DVB for Linux

Graphics support

U: Unselect any graphics cards that you don't have.
// Logo Configuration // 
S: Bootup Logo (and anything under it)

File systems

U: Unselect any file systems that you are NOT going to use. (Minix, ROM, Quota, etc.)
// DOS/FAT/NT Filesystems // 
S: NTFS write support
// Network File Systems // 
U: NFS file system support
U: NFS server support
U: NCP file system support
U: Coda file system support
U: Andrew file system support
U: Plan 9 resource sharing support
// Partition Types // 
U: Advanced partition selection
// Native Language Support // 
U: Unselect all but your native language

Instrumentation Support

U: Profiling Support
U: Kprobes

Kernel Hacking

U: Show timing information on printks
U: Magic SysRq Key
U: Kernel Hacking
U: Debug Filesystem
U: Compile the kernel with frame unwind information
  • Magic SysRq Key may be of interest to you
Personal tools