Blitzschnell Hard Drive Defragmenter and Optimizer Version 1.46 Beta Release Programmed by Erin Matthew Monaco May 29, 1992 *************************************************************************** Written in 100% assembly language Blitzschnell is compact and offers the speed not found in high level languages. This program is SHAREware. If you like it I ask that you send a check or money order for $20 + $3 s/h to; Mr. Erin Monaco 35244 Chestnut Wayne, MI 48184 The assembly language source code for this program may be purchased for $99 in U.S. funds by writing the above address. Since this is a Beta release I would appreciate all comments or suggestions. Please feel free to write or call me at (313)-485-2818. My address on GEnie is E.MONACO. ********** DISCLAIMER: Neither the author nor Databasement assume any responsibility for loss or damage to hardware, software, or data as a result of the use or misuse of this product. ********** This program offers a unique visual perspective of your drives data. The program is designed primarily for hard drives. While it can be used on other mediums providing it can identify the FAT format, it is not intended nor recommended that you use this program where physical copy protection is present. (ie, commercial games) Acc's may be used in conjuction with this program, some you may find helpful are a calculator, disk utilities that give you the ability to copy, move or delete files, and EdHak (by Clear Thinking). A word of caution however, since Blitzschnell stores the FAT and all directory sectors in memory, if you make a change to the device you have currently mapped you will have to refresh Blitz's buffers. You can do this by selecting the logical drive again, if all goes well you will have to "Map" as well. If you have any problems running the program, try disabling auto programs and acc's one by one till you track down the problem. WHAT BLITZSCHNELL ISN'T This program is not a data recovery system. While it can be used in a very limited way to rid your drive of some problems, it is not intended or recommended that you use Bliztschnell on seriously messed up drives, as there is a good chance you will just mess things up more. This program is designed to defragment files and folders, clean up directories, and help keep your File Allocation Tables in good shape. This program can alert you to a number of problems and will try to work things out. It is designed to keep good drives in GREAT shape, if your drives are really scrambled I suggest you try to use one of the data recovery systems available on the market to save what you can. Most often serious problems are only cleared up by reformating or erasing your partition(s). (I am not suggesting you do this, the choice it utimately yours, but this program is only intended to keep your drives in order so they may run at their best data throughput rates). As of version 1.47 AUTOVER.TOS a freeware program from Beckemeyer Software will be included with the Blitzschnell package. Before using this program you should run AUTOVER.TOS, it will check your drives for any problems. IMPORTANT: If AUTOVER.TOS reports any problem no matter how simple you should NOT use blitzschnell to defragment that drive/partition until all the problems have been corrected as Blitzschnell will not work properly if your data is corrupt in any way. This manual is intended to give a brief overview of the commands along with some useful information as well as an update history. Some terms that you will frequently run across are as follows; FAT- Stands for file allocation table. The ST maintains 2 FAT's in the event that one becomes scrambled or damaged. The purpose of the FAT is to provide the OS with a means to determine which clusters are used, bad or free, and which clusters belong to the same file. CLUSTER- A cluster consists of two sectors grouped together. Each cluster has its own entry in the FAT. The reason for this is to save drive space, if each sector had its own entry in the FAT each FAT would be twice as big! Sector- A sector is a logical grouping of 512 bytes. Sectors enable a drives data to be accessed more quickly and in any order. MENU COMMANDS: "About Program" - Brings up a credit dialog. "Select" - Allows you to select a new drive to work on. "Map" - Visually maps drive to work window. "Toggle Fat" - Allows you to switch between the two FAT's. "Info" - displays info from boot sector and bios parameter block. "Trace" - allows selection of single files. "Quit" - exits program and returns you to the desktop. "Move" - allows selected "highlighted" clusters to be moved. "Reserve" - allows you to mark clusters so the OS won't use them. "Free" - allows you to free clusters entries. "Zero" - allows you to zero actual cluster contents. "Warnings" - Can turn most warning alerts on or off. "Short View" - Toggles between Blitz's two viewing modes. "Optimize Dirs" - Removes deleted file entries (may save space) "Consolidate" - Packs all data clusters before all empty clusters. "Defragment" - Will automatically defragment your drive(s). Most menu items have keyboard equivalents. "^" means to hold down the control key while pressing the command key. These commands are not available from the menu; WINDOW INFO LINES: The drive currently buffered will be displayed in the windows title line. The info line will display number of clusters that are, Used, Free, Reserved, Bad, first cluster at top of work window and number of selected "highlighted" clusters. Once you have "Map"'ed a drive the work window should fill up with boxes that contain either single letters or up to three. Each box represents a cluster. Cluster numbering begins at two since the OS uses the clusters zero and one for format. Clicking on a cluster with the right mouse button will display a new info line containing the name of the file (if any) its first cluster, the cluster your currently on, and the next cluster in the file chain. If the next cluster is "EOF" that means your at the last cluster of that file. Clicking on a cluster with the left mouse button will select or deselect the cluster. You can select/deselect multiple clusters by keeping the button pressed down and moving the mouse over the clusters. Once you release the button the info line will be updated showing any changes in the number of clusters selected. When "Move"-ing clusters the info line will again change asking you to select a destination cluster or cancel. Move will overwrite all destination clusters! You must be careful not to overwrite parts of any other file. CLUSTER SYMBOLS: Once a drive has been mapped, boxes will fill the work window, each box represents a cluster of your drive. "*" means the OS has marked this cluster as damaged. "Delta" (a triangle) means that either the OS forgot to free all the clusters of a deleted file, some mishap caused the FAT to be corrupted or somehow a file got scrambled up and these may be parts of it. A blank box indicates that the cluster does not belong to any file present, not necessarily that it contains no data. In the short viewing mode (default) "X" simply means the cluster belongs to a file, while in the extended mode the boxes will be filled with three letters, any combinations such as "AAA" will all belong to the same file. WORK WINDOW: Provides a powerful but intuitive means to defragment/optimize your drives. Clusters are represented by boxes which may or may not contain text/symbols. You have a variety of ways to select clusters at your disposal. To select a single cluster just left click on the cluster. To select a group you may hold the left button down as you move the mouse from cluster to cluster, whether or not a cluster is selected depends upon whether or not the first cluster you touch was selected or not. You may also select all of a files clusters by using the "Trace option". The last method is the block method. Hold down the control key as you left click on the first cluster you want selected or deselected then hold down the control key again as you click on the last cluster. Again whether or not the block is selected or deselected depends on the first cluster of the block, if you are selecting the first cluster the whole block will be selected, otherwise the block will be deselected. VERTICAL SCROLL BAR AND ARROWS: The vertical scroll bar can be used to move arbitrary distances through clusters. Dragging it you can move to any valid cluster. Clicking on it will page up or down depending on location and clusters available. Clicking up and down arrows moves the clusters down or up a line respectively. REVISED FILE SELECTOR: The file selector (brought up when you select "Trace") can display hidden and system files (no limit). The window title will display the root directory or a parent folder (Only) and it will be updated accordingly. To move back up a directory chain to the root click anywhere on the window title. Blitzschnell treats folders like files, they can be traced by clicking on the folder (which makes it current) then without selecting a file from the folder click on ok, it will then trace the folder. Drives can not be changed from the file selector, it just lets you know which drive you are working on. (This is also displayed in the window title of the work window). All selected clusters will be cleared, even if you choose cancel so a newly traced file's clusters will be the ONLY clusters selected/highlighted. You can prevent "Trace" from clearing previously selected clusters by holding the alternate key as you exit the selector, either by clicking ok, cancel, or double clicking on a file. INFO DISPLAY: "Info" displays information from your bios parameter block and from the drives boot sector. Like number of data clusters, sectors per track,and much more, like; "#Orphans" correspond to # of deltas. (Triangles) (See "Cluster Symbols" for more information). There is not much hope recovering orphaned files, but you can "Free" these clusters so the OS can use these clusters in the future. "#Out of Range" is the number of FAT entries that had illegal values. "# Fragmented" is the number of fragmented files. "# Errors" the number of disk errors encountered on the drive. "Condition" is a rating of drives condition based on the # of Errors encountered. WARNINGS AND SHORT VIEW: These options allow you to turn most alert warnings on or off, and to toggle between the normal or extended cluster viewing modes, respectively. THE "CLUSTER" MENU OPTIONS: Move, will allow you to move a group of selected clusters to a desired destination. While the selected clusters may be from many different areas of your drive, they will be written one after another starting at the destination cluster. Reserve, will allow you to mark specific clusters so the OS won't use them. This can be use to reserve a cluster or two after your folders, in the event that the OS expands the amount of clusters used, due to the addition of files, you can easily move these fragmented files back together. Free, can be used to free up reserved clusters and also any orphaned (deltas) clusters. Zero, is a great little option that will allow you to 'zero' the sectors of a cluster, or a file (or two) or even the whole drive! This option does NOT erase the FAT entries of these clusters. If you've zero'ed out a file to truely 'erase' it, you then should delete it from the desktop like normal. Be warned however, that there will be NO hope of recovering the file. OPTIMIZING DIRECTORIES: (^H) Will optimize your directories. Specifically what this option does is complete remove deleted entries from your directories, this can save space and time, if for example you had 300 fonts in a folder and deleted all but 8 of them, the system would still use 19 clusters, where you only need one! CONSOLIDATING CLUSTERS: (^K) This option groups all clusters that contain data together, so all empty clusters appear towards the bottom of the drive. This is also done when you choose to defragment your drive automatically. It can be a powerful tool for those who wish to defragment their drives manually as well. AUTOMATIC DEFRAGMENTATION: (^D) I recommend at least 1 Meg when using this option. 512K will work but be sure that you don't have any accessories or TSR programs installed. This function is completely automatic. After choosing it an alert will pop up asking you if you want to defragment the currently selected drive. Select "OK" and watch it fly!!! As promised I updated these routines and the speed increase is incredible! Blitzschnell (lightning quick) now lives up to its name. There is no longer a limit on the size of a file it will defragment. As before it WILL defragment a FULL drive. When you defragment a drive the window's info line now shows info on the defragging process. Now you can see at a glance whether or not Blitzschnell appears to be working or not. Under NO circumstance should you turn off the computer or drive while its being defragmented this WILL mess up your data as the FAT's and directories are not resaved from memory until defragmentation is complete. USE AUTOVER.TOS to check your partitions! DON'T use this program if your partitions have problems it will only cause trouble and heartache. (Yish, you've been warned already (grin)) Here are the results from my new defragmentation timings: Computer Partition Amount # Files & Blitzschnell's Hard Disk Sentry Memory Size (Megs) Used Folders Time min:sec Time min:sec ========================================================================== 4 Megs 10.0 3.7 146 00:57 02:57 4 Megs 10.0 7.3 364 01:53 06:02 4 Megs 10.0 7.6 327 02:23 B.F N.T 4 Megs 10.0 10.0 417 02:29 01:46 * 4 Megs 32.0 30.5 1298 08:12 33:10 ------------------------------------------------------------------------ 1 Meg 8.3 8.3 391 02:18 N.T 1 Meg 32.0 30.5 1298 11:26 N.T ------------------------------------------------------------------------ 512 K 8.3 8.3 391 02:39 N.T 512 K 32.0 30.5 1298 OOM N.T ------------------------------------------------------------------------ OOM = Out Of Memory (not enough to do it), N.T = Not Tested. BF = Badly Fragmented. * It only took H.D. Sentry 1:46 to KILL not only the partition it was working on but also the NEXT partition as well. Seems Sentry needs some free space (1 Meg?) or it won't work right. It says nothing about this in my manual. As best I can figure it moved data on my "E" partition right onto my "F" partition, scrambling the boot sector and FAT's as it did so! It has happened before so, a word of warning! As you can see the performance has been greatly improved!!! My last implementation took hours, and for that I'm sorry the old ones were quickies I did just to get the job done. Also I would be happy to receive stats on other programs like Diamond Edge so if anybody has the time or motivation I'd appreciate it. MISCELLANEOUS: - To speed up everything FAT's and Directories are stored in memory at all times, this of course has a small disadvantage in that a 32 Meg partition doesn't leave enough room for defragmentation on a 512 K machine. (Don't know the largest that 512K machines will work on.) QUICK EXAMPLE DONE MANUALLY: I run Blitzschnell then "Select" Drive H. Choose menu items "Warnings" and "Short View" to turn warnings off and select the extended view mode. Next I select "Map". Studying the map I see that "AAF" is broken into two parts. "AAF" occupies clusters 2-10 and 20-30, "AAG" occupies clusters 11-19. I hold down the right mouse button on the first "AAF" cluster, the info line tells me that the file is "BLITZ_HD.PRG" I repeat this procedure for "AAG" the info line tells me that "AAG" is file "BLITZ.HR.RSC". I select "Trace" and choose "BLITZ_HR.RSC" double clicking on it, the program highlights clusters 11-19 (those that belong to "BLITZ_HR.RSC"). I select "Move" and the info line tells me to left click on a destination cluster or right click to cancel. Choosing a group of >=9 empty clusters I click the left mouse button. The Hard drive busy lights comes on. After a short time the screen is redraw and my "AAG" clusters are now in thier new location. Moving the pointer to cluster 20 I hold down the left mouse button. Keeping the mouse button down I drag the mouse across to highlight clusters 20-30. I again select "Move" and select cluster 11 as the destination. The drives spins the screen is redrawn and now all my "AAF" clusters "BLITZ_HD.PRG" are grouped together (clusters 2-21) (the file is no longer fragmented!) Again I trace "BLITZ_HR.RSC" which selects the "AAG" clusters. Which following the above procedure I "Move" starting at destination cluster 22. The two files are completely defragmented and there are no blank spaces. (Clusters 2-21 contain "BLITZ_HD.PRG" and clusters 22-30 contain "BLITZ_HR.RSC") I have just successfully defragmented my "H" partition. Scrolling through the rest of the clusters I notice that cluster 4480-4485 have deltas in them (triangles) Obviously the OS didn't zero out all of a deleted files' FAT entries. I highlight clusters 4480-4485 as described above. Selecting "Free" from the menu the drive lights up for a second. The screen is redrawn and I now see that clusters 4480-4485 are empty. (now available to the OS to save files to!) Thus I have successfully restored my "H" partition to tip-top shape. UPDATE HISTORY: Enhancements and changes shown in these updates are accounted for in the manual already. This is to avoid the conflict of learning something then finding out that it has been changed or no longer exists. For example; the resource has been modified by the removal of two dialogs, hence you will note that the "Registration" and "Titles" menu options are no longer addressed in the 'manual' section of this text. 07/30/92 Version 1.0 - Version 1.0 released as SHAREware. 08/08/92 Version 1.1 - Internal FAT range checking implemented to avoid seek errors. - Spelling mistake corrected in resource. - Alerts changed from all caps. - Fixed code that improperly reported boot sector values. - ^C FAT comparison routine implemented. 08/09/92 Version 1.11 - Fixed bug in "Trace" routine. - Reworked routine for setting new display cluster. - ^8 Null FAT group selection implemented. 08/15/92 Version 1.2 (Not released) - Cleaned up FAT comparison output. - Added new error alerts, revamped error trapping in loading buffers. - Added code to handle FAT and Directory loads more like the desktop. 08/31/92 Version 1.22 - Optimized code by 2K. - Fixed bug in routine for setting new display cluster. - Added code for making multiply cluster selections without redraws. - "EOF" added to "NEXT" info display. - Updated manual. 09/07/92 Version 1.23 (Glendale show) - Fixed bug that didn't determine proper end of buffer address. - Fixed bug that failed to load in multiple cluster subdirectories. - Added button text for "Disk Write Protected" alert which I forgot. 10/07/92 Version 1.33 - Made medium res. clusters more readable. - Added color to medium res. resource. - Fixed overlap in medium resolutions file selector. - Set registration fee to $10. 10/13/92 Version 1.40 - Fixed ADDA.W glitch that wouldn't carry addr regester to high word. - Fixed bug that prevented subdirectories from being saved. 10/27/92 Version 1.40-U - Unfixed part of subdirectory save bug, it caused new problems. - Changed update and bug fix notice policy. - Completely rewrote manual. - Enabled Acc. slots. (See earlier warnings!) 11/27/92 Versions 1.44 (registered and unregistered) - Removed "Registration" and "Titles" options. - Removed above dialogs from both resource files. - Added code to show mouse "bee" when drives are accessed. - Added code to disable "Trace" from clearing previously selected clusters. - Rewrote "Info" code, expanded amount of info displayed. - Added code for block selection/deselection of clusters. - No longer will act on events intended for such things as accessories. - Added ^H option, to clean up directories by zeroing out deleted entries. - "Move"-ing files no longer resets display cluster to two. - Now forces GEMDOS to update its buffers, no resets are necessary. - Added ^K "Consolidation" option. - Added ^D "Auto Defragmentation" option. - ^8 Null FAT group selection option removed, because of "Block" selection. - Registration fee set to $15 *** Changes made after official release *** Technically 1.45 (12/28/92) - Corrected erroneous zip-code for registrations. - Freed 32K so acc's and appl's can use GEM fileselector. - Buggy compiler caused Blitz/EdHak/Quick ST problem. Recompiled with back up copy. Appears to work fine now. - Now disables fverify. - Fixed bug that didn't invert menu titles when keyboard equivalents used. - Defragment, Optimize and Consolidate now selectable from menu under "Mode" title. - [ESC] can be used to abort ongoing defragmentation. - Increased cache buffer to store up to 100 files per defragmenting pass. 05/22/93 Version 1.46 (Registered version only, not released) - Increased cache buffer to store up to 341 files per pass. - modified reconstruction/move buffer ratio 19:1 which gains up to 50% increase on automatic defragments. - Used Atari's fix so desktop updates internal tables and buffers for the defragmented partition. Resets no longer needed. Last version did not work correctly. 06/10/93 Version 1.47 (Registered version only) - Rewrote Defragmentation Routines, now VERY quick!!! - Added some memory checks and alerts for memory errors. - 32K is NOT freed for GEM fileselector if program has less then 512K free space when it is first run. It will alert you if this happens. If so you will get an out of memory error if an ACC tries to call up the fileselector. - No longer loads default buffers on running. Have to select drive first. - Fixed % Fragmented code. - Removed Compare Fats routine. Diagnostics and repair will be added later. - Fixed # Orphans code that would accumulate on multiple "Info" selections. - Modified resource files, be sure to use the new ones! - Added status info line for auto defragging. - Defragment abort removed. (so much faster you don't NEED it!) In the new implimentation its also too dangerous. - Corrected oversight that caused volume labels to get deleted. - FIXED forced media change routines yet again! (getting sick of this one) - Fixed (hopefully) problems that caused bombs when media used more then 512 byte logical sector sizes. - added more memory checks and fixed an error in one. - Other modifications I've already forgotten. 06/30/93: - Disabled "Consolidate" menu item, seems it developed a glitch that could scramble some cluster pointers. This will be fixed when I have the time. It will probably be removed as Defragmenting in addition to ordering your files, consolidates as well... at it is almost as quick! *** To prevent accidental data loss frequent backups are recommended *** *** Please back up ANY data that is important!!! *** ACKNOWLEDGEMENTS: My humble thanks to each and every person who took the time to register their version of this software. Your support is greatly appreciated and sorely needed. I look forward to continuing my efforts to improve this software to better suit your needs. Thank You. I want to thank my fiancee, for her patience, understanding, and sage advice to "...just sleep on it." which more then once kept me from resorting to my "last ditch" debugging method. (Eating the source code) Thanks to Craig Harvey of Clear Thinking(tm) for his comments and suggestions, loaning me his valuable equipment and above all, for listening to me. Sincerely, Erin M. Monaco