Defragging your Hard Drive

The correct way as I understood it was to run a disk check before defragging a drive, that avoids the bad sector problem happening.
Not used Norton for years but before Symantec got hold of it, Norton Diskdoctor checked the drive for errors before defragging it, so I expect it still does. AV's can't optimise a PC so sounds like you have the full Norton package which probably includes diskdoctor a registry cleaner, temp files cleaner and whatever else they stick in it these days?
Never lost a drive or its contents due to defragging it in 30 plus years.
 
Defragging in its simplest form takes data that has been spread all over a hard drive and moves the data together so that the drive access time is faster. When data is written to a drive, it is written sequentially, file after file no matter how large or small the file is. On a new or empty hard drive, the files are accessed quickly because there is no extra work for you hard drive. Remember hard drives, not thumb drives or SSD drives, are mechanical devices and being mechanical are a lot slower than the RAM that the data is being moved to. This motion on a newly formatted drive is minimal so the drave access time is pretty fast. As tine goes on, the drive access time will decrease not because the drive is getting older, but because the data is now spread all over the drive. When files are deleted, there will be a hole where they once existed. The sectors are marked free by the operating system so they can be reused by again. Since the files are written sequentially on the disk, the operating system will write to the first open spot whether this is a large enough to fit the complete file or not. If it's not enough space to fit the complete file, the operating system will put what it can in the small space and the rest in other spots on the drive. This extra mechanical motion by the read write heads is what slows down the performance of the hard drive as time goes on.

Disk data fragmentation has always been an issue with hard drives. Over the years many companies have created applications and utilities to defragment the data. What the defragmenting does is take the data that is spread all over the place and put the sectors in sequential order. This will restore the access time for the drive, making the computer respond faster when reading (acessing) and writing (saving) to the hard drive. Over the years the simple defragmenting utilities have gotten more complicated. As companies have found, there are other issues to that can degrade the performance of hard drives. Among the issues is the location of the data on the hard drive, etc., as well as the type of data such as system files needing access more than stale data, etc.

For more detail on this, check out http://www.condusiv.com/ for more information.

Now getting back to Trainz. Yes disk data fragmentation can cause poor performance. You are correct in assuming that the Assets.tdx and *.bku (this is the backup file) can get fragmented and cause slower performance as the data pointers are accessed in the database file. The individual asset files too need to be defragmented as well since these are then referenced and loaded into the program as you build a routes in Surveyor or drive your routes in Driver. By just rebuilding your Assets.tdx file, you are only fixing one small part of the program. I need to add here that this is not the recommended way of doing this in particular with TRS2009 and upwards. This can cause you to lose everything and have to reinstall the program from scratch.

As far as using your A/V program. This is just what it is unless there is a disk maintenance program in there, otherwise you are only scanning for malware. For disk defragmenting, you can use the built-in utility supplied with Windows at the least. Others exist by third party companies such as Condusiv, (Formerly Executive Software, and Diskeeper), The makers of Defraggler (They also make CC Cleaner), and even AVG. I happen to use the AVG PC Tune up. It has an excellent, though not as thorough as Diskeeper, but it does a fair job.

John
 
Provided your hard drive is less than 80% full fragmentation isn't normally a major issue. If its 80% full or more then no matter what the operating system is disk performance generally will be sub optimal. Basically when it gets this full that's when the operating system starts to hunt around for space and that's when a file can get spread over both inner and outer tracks. Average track to track might be 8 milliseconds but track to adjacent track can be 2 milliseconds or forget about it whilst inner track to outer track can be 40 milliseconds which is to be avoided.

Think in terms of commercial users and offices, in general they don't run defragmenting software. I used to justify PCs and software based on how much time I could save costed at $350 a person day. I was unable to cost justify defragging software.

When you start a program such as a word processor 97+% of the file accesses are to read in the software. You probably installed the software and the operating system when the drive was new so those files which are accessed heavily aren't fragmented and will read in quickly. Documents in general are close to a sector size on the disk and if its split over two sectors most people won't notice the difference in loading speed.

Win 7 is fairly intelligent so if you want a file it will generally read and cache it in memory whilst you are doing something else. Trainz uses lots of little files for assets, the chances of any of them being big enough to be fragmented is small. Unfortunately the chances of them being clustered together so they can be read in one disk read is also fairly small and most defragmenting software isn't intelligent enough to group these files together. Once Trainz is loaded it doesn't make that many disk accesses, you can check this using permon. Even using SSDs the general consensus is that thing spop up faster but frame rates are normally not that different.

If you feel it is a major issue then consider using an SSD since there are no head movements fragmentation becomes irrelevant. The other thing to do is reformat the disk drive then copy on the files so that the ones you want grouped together will be on the same track. Thus you avoid head movement, unfortunately though the disk manufacturers these days present the disk as a number of tracks with the same number of sectors, reality is the outer tracks have more sectors than the inner ones so there is intelligence to translate what is there into what the computer expects. So even if you succeed in placing all your files together on a single track the hard drive may well split them up over a number of physical tracks.

I had a summer student in once who was studying electrical engineering, they tend to get restless if not fed a constant stream of tasks, so I let her play timing things in the labs. She found the loading times for a big file were longer on an expensive high performance 7,200 drive with a small platter than with a cheaper slow 5,400 drive with a large platter, the reason being less head movement was involved with the slow drive. Needless to say we switched to the cheaper "slower" drives.

Cheerio John
 
Back
Top