How to decrease Boot time

tutorial
boot

#1

Hello there, good people.

I found that disabling IPV6 reduces the boot time.
In my case about 10 seconds.

[Try disabling IPV6 if your ISP only provides IPV4 like mine does.]

Open a terminal window.
Change to the root user. su
Issue the command sysctl -w net.ipv6.conf.all.disable_ipv6=1
Issue the command sysctl -w net.ipv6.conf.default.disable_ipv6=1
To re-enable IPv6, issue the following commands:

sysctl -w net.ipv6.conf.all.disable_ipv6=0

sysctl -w net.ipv6.conf.default.disable_ipv6=0

[source]

edit: try the dmesg command in terminal to check the current boot time.

If any other tips you have, kindly post here. Hope it helped.
Thanks.


Change DNS addresses
#2

Decreasing boot time is much dependent on your system. It is about finding bottlenecks and disabling stuff you don’t need. Disabling ipv6 is an excellent example of this.

Arch wiki has good info https://wiki.archlinux.org/index.php/Improving_performance/Boot_process

Some general ideas:

  1. use ssd instead of spinning drive. Failing that, use preload or e4rat to optimize your boot.

  2. use lighter desktop environment or window manager. On a system that starts gnome gnome in 7-15 seconds starts bspwm or i3 in under a second.

  3. analyze your boot with

    systemd-analyze blame
    See what slows down the boot and tailor solutions to avoid that.

  4. compile your own kernel and make minimal initramfs. This can be fun, but benefits might not be worth the time to do it.


#3

My solution:

Stop booting so often. ESPECIALLY if you have a laptop.
Get suspend to ram to work. Good for several days unplugged.
Get Hibernate to disk to work. Good forever, needs a swap file/disk

Stop shutting down, and just close that lid. Its easier on the machine too.

I agree with everything @Chrysostomus said except compiling your own kernel. You will never get those hours back. Especially not on a rolling release.

There are also some things you can tweak in systemd if you look at

systemd analyse blame

(or the more informative option )
systemd-analyze plot >plot.svg && firefox --new-window plot.svg

With that you can find things that can be re-arranged by making local copies of systemd scripts in /etc/systemd/system/ (which are used in preference to the ones distributed in the distro).

For instance, I know that the chances of me wanting to print something the INSTANT I log in are slim to none. My traveling laptop is unlikely to be near my printers much of the time anyway.

I know that cups takes a long time to initialize, so I fiddle with the cups.service to push it out to way after login. (like 5 minutes), and I make sure nothing depends on it being up. I don’t wait for cups any more.

Same thing with modem manager.

But honestly, I seldom reboot. I’ve closed my laptop lid, driven from Washington state to Arizona, opened it again and resumed work.


#4

Yeah, I agree that it is in no way efficient. You can get maybe a second shaved off if you are lucky, but not much more in my experience. That was kind of the point I was trying to make. But if you are compiling your kernel anyway for some reason (learning?), then it might also decrease boot time slightly, if you do it right. Namely, compile it specifically for your processor and enable support only for the hardware you have.


#5

I would say, find a way just like Atari TOS* had done so efficiently, and blindingly fast, -namely. have the entire OS/GUI/DE and all, pre-loaded in FastROM, just like Atari did.
Oh wait, we can’t do that because the human-race has been chained to these x86-■■■■ boxes for the last 3 decades or so.
nevermind.


#6

OT

Yep, remember that one, I had 520 STM (per memory, or something similar) which I later upgraded to 1040.


#7

I’m fine, I think. :wink:

$ systemd-analyze
Startup finished in 1.466s (kernel) + 2.790s (userspace) = 4.257s


#8

What about uninstalling Plymouth? I haven’t ventured into doing this as I use LUKS encryption & am concerned I might mess up my machine & have to do a complete uninstall.

Thanks,

R.


#9

Hi community, reading from my HDD is too slow. Which tool I can use for optimizing HDD? Or can something wrong with my boot services?

systemd-analyze

Startup finished in 4.164s (firmware) + 2.421s (loader) + 4.210s (kernel) + 20.138s (userspace) = 30.934s

systemd-analyze blame

     12.036s systemd-journal-flush.service
      5.571s dev-sda2.device
      3.152s ModemManager.service
      2.097s systemd-fsck@dev-disk-by\x2duuid-33A4\x2dC0EF.service
      1.708s polkit.service
      1.691s dev-disk-by\x2duuid-bc77fa7e\x2ddbb9\x2d4183\x2db338\x2da1e5ac687d08.swap
      1.632s NetworkManager.service
      1.129s systemd-modules-load.service
      1.064s systemd-tmpfiles-setup-dev.service
       895ms udisks2.service
       826ms accounts-daemon.service
       712ms systemd-udevd.service
       683ms systemd-fsck@dev-disk-by\x2duuid-34bc0158\x2d2077\x2d427d\x2d82ed\x2d0715fa2119d0.service
       679ms bluetooth.service
       655ms boot-efi.mount
       633ms systemd-binfmt.service

#10

I don’t think there is too much things you can do. If the HDD is old then replace with a newer one, or you can try formatting HDD. I don’t know much about it.