Questions tagged [defragmentation]

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

The process of arranging blocks on the filesystem to optimize disk read access. The algorithm for optimal fragmentation will differ for each filesystem type (e.g. ext2, NTFS), but will generally involve placing fragments of a file in contiguous blocks for disk-based storage devices.

25 questions
12
votes
2 answers

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.14-rc2 as well as with Linux stable kernel versions ≥…
firegurafiku
  • 463
  • 1
  • 4
  • 8
8
votes
1 answer

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 does the following: It allocates memory for a…
xylafur
  • 83
  • 1
  • 6
6
votes
2 answers

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 following: [325842/327069]/file: 100% extents: 100 ->…
Mikhail Morfikov
  • 10,309
  • 19
  • 69
  • 104
6
votes
2 answers

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 (the modules in question have in the order of…
palswim
  • 4,919
  • 6
  • 37
  • 53
5
votes
1 answer

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 comments: I observe that using dd to overwrite…
Marcus Müller
  • 21,602
  • 2
  • 39
  • 54
5
votes
1 answer

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 with hugepages, ideally 1GB hugepages. The machine…
Max Ehrlich
  • 101
  • 5
4
votes
1 answer

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 attempt to launch the xfs_fsr utility, it exits…
Chris
  • 1,137
  • 4
  • 14
  • 25
3
votes
0 answers

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 filesystem ?
erik
  • 41
  • 4
3
votes
1 answer

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 could achieve that? I know only how to find those…
Vlastimil Burián
  • 27,586
  • 56
  • 179
  • 309
2
votes
0 answers

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 in series takes about 3 days. The destination…
Pascal
  • 313
  • 3
  • 4
  • 8
2
votes
1 answer

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 defragmenting? Or does the following force…
dippynark
  • 327
  • 3
  • 11
2
votes
2 answers

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

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 recommend similar tools for the Linux OS. With regards…
2
votes
1 answer

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; RAID 1 is done utilizing mdadm. Laptop with 1 SSHD…
Vlastimil Burián
  • 27,586
  • 56
  • 179
  • 309
2
votes
2 answers

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: ef53 File size of 00 is 12288 (3 blocks of 4096…
the8472
  • 244
  • 1
  • 8
2
votes
0 answers

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
  • 21
  • 1
1
2