this post was submitted on 31 May 2026
22 points (100.0% liked)

Linux

65564 readers
214 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 7 years ago
MODERATORS
 

I ran compsize on my debian box. Most files on my btrfs drive are around 20 GB. Almost all are uncompressed. I have 6000 files and 221000 regular extents.

Is that too much fragmentation? The ideal case is 1 extent per file.

I am reading around 100 MiBps from the drive out of a theoretical max of ~119 MiBps on a 1 Gbps line.

edit: On a local read I am getting 130-150 MiBps which exceeds the 1 Gbps network. pv /path/to/file >/dev/null

edit 2: For reference, this is a WD Red 6TB drive from around 2018-2020. Max speed should be in the 200 - 250 MBps range.

I defragged a ~300 GB folder and deleted some unneeded files. Extents per file actually went up, but I think that's because the remaining files are heavily fragmented (many 70+ extents per file). Somewhat surprisingly, most/all of the defragged files still had 3-10 extents. Each file is under 2 GB.

Before: ~35 extents per file. After: 55 extents per file.

compsize /path/to/folder
Processed 2648 files, 145287 regular extents (145287 refs), 1 inline.
Type       Perc     Disk Usage   Uncompressed Referenced
TOTAL       99%      1.5T         1.5T         1.5T
none       100%      1.5T         1.5T         1.5T
zstd        19%      236M         1.1G         1.1G
you are viewing a single comment's thread
view the rest of the comments
[–] just_another_person@lemmy.world 3 points 18 hours ago

I don't think it could possibly be measured because it's something like: (file size ÷ block size) * num_writes

So it entire depends on the types of files, how often you're utilizing writes to disk...etc. I just wouldn't worry about it. If you REALLY want to estimate the tax: use iostat to check the number of writes on the drive in the last 24 hours, THEN enable online defrag and check it again in 24 hours. See what the difference is.

It really doesn't matter for HDD though. Barely probably matters for SSD.