Skip to main content

Questions tagged [defragmentation]

The process of arranging blocks on the filesystem to optimize disk read access.

0 votes
2 answers
191 views

How to defragment compressed btrfs files?

If I defragment files on btrfs with the command btrfs filesystem defrag --step 1G file Everything is fine. A filefrag -v file clearly show, the extent count significantly decreased. Things are very ...
peterh's user avatar
  • 10.5k
0 votes
0 answers
82 views

ZFS send much slower than before

With the exact same devices (computer, external hard drive…), my ZFS backup (via zfs send | zfs recv) takes much longer than before. Now, it takes around 1.5 to 2.2mn to copy 1Go, but before I think ...
tobiasBora's user avatar
  • 4,671
0 votes
1 answer
297 views

Encrypted LUKS fs inside a file: sparse or not?

I have a LUKS encrypted file filled with around 160 GB of data that I use a lot. For safety, I created the file with 400 GB.  That is, of course, a lot of wasted space.  So I switched to a sparse file,...
Luis A. Florit's user avatar
3 votes
0 answers
228 views

What is "external fragmentation" in a file system?

I'm using EXT4, but I think my question concerns all Unix/Linux file systems. This 2022 answer to "Difference between fragment and extent in ext4" states that: External fragmentation occurs ...
ChennyStar's user avatar
  • 1,979
0 votes
0 answers
59 views

Is theire any specific caution to take before resize btrfs

Current situation I have an almost full /home partition, with just 4.4Go remaining space, when my / is more than half empty. Both of the two partitions are in Btrfs, as you can see: % lsblk -o NAME,...
fauve's user avatar
  • 1,529
1 vote
1 answer
3k views

BTRFS - How to reclaim unused space in each chunk used and compact the filesystem, basically defrag free space?

How to reclaim unused space from each chunk used by BTRFS filesystem? Let's say there are lots of chunks partially used from 10% to 50% utilised per chunk, how do I defragment those so that the 90% to ...
DanglingPointer's user avatar
6 votes
1 answer
453 views

I observe using `dd if=filein of=fileout` lead to filesystem fragmentation, what do I have to change?

There was a nice question that sadly got deleted while I was writing a rather extensive answer :( Not wanting to let that effort go to waste, let me paraphrase that question from the question text and ...
Marcus Müller's user avatar
3 votes
0 answers
1k views

How to get a Btrfs filesystem fragmentation count?

The btrfs check command output doesn't mention how many files are fragmented like e4defrag -c or e2fsck with ext4 filesystems. What command can give the number of fragmented files on a whole Btrfs ...
erik's user avatar
  • 51
0 votes
2 answers
1k views

Effects of copy (cp) vs cut (mv) on file systems

When you have to move a file to a different location in the same file system, you have two options: just cut-paste (or mv), or copy-paste (cp) and then delete the old copy. I'm wondering what are the ...
reed's user avatar
  • 109
1 vote
1 answer
581 views

Identify if IO bottleneck is read or write

I use ddrescue to image failing disk to sparse files - often the files become highly fragmented (>50k fragments). I suspect that sometimes the imaging speed degrades because of the fragmentation. Is ...
Reinstate Monica's user avatar
2 votes
0 answers
513 views

Simultaneous copy from multiple sources without fragmenting destination

I regularly need to copy large datasets from multiple smaller drives to a larger one. Lately I've been using a WD Easystore 12TB External USB 3.0 Hard Drive as my destination. Copying all the files ...
Pascal's user avatar
  • 323
0 votes
1 answer
789 views

How can I disable ext4's automatic defragmentation?

I'm running tests that require some files to be heavily fragmented. I came up with a method to generate fragmented files, but something is working in the background to defragment them. I'm using ...
Daffy's user avatar
  • 465
2 votes
1 answer
590 views

Does BTRFS's compress logic apply when defragmenting?

When mounting a BTRFS filesystem with the compression option, BTRFS will selectively compress files depending on whether they are deemed compressible or not. Does this same logic apply when ...
dippynark's user avatar
  • 337
1 vote
0 answers
88 views

Completely defragmenting a FAT32 filesystem [duplicate]

Is there any Linux tool that allows defragmenting a FAT32 filesystem not on a best effort basis, but so that all files are guaranteed to be stored contiguously with no exceptions? Possibly writing the ...
rkreis's user avatar
  • 27
5 votes
1 answer
4k views

Understanding main memory fragmentation and hugepages

I have a machine that is intended for general use and which I also used to run a QEMU virtual machine. Because the virtual machine should be as performant as possible, I want to back the VM memory ...
Max Ehrlich's user avatar

15 30 50 per page