Speeding up boot with systemd

Every day solutions to every day challenges. + Brilliant stuff

Moderators: b1o, jkerr82508

Forum rules
Please feel free to post your tip it does not have to be advanced. Also ask questions directly related to the tip here. But do not start new threads with questions or ask for help here. That is what the help section is for. forum rules: http://bjoernvold.com/forum/viewtopic.php?f=8&t=568
User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Speeding up boot with systemd

Postby viking60 » 02 Oct 2013, 09:10

It was time to knock of a few seconds on my boot process again.
In the good old days that could be quite a tiresome process, but with systemd it is easy:

Code: Select all

sudo systemctl enable systemd-readahead-collect systemd-readahead-replay

That is all you have to do.

So while you are dancing for joy :dance1 you reboot...
....and find out that your box actually boots slower.
(At this point you will be ready to stop these services and declare me an idiot for giving this tip. :-D )

Don't worry - your computer needs to collect and structure data the first times.
On the second boot it will be as fast as it was - and on the third boot you will have gained 5 sec and so on until it is optimal.
This service will also defragment and rearrange files on disk to optimize subsequent boot times.
The data are collected in the file /.readahead
so you can check what has been collected with

Code: Select all

cat /.readahead

The best way to find out how much you have saved is by doing

Code: Select all

systemd-analyze

...before you start the services - and after.

more here
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
dedanna1029
Sound-Berserk
Posts: 8784
Joined: 14 Mar 2010, 20:29
Contact:

Re: Speeding up boot with systemd

Postby dedanna1029 » 08 Oct 2013, 08:58

:s
I'd rather be a free person who fears terrorists, than be a "safe" person who fears the government.
No gods, no masters.
"A druid is by nature anarchistic, that is, submits to no one."
http://uk.druidcollege.org/faqs.html

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Re: Speeding up boot with systemd

Postby viking60 » 25 Oct 2013, 10:17

Just check that you do not already have a /.readahead
Distros may have already implemented it .
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
dedanna1029
Sound-Berserk
Posts: 8784
Joined: 14 Mar 2010, 20:29
Contact:

Re: Speeding up boot with systemd

Postby dedanna1029 » 26 Oct 2013, 23:40

Oooooohhh... so that's the file that the NSA snags then.

(*joke,no worries)
I'd rather be a free person who fears terrorists, than be a "safe" person who fears the government.
No gods, no masters.
"A druid is by nature anarchistic, that is, submits to no one."
http://uk.druidcollege.org/faqs.html

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Re: Speeding up boot with systemd

Postby viking60 » 26 Oct 2013, 23:47

Well let us hope that your next president has some authority - enough to control the NSA.
Comments about the guy in power right now = censored
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"


Return to “Tips & Tricks”