Long boot time, can I speed things up?

When you run into problems installing MX Linux XFCE
Message
Author
Gorštak
Posts: 30
Joined: Wed Mar 06, 2019 2:20 pm

Long boot time, can I speed things up?

#1 Post by Gorštak »

I think my system should boot faster. The shortest boot time gives one debian based distro called Serbian - 13,5 sec, although it is installed on SSD. MX is booted in 62,5 sec.

Code: Select all

root@t1500:/etc/kernel# systemd-analyze time
Startup finished in 37.907s (kernel) + 24.628s (userspace) = 1min 2.536s
root@t1500:/etc/kernel# systemd-analyze critical-chain
The time after the unit is active or started is printed after the "@" character.
The time the unit takes to start is printed after the "+" character.

graphical.target @24.197s
└─multi-user.target @24.197s
  └─ntp.service @19.103s +5.093s
    └─network-online.target @19.101s
      └─NetworkManager-wait-online.service @9.674s +9.425s
        └─NetworkManager.service @5.921s +3.751s
          └─dbus.service @5.043s
            └─basic.target @4.655s
              └─sockets.target @4.655s
                └─cups.socket @4.655s
                  └─sysinit.target @4.574s
                    └─swap.target @4.574s
                      └─dev-disk-by\x2duuid-7d11d927\x2dece8\x2d4463\x2d85c1\x2d0ce1b07ea0aa.swap @4.510s +63ms
                        └─dev-disk-by\x2duuid-7d11d927\x2dece8\x2d4463\x2d85c1\x2d0ce1b07ea0aa.device @4.509s
Here is the plotted graph
https://svgshare.com/i/C0P.svg

Second fastest booting distro is Solus with 18,3 sec on regular, non SSD drive. Lots of distros have prolonged boot time due to change of the swap partition UUID, but i'm fixing that by editing fstab and resume variable in conf.d, but fstab in MX shows correct UUID, and conf.d is empty.

Code: Select all

root@t1500:/etc/kernel# cat /etc/fstab
# Pluggable devices are handled by uDev, they are not in fstab
UUID=15cd3966-5f18-403c-87dd-a3197ae8b5ae / ext4 defaults,noatime 1 1
UUID=7d11d927-ece8-4463-85c1-0ce1b07ea0aa swap swap defauts 0 0 
root@t1500:/etc/kernel# swapon -show
Filename				Type		Size	Used	Priority
/dev/sdc5                              	partition	4204540	0	-2
root@t1500:/etc/kernel# blkid
/dev/sda1: LABEL="w10" UUID="5860D18160D16672" TYPE="ntfs" PARTUUID="c70c5e33-01"
/dev/sda2: LABEL="mint" UUID="00b84654-0f33-4d5b-aa67-ba8236b56638" TYPE="ext4" PARTUUID="c70c5e33-02"
/dev/sda3: LABEL="serbian" UUID="1c33aff6-9f2c-487b-94d4-c622698e08f4" TYPE="ext4" PARTUUID="c70c5e33-03"
/dev/sda5: LABEL="elementary" UUID="c2d310b8-15d1-46aa-aa96-e45cfea85483" TYPE="ext4" PARTUUID="c70c5e33-05"
/dev/sda6: UUID="454cf4a6-a0c9-414c-91ea-1c3c810b6f08" TYPE="swap" PARTUUID="c70c5e33-06"
/dev/sdb1: LABEL="w7" UUID="CE7612AF76129873" TYPE="ntfs" PARTUUID="2bd2c32a-01"
/dev/sdb2: LABEL="fedora" UUID="ed22565e-1ee7-4b5a-913b-411428747907" TYPE="ext4" PARTUUID="2bd2c32a-02"
/dev/sdb3: LABEL="manjaro" UUID="928fb127-4289-446f-8f5a-a9e0612b21b8" TYPE="ext4" PARTUUID="2bd2c32a-03"
/dev/sdb5: UUID="cd4c18a3-f09a-4cb1-8f8c-63d04cc077bf" TYPE="swap" PARTUUID="2bd2c32a-05"
/dev/sdb6: LABEL="solus" UUID="dd0ed7db-4387-442a-a6af-ae1cb81f8b58" TYPE="ext4" PARTUUID="2bd2c32a-06"
/dev/sdb7: LABEL="slackware" UUID="c587e87a-830c-47aa-8831-66e999bfd2aa" TYPE="ext4" PARTUUID="2bd2c32a-07"
/dev/sdb8: LABEL="opensuse" UUID="22a015a6-9b11-4071-8460-a690b87773cd" TYPE="ext4" PARTUUID="2bd2c32a-08"
/dev/sdb9: LABEL="mageia" UUID="e934ebb6-9d19-41b7-ba9e-c3881a95e88f" TYPE="ext4" PARTUUID="2bd2c32a-09"
/dev/sdb10: LABEL="calculate" UUID="48fccc2b-60da-4cb8-9b03-ff8e42f6d23b" TYPE="ext4" PARTUUID="2bd2c32a-0a"
/dev/sdb11: LABEL="wd" UUID="7234121A1B5C0515" TYPE="ntfs" PTTYPE="dos" PARTUUID="2bd2c32a-0b"
/dev/sdc1: LABEL="xp" UUID="38208A61208A264A" TYPE="ntfs" PARTUUID="5eb2898c-01"
/dev/sdc2: LABEL="ubuntu" UUID="45295061-d1fb-46f3-8f79-00f09509a5e0" TYPE="ext4" PARTUUID="5eb2898c-02"
/dev/sdc3: LABEL="kali" UUID="c4e17b36-4ede-4529-96b3-d518e6d634fb" TYPE="ext4" PARTUUID="5eb2898c-03"
/dev/sdc5: UUID="7d11d927-ece8-4463-85c1-0ce1b07ea0aa" TYPE="swap" PARTUUID="5eb2898c-05"
/dev/sdc6: LABEL="debian" UUID="b3518023-78a7-40b8-8a7e-3dbf0e655bee" TYPE="ext4" PARTUUID="5eb2898c-06"
/dev/sdc7: LABEL="mx" UUID="15cd3966-5f18-403c-87dd-a3197ae8b5ae" TYPE="ext4" PARTUUID="5eb2898c-07"
/dev/sdc8: LABEL="hitachi" UUID="6864AAC47EFA0462" TYPE="ntfs" PARTUUID="5eb2898c-08"
/dev/sdc9: LABEL="1T" UUID="29BF50452249AB8D" TYPE="ntfs" PARTUUID="5eb2898c-09"
What else can I do to shorten the boot time.
You do not have the required permissions to view the files attached to this post.

User avatar
chrispop99
Global Moderator
Posts: 3179
Joined: Tue Jan 27, 2009 3:07 pm

Re: Long boot time, can I speed things up?

#2 Post by chrispop99 »

What is the machine specification?

Some older machines boot significantly faster with the 4.9 kernel.

Chris
MX Facebook Group Administrator.
Home-built desktop - Core i5 9400, 970 EVO Plus, 8GB
DELL XPS 15
Lots of test machines

User avatar
rasat
Posts: 644
Joined: Tue Dec 19, 2017 1:19 pm

Re: Long boot time, can I speed things up?

#3 Post by rasat »

Earlier I had similar problem. MX supposed to be less than 15 sec, same as debian Serbian. In my slow boot, the booting was searching for correct UUID. You have installed different distros. Check if UUID is same in both GRUB and /.

Gorštak
Posts: 30
Joined: Wed Mar 06, 2019 2:20 pm

Re: Long boot time, can I speed things up?

#4 Post by Gorštak »

chrispop99 wrote: Mon Mar 25, 2019 8:13 am What is the machine specification?

Some older machines boot significantly faster with the 4.9 kernel.

Chris
Newer kernels (>4.15) can't recognize my hdd drive, different topic, explained here viewtopic.php?f=92&t=48921. I have to use 4.14.

Code: Select all

$ inxi -F
System:    Host: t1500 Kernel: 4.14.0-3-rt-amd64 x86_64 bits: 64 Desktop: Xfce 4.12.3 
           Distro: MX-18.1_x64 Continuum Feb 9  2019 
Machine:   Type: Desktop System: Dell product: Precision T1500 v: 00 serial: <root required> 
           Mobo: Dell model: 0XC7MM v: A01 serial: <root required> BIOS: Dell v: 2.2.0 
           date: 07/06/2010 
CPU:       Topology: Quad Core model: Intel Core i7 870 bits: 64 type: MT MCP L2 cache: 8192 KiB 
           Speed: 1352 MHz min/max: 1200/2934 MHz Core speeds (MHz): 1: 1211 2: 1208 3: 1197 
           4: 1243 5: 1205 6: 1197 7: 1217 8: 1230 
Graphics:  Device-1: AMD Oland PRO [Radeon R7 240/340] driver: radeon v: kernel 
           Display: x11 server: X.Org 1.19.2 driver: ati,radeon unloaded: fbdev,modesetting,vesa 
           resolution: 1680x1050~60Hz 
           OpenGL: renderer: AMD OLAND (DRM 2.50.0 4.14.0-3-rt-amd64 LLVM 7.0.0) 
           v: 4.5 Mesa 18.2.6 
Audio:     Device-1: Intel 5 Series/3400 Series High Definition Audio driver: snd_hda_intel 
           Device-2: AMD Cape Verde/Pitcairn HDMI Audio [Radeon HD 7700/7800 Series] 
           driver: snd_hda_intel 
           Device-3: C-Media CM106 Like Sound Device type: USB 
           driver: hid-generic,snd-usb-audio,usbhid 
           Sound Server: ALSA v: k4.14.0-3-rt-amd64 
Network:   Device-1: Broadcom Limited NetLink BCM57780 Gigabit Ethernet PCIe driver: tg3 
           IF: eth0 state: up speed: 10 Mbps duplex: half mac: a4:ba:db:fb:f9:2d 
Drives:    Local Storage: total: 2.84 TiB used: 831.79 GiB (28.6%) 
           ID-1: /dev/sda vendor: Kingston model: SV300S37A120G size: 111.79 GiB 
           ID-2: /dev/sdb vendor: Western Digital model: WD10EARS-00Y5B1 size: 931.51 GiB 
           ID-3: /dev/sdc vendor: Hitachi model: HDS723020BLA642 size: 1.82 TiB 
Partition: ID-1: / size: 19.56 GiB used: 6.21 GiB (31.7%) fs: ext4 dev: /dev/sdc7 
           ID-2: swap-1 size: 4.01 GiB used: 0 KiB (0.0%) fs: swap dev: /dev/sdc5 
Sensors:   System Temperatures: cpu: 39.0 C mobo: N/A gpu: radeon temp: 36 C 
           Fan Speeds (RPM): cpu: 1507 mobo: 1199 
Info:      Processes: 293 Uptime: 9h 39m Memory: 15.63 GiB used: 956.2 MiB (6.0%) Shell: bash 
           inxi: 3.0.29 

User avatar
BitJam
Developer
Posts: 2283
Joined: Sat Aug 22, 2009 11:36 pm

Re: Long boot time, can I speed things up?

#5 Post by BitJam »

It looks like you are booting with systemd. We normally use sysvint so there is not a lot of systemd expertise here.

Is the live-usb/dvd also this slow?

I downloaded the .svg so I could view it. There is a 38 second delay before systemd starts. When the initrd is done, the next thing it does is hand control to systemd. So I think rasat is right and your initrd is having a hard time finding and/or mounting your root partition. Or there is some other problem in your initrd but finding and mounting the root partition is its primary job and often its only job.
"The first principle is that you must not fool yourself -- and you are the easiest person to fool."

-- Richard Feynman

Gorštak
Posts: 30
Joined: Wed Mar 06, 2019 2:20 pm

Re: Long boot time, can I speed things up?

#6 Post by Gorštak »

Most of the distros got prolonged boot time ater installing a new distro on other partition. Thats mostly due to swap partition formatting during installation and changing its UUID. I fixed MX fstab, grub is rebuilded so all uuids should be updated (didnt check manually). I dont know where else to check for false uuids, but I agree that its probably the most likely cause.
BitJam wrote: Mon Mar 25, 2019 5:19 pm Is the live-usb/dvd also this slow?
No, and neither was the MX untill i installed another distro that messed uuids

User avatar
BitJam
Developer
Posts: 2283
Joined: Sat Aug 22, 2009 11:36 pm

Re: Long boot time, can I speed things up?

#7 Post by BitJam »

Ah, so you just need to fix the uuids and you should be good. Do you want help with this?

The command:

Code: Select all

sudo lsblk -f
should give you the correct uuid.

I *think* you may then just need to edit /etc/default/grub and run grub-update or something but this is not my area of expertise. Most people here (perhaps including you) know more about this than I do.
"The first principle is that you must not fool yourself -- and you are the easiest person to fool."

-- Richard Feynman

User avatar
fehlix
Developer
Posts: 10375
Joined: Wed Apr 11, 2018 5:09 pm

Re: Long boot time, can I speed things up?

#8 Post by fehlix »

Gorštak wrote: Mon Mar 25, 2019 5:26 pm No, and neither was the MX untill i installed another distro that messed uuids
I remember those stuff, when a new installation replaced an exiting swap-partition,
the swap got's a new UUID.
So you check the existing fstab's against the uuid of the swap partions used,
if swap-uuid has changed, you might not only fix the fstab.
OK But probably as the kernel might looks also for about 60 -120 seconds to try to find the swap.
So you need also after having fixed the fstab recreate / update the initrd:

Code: Select all

update-initramfs -u -k all

:puppy:
Gigabyte Z77M-D3H, Intel Xeon E3-1240 V2 (Quad core), 32GB RAM,
GeForce GTX 770, Samsung SSD 850 EVO 500GB, Seagate Barracuda 4TB

User avatar
Stevo
Developer
Posts: 12837
Joined: Fri Dec 15, 2006 8:07 pm

Re: Long boot time, can I speed things up?

#9 Post by Stevo »

Out of curiosity, I see you're running a real-time kernel, which not many of our users do. Is this for multimedia creation reasons?

Gorštak
Posts: 30
Joined: Wed Mar 06, 2019 2:20 pm

Re: Long boot time, can I speed things up?

#10 Post by Gorštak »

fehlix wrote: Mon Mar 25, 2019 7:13 pm So you need also after having fixed the fstab recreate / update the initrd:
Great! This is exactly what I was looking for :clap:

Code: Select all

update-initramfs: Generating /boot/initrd.img-4.14.0-3-rt-amd64
I: The initramfs will attempt to resume from /dev/sdc5
I: (UUID=7d11d927-ece8-4463-85c1-0ce1b07ea0aa)
I: Set the RESUME variable to override this.

Code: Select all

$ systemd-analyze time
Startup finished in 6.520s (kernel) + 25.520s (userspace) = 32.041s
You guys are great! Never been a part of a forum so helpful as this one!!! :number1:
Do you think I can shorten the userspace boot time too?


EDITED: deleted some parts i posted as errors, but i realized i was wrong



Stevo wrote: Mon Mar 25, 2019 8:31 pm Out of curiosity, I see you're running a real-time kernel, which not many of our users do. Is this for multimedia creation reasons?
You got me there... :embarrassed: I dont even know what a real-time kernel is. I get its the "rt" in the filename, but I dont know what does it means. I was checking out all available kernels to pinpoint the error in hdd control module and I kept the latest kernel that worked for me.

Post Reply

Return to “Installation”