Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Kernel & Hardware
  • Search

[SOLVED] How to turn off ext4lazyinit?

Kernel not recognizing your hardware? Problems with power management or PCMCIA? What hardware is compatible with Gentoo? See here. (Only for kernels supported by Gentoo.)
Post Reply
Advanced search
11 posts • Page 1 of 1
Author
Message
Carlosk465
Tux's lil' helper
Tux's lil' helper
Posts: 78
Joined: Sun May 29, 2022 10:35 pm

[SOLVED] How to turn off ext4lazyinit?

  • Quote

Post by Carlosk465 » Tue Apr 02, 2024 3:59 pm

I have searched a lot but I did not find the solution, I need to turn off ext4lazyinit so that the system starts faster, when plasma starts it stays stuck for about 3 seconds.

I have read that I need to force it to terminate but this does not work, it keeps starting at the beginning.

I don't like this lazy behavior, how can I disable it? I guess this is the same culprit why the progress bar when copying files doesn't work.

Any file system with which I can format my drive that works without needing "ext4lazyinit" (evidently this is only for ext4 but I suppose other formats will have their equivalent)?


By the way, I have a 2Tb HDD and about 25Gb free, just for data, this is the problematic HDD (I don't even have /home on this disk and it still makes the system slow when starting kde plasma.), because if I remove it it works fine, I have another 120 Gb SSD for the system.
Last edited by Carlosk465 on Wed Apr 03, 2024 2:51 pm, edited 1 time in total.
Sorry for my way of writing, I try to ensure that the translator translates correctly and does not change the words.
Top
pietinger
Moderator
Moderator
Posts: 6608
Joined: Tue Oct 17, 2006 5:11 pm
Location: Bavaria

  • Quote

Post by pietinger » Tue Apr 02, 2024 4:14 pm

Does this help ?
https://fedetft.wordpress.com/2022/01/2 ... alization/
https://wiki.gentoo.org/wiki/User:Pietinger --> https://wiki.gentoo.org/wiki/User:Pieti ... _at_Gentoo
Top
Hu
Administrator
Administrator
Posts: 24380
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Tue Apr 02, 2024 4:25 pm

According to man mke2fs, you can set lazy_itable_init=0 to instruct that the inode table be initialized immediately. This will make the mkfs slower.

Alternatively, let the kernel finish initializing the inode table. This is a one-time operation. Once finished, it will not need to be done again.
Top
Carlosk465
Tux's lil' helper
Tux's lil' helper
Posts: 78
Joined: Sun May 29, 2022 10:35 pm

  • Quote

Post by Carlosk465 » Tue Apr 02, 2024 4:52 pm

Hu wrote:Alternatively, let the kernel finish initializing the inode table. This is a one-time operation. Once finished, it will not need to be done again.
I did this, but it didn't take a minute, it still starts every time but after a few minutes it stops appearing in the list of processes. Eeven a simple "ls" takes a long time if I enter through tty.
Sorry for my way of writing, I try to ensure that the translator translates correctly and does not change the words.
Top
pietinger
Moderator
Moderator
Posts: 6608
Joined: Tue Oct 17, 2006 5:11 pm
Location: Bavaria

  • Quote

Post by pietinger » Tue Apr 02, 2024 4:56 pm

Have you done this ?

mount -o init_itable=0 <partition> <mountpoint>
https://wiki.gentoo.org/wiki/User:Pietinger --> https://wiki.gentoo.org/wiki/User:Pieti ... _at_Gentoo
Top
Carlosk465
Tux's lil' helper
Tux's lil' helper
Posts: 78
Joined: Sun May 29, 2022 10:35 pm

  • Quote

Post by Carlosk465 » Tue Apr 02, 2024 6:16 pm

pietinger wrote:Have you done this ?

mount -o init_itable=0 <partition> <mountpoint>
Wasn't this the command to finish creating the inodes? It only took a few seconds.
Sorry for my way of writing, I try to ensure that the translator translates correctly and does not change the words.
Top
Hu
Administrator
Administrator
Posts: 24380
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Tue Apr 02, 2024 8:31 pm

Yes, it is. How did you determine that inode creation is not finished?
Top
Carlosk465
Tux's lil' helper
Tux's lil' helper
Posts: 78
Joined: Sun May 29, 2022 10:35 pm

  • Quote

Post by Carlosk465 » Tue Apr 02, 2024 10:07 pm

Because I have high disk activity only at power on, then it goes down and the process disappears from the list, I have also checked the file system, I have seen the SMART data. and I can't think of anything else it could be.
Sorry for my way of writing, I try to ensure that the translator translates correctly and does not change the words.
Top
Adarion
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 78
Joined: Mon Aug 22, 2005 9:17 pm

  • Quote

Post by Adarion » Wed Apr 03, 2024 10:39 am

(my 2 cents:)
as far as I know (and always do) during FS creation

# mkfs.ext4 -E lazy_itable_init=0,lazy_journal_init=0 -other-options /dev/...

Other than that, as people wrote, it should be a one time process, so after mounting the FS it will churn on the HDD for a while and then (hopefully) be finished.
Not sure if it can be done also via tune2fs or something.

PS: To speed up things there can also be many other issues and bottlenecks.
setting "noatime" in the fstab mount options can speed up things a little (and saves write cycles on SSDs). One can optimize things during fsck and back in the days of HDDs there was also e4rat (which is not improving things on flash media, though).
But there could also be other things slowing down KDE upbringing.
stop tcpa, swpatents, corrupt politicians and other scary stuff
Top
tholin
Apprentice
Apprentice
Posts: 213
Joined: Sat Oct 04, 2008 11:44 am

  • Quote

Post by tholin » Wed Apr 03, 2024 12:25 pm

the ext4lazyinit kernel thread is used for two things:
* do lazy init of ext4 inoded after mkfs.
* prefetch block bitmaps on every mount so that the block allocator can make better decisions early on.

You are probably seeing the prefetch. This feature was turn on by default in kernel v5.13. If you don't like it you could use the ext4 mount option "no_prefetch_block_bitmaps".

https://github.com/torvalds/linux/commi ... 01b0b85437
Top
Carlosk465
Tux's lil' helper
Tux's lil' helper
Posts: 78
Joined: Sun May 29, 2022 10:35 pm

  • Quote

Post by Carlosk465 » Wed Apr 03, 2024 2:50 pm

tholin wrote:the ext4lazyinit kernel thread is used for two things:
* do lazy init of ext4 inoded after mkfs.
* prefetch block bitmaps on every mount so that the block allocator can make better decisions early on.

You are probably seeing the prefetch. This feature was turn on by default in kernel v5.13. If you don't like it you could use the ext4 mount option "no_prefetch_block_bitmaps".

https://github.com/torvalds/linux/commi ... 01b0b85437
It worked, now the startup time is super fast, no_prefetch_block_bitmaps was the solution. :D :D :D :D :D
Sorry for my way of writing, I try to ensure that the translator translates correctly and does not change the words.
Top
Post Reply

11 posts • Page 1 of 1

Return to “Kernel & Hardware”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy