Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [defragmentation]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
24 views

Deleting an entry from the ext2 directory entry list

From this question, which references this site, I understand that when an entry in a directory is deleted, the size of the previous entry is pushed to the next entry or to the end of the block ...
Mora's user avatar
  • 1
3 votes
0 answers
106 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,765
0 votes
0 answers
55 views

Memory Limits (UM, UME, UMEH)

I have a system where multiple servers are all set up in the same way with the same specs. These are dedicated to processing recordings of online meetings, as well as transferring audio and video via ...
gtilflm's user avatar
0 votes
0 answers
21 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,248
1 vote
1 answer
492 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
370 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
933 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
  • 41
1 vote
1 answer
824 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
  • 111
1 vote
1 answer
425 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
457 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
694 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
  • 405
2 votes
1 answer
512 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
  • 327
1 vote
0 answers
77 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
3k 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
2 votes
2 answers
120 views

Switching from Win10 to Linux: AV, defrag, disk cleanup tools, etc [closed]

I installed Linux Mint on my desktop in place of Windows 10. I am used to having virus/malware Scanners, defragmenters, Disk Clean up tools etc. I was wondering if people here would be able to ...
SupGen's user avatar
  • 51
8 votes
1 answer
4k views

How to cause the kernel to compact fragmented memory

I am running Fedora 26. This is for a very strange assignment given by my algorithms professor. The assignment says: Memory fragmentation in C: Design, implement, and execute a C-program that ...
xylafur's user avatar
  • 83
-1 votes
1 answer
92 views

Do rolling releases inevitably cause higher fragmentation over time than point releases? [closed]

Let's compare Debian Stable as a candidate for point releases and Arch Linux as a candidate for rolling releases: Does a rolling release by default cause higher fragmentation on the drive than a ...
Dave's user avatar
  • 1,036
3 votes
1 answer
430 views

How to defragment files in size less than 100MB only in ext4 filesystem

I have a very basic idea: I would like to defragment files in size less than 100MB only in ext4 filesystem. Since there is no option for that in the defragmentation tool (e4defrag), any ideas how I ...
Vlastimil Burián's user avatar
0 votes
1 answer
66 views

How to filter out only fragmented files from the log?

Supposing I have just finished a defragmentation on ext4 file system on a HDD: sudo e4defrag -v / > ~/defrag-2017-11-05 2>&1 & Which is most probably unnecessary, but I wanted to see, ...
Vlastimil Burián's user avatar
13 votes
2 answers
12k views

btrfs — Is it dangerous to defragment subvolume which has readonly snapshots?

If you open the defragment section of btrfs-filesystem(8), you will see the following ominous inscription left by the developers: Warning: Defragmenting with Linux kernel versions < 3.9 or ≥ 3....
firegurafiku's user avatar
0 votes
1 answer
177 views

Are there any utilities to know where a file is physically present in the hdd? [duplicate]

I am on Debian testing and using ext4 and ntfs . while ext4 has been brilliant in recovering lost data sometimes it also discards some pieces when electricity goes for a long time or any such similar ...
shirish's user avatar
  • 12.5k
1 vote
1 answer
441 views

Add & execute package to Defrag a fragmented Ext3 Volume under BusyBox in Synology CS407? How?

Add & execute package to Defrag a fragmented Ext3 Volume under BusyBox in Synology CS407? How? Note: Debunking the myth of Linux Filesystems not getting fragmented. http://www.webupd8.org/2010/...
Alex S's user avatar
  • 189
3 votes
1 answer
11k views

Defragmentation options on Ext4 filesystem

I have the following devices with Linux Mint 18.1 on laptops and GNU/Linux Debian 9 on the server. (All are 64-bit and with Cinnamon desktop.) All drive devices are formatted with ext4 filesystem; ...
Vlastimil Burián's user avatar
2 votes
2 answers
2k views

How to atomically defragment ext4 directories

Fragmentation seems to create a lot of unnecessary seeks when traversing a directory tree on a HDD: # stat -c %F 00 01 02 directory directory directory # filefrag -v 00 01 02 Filesystem type is: ...
the8472's user avatar
  • 274
2 votes
0 answers
90 views

External Fragmentation in FreeBSD due to unmovable Kernel pages

Is external fragmentation an issue in FreeBSD due to unmovable Kernel pages similar to what Linux (1) (2) faces?
user171417's user avatar
6 votes
2 answers
3k views

How to change the extent size in the ext4 file system?

As you can read here , ext4 file system has an extent feature that groups blocks into extents. Each of them can have up to 128MiB contiguous space. In e4defrag , there are lines similar to the ...
Mikhail Morfikov's user avatar
2 votes
2 answers
534 views

Will send & receive also defragment data?

I have heavily fragmented (and 90% full) btrfs partition on my laptop. I'd like to perform defragmentation with the help of identical spare hard drive. I already re-created partition table (GPT) and ...
Adam Ryczkowski's user avatar
4 votes
1 answer
2k views

How to defrag XFS file-system if xfs_fsr exits with "no improvement will be made"?

I am trying to defrag a heavily fragmented XFS file-system on a CentOS 6.6 machine: [root@server opt]# xfs_db -c frag -r /dev/md3 actual 598, ideal 215, fragmentation factor 64.05% However, when I ...
Chris's user avatar
  • 1,147
2 votes
2 answers
364 views

Meanings of defragmentation and when it is needed

There seem to be two meanings of defragmentation: Defragmentation is a process that reduces the amount of fragmentation. Fragmentation occurs when the file system cannot or will not allocate enough ...
Tim's user avatar
  • 102k
6 votes
2 answers
1k views

rsync hangs unless I defrag ext4 filesystem

I have a XBian server (Raspberry Pi version of Debian) running rsync via inetd (not the native dæmon). I am serving a couple of directories on an ext4 filesystem (on a USB disk) as individual modules (...
palswim's user avatar
  • 5,227