Intro Download and install Frequently Asked Questions Tips and tricks

Homepage







© J.C. Kessels 2009
MyDefrag Forum
September 21, 2014, 05:04:33 pm *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1] 2 3
  Print  
Author Topic: What's the point of Wrap-around fragmentation?  (Read 6286 times)
ScorpionGTfx
JkDefrag Senior
****
Posts: 32



View Profile
« on: June 05, 2010, 02:53:32 pm »

I tried to defragment and optimize my disk with MyDefrag using the monthly system script, and it did a good job. There were some yellow (fragmented) files but this is due to the concept of Wrap-around fragmentation. So it's ok. But right after the monthly defragmentation pass I did another defragmentation pass, but this time using the daily script: I wanted to see how it was fast. Result: it was fast! Smiley But it also messed up some things, like the yellow (fragmented) files. It seemed like to have not considered the concept around Wrap-around fragmentation, and it defragmented those file which were fragmented on purpose. When it finished, these files were no more into their respective zones ... yes, they were defragmented (green), but placed elsewhere in the drive. So, I'm asking, what's the point of Wrap-around fragmentation and monthly script if the daily one doesn't respect the same criteria? I mean, a file fragmented due to Wrap-around fragmentation concept should not be processed by the daily script if it is sill fragmented for that reason, isn't it?
Logged
BloodySword
Global Moderator
JkDefrag Hero
*****
Posts: 1158



View Profile
« Reply #1 on: June 05, 2010, 03:21:46 pm »

It is simply not easy to recognize if the file is realy a wrapped around file or if it is a fragmented file, I think. I try to run Monthly that it does not leave any fragmented file. If it leaves one, I cancel monthly script and run it again till there is no wrapped around file.
Logged

Greetings from Germany!
ScorpionGTfx
JkDefrag Senior
****
Posts: 32



View Profile
« Reply #2 on: June 05, 2010, 03:57:10 pm »

But one of the reasons to keep a drive defragmented is to limit the work that the drive has to do in seeking files. The monthly script is a big beast for the drive because it moves a lot of data. It can't be always done. It takes a lot of time, too. Also, if there are some unmovable data, you can run the monthly script as many times as you want but you cannot get rid of those file fragmented by the Wrap-around fragmentation due to unmovable data, except maybe if you do a defragmentation pass with a bootable CD (but even then, there are some files that remain unmovable)...  Undecided
Also, if isn't that easy to recognize if the file is really a wrapped around file or if it is a fragmented file, why MyDefrag is build around this concept? Right now the Wrap-around fragmentation concept last only 1 day: if you run daily script the day after a monthly one, as it should be, the drive is no more optimized around the Wrap-around fragmentation concept (or, at least, not completely).
« Last Edit: June 05, 2010, 04:04:52 pm by ScorpionGTfx » Logged
quanthero
JkDefrag Hero
*****
Posts: 234



View Profile
« Reply #3 on: June 05, 2010, 04:23:30 pm »

1) Wrap around fragmentation wraps a file around an unmovable file in linear fashion. In terms of disk seeks, the difference between this and completely defragmented file is very small: even if file is not fragmented, hard disk heads still have to move when reading that file (so called 'track-to-track' seek).
2) Any file is rarely read in completely linear fashion. It's more like "Read first N KB of file A, then read J KB of file B, then return to reading file A, etc." In this case, it does not matter whether file A is slightly fragmented or not.
3) Wrap around fragmentation may also be beneficial, because free space is completely consolidated and given file does not have to be placed farther into the disk.

Pity there are only two defragmenters that use and understand wrap around fragmentation. These are MyDefrag and PerfectDisk.
« Last Edit: June 05, 2010, 04:26:17 pm by quanthero » Logged
BloodySword
Global Moderator
JkDefrag Hero
*****
Posts: 1158



View Profile
« Reply #4 on: June 05, 2010, 04:26:46 pm »

First thing is to avoid unmovable files by closing all unneeded processes. Second thing is that small unmovable files and the logfine aren't bothersome. Wrap around fragmentation is only visible as yellow file when there is an unknown file or fragment in the way wich was created after MyDefrag has finished analyzing. If you stop and restart defrag it will skip the files that are already sorted and in 99% of all cases MyDefrag starts with the fragmented file. I don't use the daily script. I leave my drive as it is till I have done a big update of programs and files. Then I will reuse monthly script. I look after the drive's temperature that it does not go over 50C for over one 2 hours.
Logged

Greetings from Germany!
ScorpionGTfx
JkDefrag Senior
****
Posts: 32



View Profile
« Reply #5 on: June 05, 2010, 04:49:01 pm »

...
Pity there are only two defragmenters that use and understand wrap around fragmentation. These are MyDefrag and PerfectDisk.
This is clear, the problem is that with daily script MyDefrag doesn't seem to handle this concept very well.

First thing is to avoid unmovable files by closing all unneeded processes. Second thing is that small unmovable files and the logfine aren't bothersome. Wrap around fragmentation is only visible as yellow file when there is an unknown file or fragment in the way wich was created after MyDefrag has finished analyzing. If you stop and restart defrag it will skip the files that are already sorted and in 99% of all cases MyDefrag starts with the fragmented file. I don't use the daily script. I leave my drive as it is till I have done a big update of programs and files. Then I will reuse monthly script. I look after the drive's temperature that it does not go over 50C for over one 2 hours.
The monthly script try to move all data, so it recognize every unmovable data. The daily script does not: if the unmovable data is already defragmented, the daily script will not recognize that data as unmovable, and so it treat the wrapped around files as normal fragmented file, and this is wrong. Yes, I can avoid to use the daily script, but this is not how MyDefrag was originally designed.


However, I was thinking about it, and maybe the problem is in FastFill() (not FastFill(WithShuffle)): if a file is fragmented my unmovable data (a wrapped around file), then the Defragment() command defragment it (so it moves that file somewhere in the disk). After, FastFill() try to move back the defragmented file in its original position, but now the file is bigger than the gap right before the unmovable data, so it places the file elsewhere in the first big enough available gap. I think this shouldn't be a problem for FastFill(WithShuffle), because when it tries to move the unmovable data to enlarge the gap, then it recognize that data as unmovable, and therefore it flags that sequence of data as unmovable.  Then when trying to move back again the defragmented file, it should move it because the WrapAroundFragmentation is active and the consecutive gaps should be big enough to hold that file, divided only by unmovable data ............. yes, this is only the simplest of the examples, but makes the idea. Also this is just my thought, so I can be wrong Tongue
Logged
Darlis
JkDefrag Hero
*****
Posts: 1768


View Profile WWW
« Reply #6 on: June 05, 2010, 05:09:38 pm »

This is clear, the problem is that with daily script MyDefrag doesn't seem to handle this concept very well.
The definition of a Wrap-around fragment is "Wrap-around fragments are aligned fragments (back-to-front) with nothing but unmovable data in between.".
The problem you have here, is that while MyDefrag is optimizing the disk, other (temporary) files are being written too, like logfiles. If MyDefrag encounters such a file (or a fragment of it) while trying to place a file, it cannot see the file itself, but only knows that the current file cannot be moved there, so it wraps the file around this occupied space.
When you restart MyDefrag, it can see the new file and, if it is movable, it does not mark the wrapped around file as such again, since there is no unmovable file there. That's why the file gets defragmented and moved instead of leaving it where it is.
Logged

Need help creating a script? Try MyDefrag Script Creator.
BloodySword
Global Moderator
JkDefrag Hero
*****
Posts: 1158



View Profile
« Reply #7 on: June 05, 2010, 05:32:33 pm »

The problem is the Defragment() and Defragment(Fast). They won't recognize the unmovable files and assumes that the files are fragmented and defragments them. Jeroen could adjust the algorythm to check if the file's fragments are linear sorted, and the gaps aren't too big. But I think it would lead to more CPU usage.
Logged

Greetings from Germany!
jeroen
Administrator
JkDefrag Hero
*****
Posts: 7221



View Profile WWW
« Reply #8 on: June 05, 2010, 07:15:36 pm »

a file fragmented due to Wrap-around fragmentation concept should not be processed by the daily script if it is sill fragmented for that reason, isn't it?
That's exactly what MyDefrag does. However, there are at least 3 reasons why things can happen as you describe. Maybe more, I can think of 3 at the moment. The first is obvious, the unmovable data that caused the wrap-round is no longer unmovable. Data can for example be unmovable because it was in use by another program, it happens all the time. On the next run of MyDefrag the wrap-around file is not wrapped around unmovable data anymore, so is seen as normal fragmentation.

The second reason has been described already. The wrap-around may have been necessary because of a new file, created while MyDefrag was busy. The new data is unknown data, so MyDefrag has to wrap-around it. On the second run MyDefrag will "see" the new file, and will see it is movable. Again the wrap-around file is no longer wrapped around unmovable data.

The third reason is a configuration problem on your computer. MyDefrag makes a file called "MyDefrag.dat" in the MyDefrag directory, containing a list of files that were unmovable on the last run. It is loaded by MyDefrag on startup. Do you have such a file? If not then check the permissions on the directory. Without this file MyDefrag does not know which files were unmovable, and will therefore see all wrap-around files as normal, fragmented files..

In other words, wrap-around IS recognized by the daily script (and all other scripts), wrap-around files are seen as not fragmented. But it can happen that the unmovable data that caused the wrap-around, is no longer unmovable, so the wrap-around file is seen as a normal fragmented file and will then be defragmented.
Logged
jeroen
Administrator
JkDefrag Hero
*****
Posts: 7221



View Profile WWW
« Reply #9 on: June 05, 2010, 07:38:52 pm »

2) Any file is rarely read in completely linear fashion. It's more like "Read first N KB of file A, then read J KB of file B, then return to reading file A, etc." In this case, it does not matter whether file A is slightly fragmented or not.
I respectfully disagree, I think you are forgetting about the disk-caches, both the hardware cache in the harddisk and the software cache in Windows. Apart from the caches, most files on disk are small and in the vast majority of cases they are read whole, in a single operation. It can happen in multiple stages, especially on large files, but only in the very rare case where the fragment boundary happens to be exactly the same as the read boundary will the fragmentation not cause any speed degradation.
Logged
jeroen
Administrator
JkDefrag Hero
*****
Posts: 7221



View Profile WWW
« Reply #10 on: June 05, 2010, 07:41:05 pm »

The problem is the Defragment() and Defragment(Fast).
No, it's not.

Quote
They won't recognize the unmovable files
Yes, they do.
Logged
ScorpionGTfx
JkDefrag Senior
****
Posts: 32



View Profile
« Reply #11 on: June 05, 2010, 11:24:11 pm »

The third reason is a configuration problem on your computer. MyDefrag makes a file called "MyDefrag.dat" in the MyDefrag directory, containing a list of files that were unmovable on the last run. It is loaded by MyDefrag on startup. Do you have such a file? If not then check the permissions on the directory. Without this file MyDefrag does not know which files were unmovable, and will therefore see all wrap-around files as normal, fragmented files..

In other words, wrap-around IS recognized by the daily script (and all other scripts), wrap-around files are seen as not fragmented. But it can happen that the unmovable data that caused the wrap-around, is no longer unmovable, so the wrap-around file is seen as a normal fragmented file and will then be defragmented.
Yes, I've a file called "MyDefrag.dat" in my MyDefrag folder. Right now it's big 67Kb. However I noticed a strange behavior about this: do you know when MyDefrag, before starting defragmentation, loads all the unmovable data and mark as red the data unmovable in the disk map? This operation doesn't always occur. Sometimes (and only sometimes), if I close MyDefrag before it finishes his job, when I load MyDefrag again, it starts immediately with the defragmentation pass, without the phase of the unmovable data loading: there is no red data in the disk map when defragmentation starts, even the pagefile is not red! When this happen, if I don't let him finish its defragmentation job (or at least let him go on for a good while), if I restart MyDefrag again, it still won't load the unmovable data in the disk map (but if it reach a unmovable block, and try to move it, then, and only then, it marks the block as red). Maybe is this the problem I had with the daily defragmentation: MyDefrag didn't remember the lasts unmovable blocks of previous defragmentation. Is that possible?

p.s.
I checked and MyDefrag has the permissions to write in the folder where it's located.
« Last Edit: June 05, 2010, 11:27:49 pm by ScorpionGTfx » Logged
Kasuha
JkDefrag Hero
*****
Posts: 595


View Profile
« Reply #12 on: June 05, 2010, 11:42:52 pm »

I believe the (original) problem is in the definition of wrap-around fragmented file and subsequently with implementation recognising them.
If a different definition for wrap-around fragmented file was used, such as "a fragmented file which fragments are lying in order and space between every two consecutive fragments is smaller than X megabytes" then there would be no need to defragment such files on second (daily) run.

My experience is that almost all big (>100 MB) and many smaller files on system drive get fragmented this way when using SortBy command. As long as I have video files on my disk regularly that means all of them are moved again after such an optimization. Personally I recommend to never use SortBy on spacehogs zone.
« Last Edit: June 05, 2010, 11:45:15 pm by Kasuha » Logged
jeroen
Administrator
JkDefrag Hero
*****
Posts: 7221



View Profile WWW
« Reply #13 on: June 06, 2010, 06:32:20 am »

Is that possible?
Anything is possible. But it's highly unlikely. From your description I would say that sometimes your "MyDefrag.dat" file get's deleted. I wonder why.
Logged
ScorpionGTfx
JkDefrag Senior
****
Posts: 32



View Profile
« Reply #14 on: June 06, 2010, 08:50:12 am »

Just played a bit with MyDefrag, and I found that if I close it during or right after the unmovable data loading step, then it "forgets" the unmovable files. The file "MyDefrag.dat" suddenly becomes very small (1kb) and if I restart MyDefrag it won't load unmovable data anymore, until during a defragmentation pass it encounters again some unmovable data...  Undecided
Logged
Pages: [1] 2 3
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.5 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!