1

Why fsck is so slow on ext4 filesystem? I was always using reiserfs or xfs and with those systems fsck was really fast, just few seconds. Now i decided to give a try ext4 but i'm dissapointed that everytime the system has to fsck my homedir it takes ages (can be 25minutes on my 250GB home partition that is 85% full). Maybe it's because it was converted from ext3?

4 Answers 4

3

Recreating your filesystem with the additional options "-O extent,uninit_bg" will improve your ext4 fsck time.

  • "extent" will reduce the metadata overhead of large files
  • "uninit_bg" will create a fs without initializing all of the block groups. This will improve mkfs and fsck because there's less metadata to check (at least as long as your fs is not full).
2
  • 1
    True. especially the uninit_bg option will help tremendously to speed up fsck. I believe Ubuntu 9.04 enables this option by default if you create a new ext4 fs. Aug 23, 2009 at 11:04
  • There was also speed improvements by using 'flex_bg' option: linux-kongress.org/2009/slides/… ( Reduces pass 2 times by 46% (11.81 seconds vs. 6.34 seconds) )
    – 16851556
    Sep 17, 2022 at 20:22
2

Conversions from ext3 will not fully utilize extents. It simply upgrades the inodes and leaves them as extents of size 1. If you run the files through a program like tar, you might be able to acquire better compressed extents files.

It also matters how you converted from ext3 to ext4; different options have different capabilities and may impact fsck time. Additionally, I think a full drive is going to take longer to fsck; you're checking some 200GB worth of data after all, and probably tripled the size inodes take up.

What you might do is file a bug with the distribution who built the kernel you're using, or the kernel bugzilla directly. This is the sort of behavior that upstream is interested in diagnosing and fixing, after all.

1

My 400GB ext3 partition also takes an annoying long time during fsck. In addition, as volumes get larger, fsck will take too long. Quoting this article:

1 EB (Exabyte) is going to be more than enough storage for a very long time – indeed a complete e2fsck run on a file system of this size would (on current hardware) take more than 100 years.

So, I really hope filesystems and their tools get better very soon, or else running fsck on them will be unfeasible.

1
  • well, over a single SATA 3 link (assuming 0.6 GByte/s) it would take more than 50 years just to read one Exabyte... Jan 29, 2011 at 18:06
1

I have run fsck -V -y twice on my 2TB RAID1 ext4 USB-mounted LaCie disks. In each case, the process ran 24 hours with visible progress but without completing. In each case, I killed the process and ran fsck -V -C -y which finished in minutes. Parameter -C is just supposed to provide a progress bar, but it seems to cancel some huge timewaster as well.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .