Why does it take so long to build fallback.img?

For each install using pacman or yay it takes about 1 min 40 secs to complete the install, and the main time is taken by this mkinitcpio and grub update after every transaction.
Here is a gif to see that in action.

Link: https://gifyu.com/image/8HyD

My experience.
The DL time 12 sec.
Reading/Enter ~ 5 sec.
All together 1min.1Sec.
Seems normal for me, but ...

Summary
upd           
################################################################################
################# Arch Linux mirrorlist generated by Reflector #################
################################################################################

# With:       reflector --country Germany --latest 5 --age 2 --fastest 5 --protocol https --sort rate --save /etc/pacman.d/mirrorlist
# When:       2020-10-15 06:32:28 UTC
# From:       https://www.archlinux.org/mirrors/status/json/
# Retrieved:  2020-10-15 06:32:27 UTC
# Last Check: 2020-10-15 05:42:27 UTC

Server = https://mirror.chaoticum.net/arch/$repo/os/$arch
Server = https://ftp.halifax.rwth-aachen.de/archlinux/$repo/os/$arch
Server = https://mirror.f4st.host/archlinux/$repo/os/$arch
Server = https://mirror.pkgbuild.com/$repo/os/$arch
Server = https://phinau.de/arch/$repo/os/$arch
:: Synchronisiere Paketdatenbanken...
 core                                                       131,0 KiB  1337 KiB/s 00:00 [--------------------------------------------------] 100%
 extra                                                     1640,4 KiB  3,43 MiB/s 00:00 [--------------------------------------------------] 100%
 community                                                    5,2 MiB  6,42 MiB/s 00:01 [--------------------------------------------------] 100%
 multilib ist aktuell
 chaotic-aur                                               1418,6 KiB  1240 KiB/s 00:01 [--------------------------------------------------] 100%
:: Starte vollständige Systemaktualisierung...
Löse Abhängigkeiten auf...
Suche nach in Konflikt stehenden Paketen...

Pakete (6) dnssec-anchors-20190629-3  garuda-common-settings-r11.59dd350-1  garuda-i3-settings-r52.61b3245-1  iana-etc-20201012-1  krita-4.4.0-5
           libraw-0.20.2-1

Gesamtgröße des Downloads:            67,91 MiB
Gesamtgröße der installierten Pakete:  193,08 MiB
Größendifferenz der Aktualisierung:    0,00 MiB

:: Installation fortsetzen? [J/n] 
:: Empfange Pakete...
 dnssec-anchors-20190629-3-any                                3,0 KiB  0,00   B/s 00:00 [--------------------------------------------------]   0%
 iana-etc-20201012-1-any                                    391,7 KiB  2,64 MiB/s 00:00 [--------------------------------------------------]   0%
 libraw-0.20.2-1-x86_64                                     814,0 KiB  3,63 MiB/s 00:00 [--------------------------------------------------]   1%
 krita-4.4.0-5-x86_64                                        67,7 MiB  6,32 MiB/s 00:11 [--------------------------------------------------]  99%
 garuda-common-settings-r11.59dd350-1-any                    67,8 MiB  6,30 MiB/s 00:11 [--------------------------------------------------]  99%
 garuda-i3-settings-r52.61b3245-1-any                        67,9 MiB  5,62 MiB/s 00:12 [--------------------------------------------------] 100%
(6/6) Prüfe Schlüssel im Schlüsselring                                                  [--------------------------------------------------] 100%
(6/6) Überprüfe Paket-Integrität                                                        [--------------------------------------------------] 100%
(6/6) Lade Paket-Dateien                                                                [--------------------------------------------------] 100%
(6/6) Prüfe auf Dateikonflikte                                                          [--------------------------------------------------] 100%
(6/6) Überprüfe verfügbaren Festplattenspeicher                                         [--------------------------------------------------] 100%
:: Starte pre-transaction hooks...
(1/2) Creating Timeshift snapshot before upgrade...
First run mode (config file not found)
Selected default snapshot type: BTRFS
Using system disk as snapshot device for creating snapshots in BTRFS mode
Mounted '/dev/sda2' at '/run/timeshift/backup'
Creating new backup...(BTRFS)
Saving to device: /dev/sda2, mounted at path: /run/timeshift/backup
Created directory: /run/timeshift/backup/timeshift-btrfs/snapshots/2020-10-15_08-32-55
Created subvolume snapshot: /run/timeshift/backup/timeshift-btrfs/snapshots/2020-10-15_08-32-55/@
Created control file: /run/timeshift/backup/timeshift-btrfs/snapshots/2020-10-15_08-32-55/info.json
BTRFS Snapshot saved successfully (0s)
Tagged snapshot '2020-10-15_08-32-55': ondemand
------------------------------------------------------------------------------
First run mode (config file not found)
Selected default snapshot type: BTRFS

/dev/sda2 is mounted at: /run/timeshift/backup, options: rw,relatime,compress=zstd:3,ssd,space_cache,autodefrag,commit=120,subvolid=5,subvol=/

Selected default snapshot device: /dev/sda2
------------------------------------------------------------------------------
Removing snapshot: 2020-10-12_13-21-16
Deleting subvolume: @ (Id:381)
Deleted subvolume: @ (Id:381)

Destroying qgroup: 0/381
Destroyed qgroup: 0/381

Deleted directory: /run/timeshift/backup/timeshift-btrfs/snapshots/2020-10-12_13-21-16
Removed snapshot: 2020-10-12_13-21-16
------------------------------------------------------------------------------
Generating grub configuration file ...
Found theme: /usr/share/grub/themes/garuda/theme.txt
Found linux image: /boot/vmlinuz-linux-zen
Found initrd image: /boot/intel-ucode.img /boot/initramfs-linux-zen.img
Found fallback initrd image(s) in /boot: initramfs-linux-zen-fallback.img
Detecting snapshots ...
Info: Separate boot partition not detected 
Found snapshot: 2020-10-15 08:32:55 | timeshift-btrfs/snapshots/2020-10-15_08-32-55/@
Found snapshot: 2020-10-14 19:05:14 | timeshift-btrfs/snapshots/2020-10-14_19-05-13/@
Found snapshot: 2020-10-14 11:56:40 | timeshift-btrfs/snapshots/2020-10-14_11-56-39/@
Found snapshot: 2020-10-13 20:11:19 | timeshift-btrfs/snapshots/2020-10-13_20-11-19/@
Found snapshot: 2020-10-13 08:51:16 | timeshift-btrfs/snapshots/2020-10-13_08-51-16/@
Found 5 snapshot(s)
Found memtest86+ image: /boot/memtest86+/memtest.bin
done
(2/2) Create a backup list of all installed packages
:: Verarbeite Paketänderungen...
(1/6) Aktualisiere dnssec-anchors                                                       [--------------------------------------------------] 100%
(2/6) Aktualisiere iana-etc                                                             [--------------------------------------------------] 100%
(3/6) Aktualisiere garuda-common-settings                                               [--------------------------------------------------] 100%
Warnung: Verzeichnis-Berechtigungen unterscheiden sich für /etc/sudoers.d/
Dateisystem: 750  Paket: 755
==> Attempting to enable services...Updating font cache... done
==> Adding user 'sgs' to user-group 'input,video,plugdev'
==> services should now be enabled.==> Please add new users to 'audio,video,input,plugdev' group.==> Reboot your system, so changes will take effect..
(4/6) Aktualisiere garuda-i3-settings                                                   [--------------------------------------------------] 100%
==> Attempting to enable services...Updating font cache... done
==> Adding user 'sgs' to user-group 'input,video,plugdev'
==> services should now be enabled.==> Please add new users to 'audio,video,input,plugdev' group.==> Reboot your system, so changes will take effect..
(5/6) Aktualisiere libraw                                                               [--------------------------------------------------] 100%
(6/6) Aktualisiere krita                                                                [--------------------------------------------------] 100%
:: Starte post-transaction hooks...
(1/8) Arming ConditionNeedsUpdate...
(2/8) Foreign/AUR package notification
=> No foreign/AUR packages found.
(3/8) Compiling GSettings XML schema files...
(4/8) Updating icon theme caches...
(5/8) mkinitcpio and grub update after every transaction.
==> Building image from preset: /etc/mkinitcpio.d/linux-zen.preset: 'default'
  -> -k /boot/vmlinuz-linux-zen -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-zen.img
==> Starting build: 5.8.14-zen1-1-zen
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [autodetect]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
==> WARNING: Possibly missing firmware for module: xhci_pci
  -> Running build hook: [keyboard]
  -> Running build hook: [keymap]
  -> Running build hook: [plymouth]
  -> Running build hook: [filesystems]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-linux-zen.img
==> Image generation successful
==> Building image from preset: /etc/mkinitcpio.d/linux-zen.preset: 'fallback'
  -> -k /boot/vmlinuz-linux-zen -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-zen-fallback.img -S autodetect
==> Starting build: 5.8.14-zen1-1-zen
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
==> WARNING: Possibly missing firmware for module: aic94xx
==> WARNING: Possibly missing firmware for module: wd719x
==> WARNING: Possibly missing firmware for module: xhci_pci
  -> Running build hook: [keyboard]
  -> Running build hook: [keymap]
  -> Running build hook: [plymouth]
  -> Running build hook: [filesystems]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-linux-zen-fallback.img
==> Image generation successful
Generating grub configuration file ...
Found theme: /usr/share/grub/themes/garuda/theme.txt
Found linux image: /boot/vmlinuz-linux-zen
Found initrd image: /boot/intel-ucode.img /boot/initramfs-linux-zen.img
Found fallback initrd image(s) in /boot: initramfs-linux-zen-fallback.img
Detecting snapshots ...
Info: Separate boot partition not detected 
Found snapshot: 2020-10-15 08:32:55 | timeshift-btrfs/snapshots/2020-10-15_08-32-55/@
Found snapshot: 2020-10-14 19:05:14 | timeshift-btrfs/snapshots/2020-10-14_19-05-13/@
Found snapshot: 2020-10-14 11:56:40 | timeshift-btrfs/snapshots/2020-10-14_11-56-39/@
Found snapshot: 2020-10-13 20:11:19 | timeshift-btrfs/snapshots/2020-10-13_20-11-19/@
Found snapshot: 2020-10-13 08:51:16 | timeshift-btrfs/snapshots/2020-10-13_08-51-16/@
Found 5 snapshot(s)
Found memtest86+ image: /boot/memtest86+/memtest.bin
done
(6/8) Orphaned package notification
=> No orphans found.
(7/8) Checking for .pacnew and .pacsave files...
.pac* files found:

Please check and merge
(8/8) Updating the desktop file MIME type cache...

 sgs@i3   ~                                                                                         1m 1s   26%   12.43G   1.43   08:33:27

All together you have 1:37 min.
It takes the longest to build the fallback.img


But we know nothing about your system (inxi -Fxxxza),
do you use HDD or SSD or Nvme?

For more feedback I change the
Headline: Why is this happening?
New: Why does it take so long to build fallback.img?

3 Likes
  1. You can disable the creation of a fallback image by removing "fallback" from the preset file in /etc/mkinitcpio.d/
  2. You can change the compression algorithm to e.g. LZ4 in /etc/mkinitcpio.conf
4 Likes

Ahh, no (ups, gzip) is compression used

# COMPRESSION
# Use this to compress the initramfs image. By default, gzip compression
# is used. Use 'cat' to create an uncompressed image.
#COMPRESSION="gzip"
#COMPRESSION="bzip2"
#COMPRESSION="lzma"
#COMPRESSION="xz"
#COMPRESSION="lzop"
#COMPRESSION="lz4"

# COMPRESSION_OPTIONS
# Additional options for the compressor
#COMPRESSION_OPTIONS=()

@librewish

1 Like

With kernel 5.9 you'll get ZSTD as an additional option :wink:

3 Likes

Cool, with lz4 it need 35 sec. instead 1 min.

2 Likes

35 seconds?
mkinitcpio -P (regenerate all) takes about 10 seconds here with 3 kernels and a combination of ZSTD and LZ4, and I can get that down even more if I used the default compression settings.

(fallback is only generated for default linux though).

3 Likes

All together to my last test in post above :slight_smile:

3 Likes

What do I do with the gained time, I send my beloved a nice email :smiley: :wink:

4 Likes

I know, all that effort to save some extra seconds in life. What could you possibly do with all that extra time. :smile:

3 Likes

OT
I became a chain smoker in the waiting time until a 256 KB disk was written (no smoker since 2011).
But today, boot time over 10 sec. is a no-go :smiley:

1 Like

Ahhhm... I'm old school, and boot ttime etc etc is all relevant. Compared to the old days we have nothing to complain about. Booting in the old days took forever, so complaints about boot time these days rather crack me up. But then I started on computers using punch cards. :smile:

4 Likes

Well the 1980s home computers didn't really have boot time at all, you turned it on and the BASIC prompt appeared after one second :slight_smile:

2 Likes

That's right, those were the tube TVs that had a start-up time :smiley: .

It should be only illustration of time (feeling), not a direct comparison.

If we go on like this we will get into trouble with the "falconer" because of the OT. :smiley:

Not the big one the small ein mean :slight_smile:

2020-10-15_11-30

4 Likes

Takes me close to a minute with 1! kernel :joy:
The advantages of having a more recent/better CPU are tempting :sweat_smile:
/ot

2 Likes

Well this is only a dual-core mobile Kaby Lake, not very powerful at all :slight_smile:
I would simply disable the fallback image creation, gives you a nice speed up.

5 Likes