fidefrag should copy files instead of moving them

Bug #282967 reported by John Daiker
4
Affects Status Importance Assigned to Milestone
fiDefrag
In Progress
Medium
Unassigned

Bug Description

When fidefrag attempts to defragment a file, it chooses to move the file to the '.fidefrag' folder instead of copying it to the folder.

If fidefrag were to copy the file to the .fidefrag folder, and then copy the file back to it's original folder (with .fidefrag appended to the filename), then fidefrag could choose which file to selected as the 'defragmented' file.

For example:
/home/tester/somefile.txt is 200mb and in 50 different pieces.

fidefrag _copies_ somefile.txt to /.fidefrag/somefile.txt

fidefrag then _copies_ /.fidefrag/somefile.txt to it's original location (/home/tester/somefile.txt.fidefrag)

fidefrag sees the original somefile.txt as 200mb in 50 pieces, and the new somefile.txt.fidefrag as 200mb in 40 pieces.

fidefrag chooses to keep somefile.txt.fidefrag.

Remove /home/tester/somefile.txt

Rename /home/tester/somefile.txt.fidefrag to /home/tester/somefile.txt

Remove /.fidefrag/somefile.txt

Hope that makes sense?

This will help to eliminate the situations where, even after 5 passes, a file is more fragmented than it was to start out with.

Revision history for this message
solarwind (x-solarwind-x) wrote :

This is how fidefrag functioned originally, but after testing, I determined tahat the file was more likley to become defragmented. I might have been wrong. I'm going to run some more tests now that you bring it up. But this is certainly not a bug. Thanks for reporting it though!

Revision history for this message
John Daiker (daikerjohn) wrote :

I can agree that moving vs copying may not be a bug.

What I would argue, though, is that (somehow) fidefrag should not allow for a 'regression' in the fragmentation of a file. For instance, I have a file that I have defragged over 10 times (2 executions * 5 passes) and the file is more fragmented now than it was before I started.

I guess my concern is that fidefrag allowing an increase in file fragmentation shouldn't be allowed.

Revision history for this message
solarwind (x-solarwind-x) wrote :

Ok I agree. I'll make copy and compare the default algorithm. I'll still include a switch in case the user wants to move instead of the default.

Changed in fidefrag:
importance: Undecided → Medium
status: New → In Progress
Revision history for this message
John Daiker (daikerjohn) wrote :

Great! I can help with testing a patch, also.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.