boot speed and btrfs (not about btrfs any more)

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
halfshavedyaks
Level 1
Level 1
Posts: 36
Joined: Sat Dec 08, 2018 12:32 pm

boot speed and btrfs (not about btrfs any more)

Post by halfshavedyaks »

I'd like to speed up the boot speed of my machine(s)

here is what it is doing now:

Code: Select all

systemd-analyze time
Startup finished in 16.524s (firmware) + 7.229s (loader) + 37.153s (kernel) + 4.585s (userspace) = 1min 5.493s
graphical.target reached after 4.206s in userspace

Code: Select all

systemd-analyze blame
          1.833s dev-mapper-mint\x2d\x2dvg\x2droot.device
          1.289s ufw.service
          1.046s NetworkManager.service
           766ms ubuntu-system-adjustments.service
           763ms udisks2.service
           718ms grub-common.service
           705ms apport.service
           646ms systemd-tmpfiles-setup-dev.service
           587ms lvm2-pvscan@8:2.service
           494ms systemd-journal-flush.service
           477ms systemd-fsck@dev-disk-by\x2duuid-B45D\x2dB97C.service
           402ms networking.service
           376ms networkd-dispatcher.service
           359ms thermald.service
           356ms systemd-logind.service
           354ms kerneloops.service
           317ms avahi-daemon.service
           283ms hddtemp.service
           208ms wpa_supplicant.service
           207ms systemd-udevd.service
           174ms media-hyperarboreal-lilac.mount
           167ms lvm2-monitor.service
           158ms gpu-manager.service
as you can see I have removed some standard services I don't think are necessary for me.

However with quiet splash turned off in grub the output hangs at "scanning btrfs filesystem" for about 30 seconds.

I have removed btrfs-tools but I still get the message and the delay.

how can I prevent the scan? I don't use btrfs (AFAICT)
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
mrmajik45

Re: boot speed and btrfs

Post by mrmajik45 »

Code: Select all

sudo update-initramfs -u
should update your initramfs and remove the old btrfs "check"
User avatar
Larry78723
Level 14
Level 14
Posts: 5476
Joined: Wed Jan 09, 2019 7:01 pm
Location: Jasper County, SC, USA

Re: boot speed and btrfs

Post by Larry78723 »

open a terminal full screen and enter the following command

Code: Select all

blkid
• Mark the complete text output which the command will display with your mouse.
• Press the keyboard shortcut <Shift><Ctrl>C to copy the marked text into the clipboard.
• Enclose the results between the code markers by selecting </> from the mini toolbar above the textbox where you type your reply then paste <Ctrl>V them in your reply between the code markers.
The results will help us to help you.
Image
If you have found the solution to your initial post, please open your original post, click on the pencil, and add (Solved) to the Subject, it helps other users looking for help, and keeps the forum clean.
halfshavedyaks
Level 1
Level 1
Posts: 36
Joined: Sat Dec 08, 2018 12:32 pm

Re: boot speed and btrfs

Post by halfshavedyaks »

thanks! I had just found that.

i just did that and the check is gone.

however it only saved about 1 second.

It seems the delay is not the btrfs scan - so how do I tell what it is?
halfshavedyaks
Level 1
Level 1
Posts: 36
Joined: Sat Dec 08, 2018 12:32 pm

Re: boot speed and btrfs

Post by halfshavedyaks »

Larry78723 wrote: Fri Jul 05, 2019 7:44 pm open a terminal full screen and enter the following command

Code: Select all

blkid
OK it is:

blkid
/dev/sda1: UUID="B45D-B97C" TYPE="vfat" PARTUUID="534e5699-911e-40af-9a37-5309fec61d5b"
/dev/sda2: UUID="dTF8lN-IapU-PQj1-mCLh-l0gt-8Gw5-eYuiQg" TYPE="LVM2_member" PARTUUID="1b303576-f97d-4b1c-88e3-f36c4e831373"
/dev/sdb1: LABEL="lilac" UUID="fc90704a-87bc-4433-b167-c7b31265e8a1" TYPE="ext4" PARTUUID="9c7078c2-c08f-4f8a-969d-cc9d2cd2eb9d"
/dev/sdb2: LABEL="mauve" UUID="83a41881-bc24-410c-b954-1e7716d3264b" TYPE="ext4" PARTUUID="17382ab1-f2db-4c19-b562-413be07fa690"
/dev/mapper/mint--vg-root: UUID="5a0bb7c2-5079-4352-8618-a34c5ecae38e" TYPE="ext4"
halfshavedyaks
Level 1
Level 1
Posts: 36
Joined: Sat Dec 08, 2018 12:32 pm

Re: boot speed and btrfs

Post by halfshavedyaks »

here's my system specs - it would be great to know what sort of boot time is to be expected.

inxi -Fxz
System:
Host: thingi5 Kernel: 5.0.0-20.1-liquorix-amd64 x86_64 bits: 64
compiler: gcc v: 7.4.0 Desktop: Cinnamon 4.0.10
Distro: Linux Mint 19.1 Tessa base: Ubuntu 18.04 bionic
Machine:
Type: Desktop Mobo: ASUSTeK model: TUF Z270 MARK 1 v: Rev 1.xx
serial: <filter> UEFI: American Megatrends v: 1009 date: 07/23/2017
CPU:
Topology: Quad Core model: Intel Core i5-7600K bits: 64 type: MCP
arch: Kaby Lake rev: 9 L2 cache: 6144 KiB
flags: lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 30336
Speed: 800 MHz min/max: 800/4200 MHz Core speeds (MHz): 1: 800 2: 800
3: 800 4: 800
Graphics:
Device-1: NVIDIA GP107 [GeForce GTX 1050] vendor: ASUSTeK driver: nvidia
v: 390.116 bus ID: 01:00.0
Display: x11 server: X.Org 1.19.6 driver: nvidia
unloaded: fbdev,modesetting,nouveau,vesa resolution: 3840x2160~60Hz
OpenGL: renderer: GeForce GTX 1050/PCIe/SSE2 v: 4.6.0 NVIDIA 390.116
direct render: Yes
Audio:
Device-1: Intel 200 Series PCH HD Audio vendor: ASUSTeK
driver: snd_hda_intel v: kernel bus ID: 00:1f.3
Device-2: NVIDIA GP107GL High Definition Audio vendor: ASUSTeK
driver: snd_hda_intel v: kernel bus ID: 01:00.1
Device-3: AKAI Professional M.I. type: USB driver: snd-usb-audio
bus ID: 1-1:2
Device-4: Focusrite-Novation RemoteSL + ZeroSL type: USB
driver: snd-usb-audio bus ID: 1-9:8
Device-5: Van Ooijen Technische Informatica Free shared USB VID/PID pair
for MIDI devices
type: USB driver: snd-usb-audio bus ID: 1-10:9
Sound Server: ALSA v: k5.0.0-20.1-liquorix-amd64
Network:
Device-1: Intel Ethernet I219-V vendor: ASUSTeK driver: e1000e v: 3.2.6-k
port: f000 bus ID: 00:1f.6
IF: enp0s31f6 state: up speed: 1000 Mbps duplex: full mac: <filter>
Device-2: Intel I211 Gigabit Network vendor: ASUSTeK driver: igb
v: 5.4.0-k port: d000 bus ID: 04:00.0
IF: enp4s0 state: down mac: <filter>
IF-ID-1: tun0 state: unknown speed: 10 Mbps duplex: full mac: N/A
Drives:
Local Storage: total: 1.93 TiB used: 423.95 GiB (21.5%)
ID-1: /dev/sda model: SATA SSD size: 111.79 GiB
ID-2: /dev/sdb vendor: Western Digital model: WD20PURZ-85GU6Y0
size: 1.82 TiB
Partition:
ID-1: / size: 93.35 GiB used: 40.71 GiB (43.6%) fs: ext4 dev: /dev/dm-0
ID-2: swap-1 size: 15.94 GiB used: 0 KiB (0.0%) fs: swap dev: /dev/dm-1
Sensors:
System Temperatures: cpu: 28.0 C mobo: N/A gpu: nvidia temp: 53 C
Fan Speeds (RPM): cpu: 0 gpu: nvidia fan: 0%
Info:
Processes: 215 Uptime: 16m Memory: 15.60 GiB used: 1.31 GiB (8.4%)
Init: systemd runlevel: 5 Compilers: gcc: 7.4.0 clang: 6.0.0-1ubuntu2
Shell: bash v: 4.4.19 inxi: 3.0.27
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: boot speed and btrfs

Post by MrEen »

Is there a specific reason you chose that kernel? The one you're using is causing the largest percentage of your boot time.

EDIT: Just saw the Audio section of your inxi output. I think I get it now.
halfshavedyaks
Level 1
Level 1
Posts: 36
Joined: Sat Dec 08, 2018 12:32 pm

Re: boot speed and btrfs

Post by halfshavedyaks »

MrEen wrote: Fri Jul 05, 2019 8:10 pm Is there a specific reason you chose that kernel? The one you're using is causing the largest percentage of your boot time.

EDIT: Just saw the Audio section of your inxi output. I think I get it now.
I chose the liquorix kernel because I need a preempt kernel for decent low latency audio performance, but the stock low-latency kernel is incompatible with nvidia graphics drivers.

However I haven't noticed any significant difference in boot times when i have booted using the generic kernel.

So I think that yes whatever is taking time is in the kernel, but that it is common to most current kernels since it doesn't change noticeably when I change kernel.

The message I now get just before the text output on boot pauses (at the point where it has btrfs before) is about firewire.

I have an firewire PCIE card to run my audio interface from. It works fine but I guess there could be an issue at boot with it, or it could be coincidence that that is the last message before the pause. I don't know anything like enough to tell if the firewire system is actually implicated or not.

here is the section of lshw relating to the firewire card.

*-pci:5
description: PCI bridge
product: 200 Series PCH PCI Express Root Port #8
vendor: Intel Corporation
physical id: 1c.7
bus info: pci@0000:00:1c.7
version: f0
width: 32 bits
clock: 33MHz
capabilities: pci pciexpress msi pm normal_decode bus_master cap_list
configuration: driver=pcieport
resources: irq:122 memory:df100000-df2fffff
*-pci
description: PCI bridge
product: XIO2213A/B/XIO2221 PCI Express to PCI Bridge [Cheetah Express]
vendor: Texas Instruments
physical id: 0
bus info: pci@0000:06:00.0
version: 01
width: 32 bits
clock: 33MHz
capabilities: pci pm msi pciexpress normal_decode bus_master cap_list
resources: memory:df200000-df200fff memory:df100000-df1fffff
*-firewire
description: FireWire (IEEE 1394)
product: XIO2213A/B/XIO2221 IEEE-1394b OHCI Controller [Cheetah Express]
vendor: Texas Instruments
physical id: 0
bus info: pci@0000:07:00.0
version: 01
width: 32 bits
clock: 66MHz
capabilities: pm ohci bus_master cap_list
configuration: driver=firewire_ohci latency=32 maxlatency=4 mingnt=2
resources: irq:19 memory:df104000-df1047ff memory:df100000-df103fff
halfshavedyaks
Level 1
Level 1
Posts: 36
Joined: Sat Dec 08, 2018 12:32 pm

Re: boot speed and btrfs

Post by halfshavedyaks »

interestingly the boot times are not consistent.

My latest boot from cold (not a restart) gave me this:

systemd-analyze time
Startup finished in 22.542s (firmware) + 32.300s (loader) + 36.042s (kernel) + 4.466s (userspace) = 1min 35.351s
graphical.target reached after 3.627s in userspace

firmware and loader times are noticably longer.

the one second saving on kernel from earlier is probabaly due to disabling btrfs

however blame gives a different mix of things, none very concerning although I intend to disable apt-daily-upgrade.service

1.575s apt-daily-upgrade.service
1.314s dev-mapper-mint\x2d\x2dvg\x2droot.device
1.061s ufw.service
1.054s udisks2.service
880ms networkd-dispatcher.service
774ms systemd-tmpfiles-setup-dev.service
730ms systemd-modules-load.service
609ms NetworkManager.service
594ms systemd-journal-flush.service
524ms networking.service
516ms ubuntu-system-adjustments.service
448ms hddtemp.service
433ms apport.service
428ms systemd-logind.service
417ms avahi-daemon.service
413ms thermald.service
407ms rsyslog.service
406ms gpu-manager.service
406ms pppd-dns.service
376ms lvm2-pvscan@8:2.service
240ms systemd-fsck@dev-disk-by\x2duuid-B45D\x2dB97C.service
193ms media-hyperarboreal-mauve.mount
177ms dns-clean.service
141ms media-hyperarboreal-lilac.mount
138ms systemd-udevd.service
136ms systemd-timesyncd.service
135ms grub-common.service
128ms systemd-resolved.service
111ms lightdm.service
101ms wpa_supplicant.service
100ms lvm2-monitor.service
97ms systemd-journald.service
halfshavedyaks
Level 1
Level 1
Posts: 36
Joined: Sat Dec 08, 2018 12:32 pm

Re: boot speed and btrfs

Post by halfshavedyaks »

another boot (shutdown then restart) and I'm back to something like the previous times.

systemd-analyze time
Startup finished in 16.429s (firmware) + 6.163s (loader) + 36.058s (kernel) + 3.875s (userspace) = 1min 2.526s
graphical.target reached after 3.868s in userspace

I guess 1 min isn't really too bad a boot time. However the audio system has a bit of a tendency to get in a tangle and need restarting so reducing it has more effect on my life and the usability of the system than you might imagine!
halfshavedyaks
Level 1
Level 1
Posts: 36
Joined: Sat Dec 08, 2018 12:32 pm

Re: boot speed and btrfs (not about btrfs any more)

Post by halfshavedyaks »

with generic kernel:

Code: Select all

 uname -a
Linux bigbox 5.0.0-20-generic #21~18.04.1-Ubuntu SMP Thu Jun 27 04:04:37 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Code: Select all

systemd-analyze time
Startup finished in 16.446s (firmware) + 7.635s (loader) + 37.536s (kernel) + 6.180s (userspace) = 1min 7.799s
graphical.target reached after 6.159s in userspace

Code: Select all

systemd-analyze blame
4.540s dev-mapper-mint\x2d\x2dvg\x2droot.device
          4.048s ufw.service
          3.348s systemd-journal-flush.service
          2.164s systemd-udevd.service
          1.988s lvm2-monitor.service
          1.978s keyboard-setup.service
          1.966s systemd-journald.service
          1.952s systemd-modules-load.service
          1.927s systemd-remount-fs.service
          1.925s blk-availability.service
          1.922s kmod-static-nodes.service
           406ms apparmor.service
           323ms lvm2-pvscan@8:2.service
           213ms udisks2.service
           211ms systemd-logind.service
           177ms media-hyperarboreal-lilac.mount
           176ms systemd-fsck@dev-disk-by\x2duuid-B45D\x2dB97C.service
           146ms upower.service
           113ms NetworkManager.service
           102ms dns-clean.service
            96ms ubuntu-system-adjustments.service
            91ms networkd-dispatcher.service
halfshavedyaks
Level 1
Level 1
Posts: 36
Joined: Sat Dec 08, 2018 12:32 pm

Re: boot speed and btrfs (not about btrfs any more)

Post by halfshavedyaks »

I'll ask my 2 questions again here then start a new thread if still unresolved as the questions have diverged from my initial one:

1. Why does the text output on startup (assuming quiet splash is off) go silent for around 30 seconds in the middle?

1a. Is it actually hanging there or is it doing something useful but with no output?

2. What is a realistic good boot time for a machine of my type on Mint 19.1

2a. Can Mint ever boot as fast as windows on this hardware?

Bonus question: what does the "firmware" time in the "systemd-analyze time" output actually refer to and can it be reduced with (perhaps) bios changes?

Bonus bonus question:: My system has 3 drives: Mint, MacOs/Hackintosh, Windows. They are entirely separate with separate bootloaders and I switch between them by turning the power on or off to the relevant drives. Am I confusing my UEFI bios by taking this approach and thus slowing boot times? (sharing bootloaders seems to cause way too many difficulties).
User avatar
Larry78723
Level 14
Level 14
Posts: 5476
Joined: Wed Jan 09, 2019 7:01 pm
Location: Jasper County, SC, USA

Re: boot speed and btrfs (not about btrfs any more)

Post by Larry78723 »

I'd be interested in seeing the results of journalctl -b. The output is too large to post but if you run the command

Code: Select all

journalctl -b > journalctl.txt
and post it to a file sharing site, you could post the address of that file here. It would definitely reveal exactly where that 30 sec delay is happening.
Image
If you have found the solution to your initial post, please open your original post, click on the pencil, and add (Solved) to the Subject, it helps other users looking for help, and keeps the forum clean.
halfshavedyaks
Level 1
Level 1
Posts: 36
Joined: Sat Dec 08, 2018 12:32 pm

Re: boot speed and btrfs (not about btrfs any more)

Post by halfshavedyaks »

That log looks useful in general - but it doesn't show any delays - it covers a 10 second period up to "startup complete" and some other stuff after according to it's own timestamps. I'm not sure I believe it entirely - the whole startup process takes longer than the time it has logged.

the only delay of longer than one second it when (I think) it is waiting for me to type my password, that's a approx 2 sec delay

when it is booting the pause happens just after enumerating USB devices and creating the firewire device.

in the log those events happen and are followed immediately by others with no pause.

I'll post the log in a bit when I find a spot to do it - if you still think it is useful.
Locked

Return to “Installation & Boot”