home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 14 Text / 14-Text.zip / DEFRAG.ZIP / DEFRAG.TXT
Text File  |  1992-07-13  |  11KB  |  229 lines

  1.      How to Defrag FAT Volumes After Installing OS/2 (Any Version)
  2.  
  3.                   Address Comments/Suggestions to:
  4.                       Mercer Harz, 70431,150
  5.  
  6. All standard disclaimers apply; this procedure works for me, and
  7. others, and I've never had to resort to use of the backup I make.
  8. However, disaster can strike at any time; be prepared.  Although I have
  9. followed these directions (more or less) on a regular basis when
  10. defragging my systems, and have not experienced any problems as a result,
  11. (under OS/2 v1.2, 1.3, and 2.0, and DOS 4.01 and 5.0), you should still
  12. be careful.  In particular, attempt to run the defragger with as few
  13. device drivers loaded as possible (preferably none); no programs that
  14. terminate and stay resident (TSRs); no disk caching software; no extended
  15. memory managers; etc.  The safest way to run a defragger is to make
  16. sure that only DOS and the defragging software are executing.
  17.  
  18. The instructions below assume that you are using OS/2 2.0 and DOS 5.0.
  19. If you are using different versions of these operating systems, the
  20. procedures in general are still valid, but the particular details
  21. concerning file locations, file names and capabilities of the ATTRIB
  22. program may vary.
  23.  
  24. Currently, there is no support under OS/2 for Stacker or similar
  25. on-the-fly disk compression systems.  This procedure has not been tested
  26. on STACKed volumes, for the very good reason that it won't work
  27. properly on them.  When an OS/2 version of STACKER is available, and I
  28. get it <g>, I'll update this procedure as required.
  29.  
  30. *---------------------------------------------------------------------*
  31.  
  32. Requirements:
  33.  
  34.  1. The target volume(s) must be formatted for the FAT file system.
  35.  
  36.  2. You must have a bootable DOS diskette (preferably 4.01 or later).
  37.     The CONFIG.SYS and AUTOEXEC.BAT for this boot diskette should
  38.     be as simple as possible; don't load any TSRs, cache programs,
  39.     memory managers, or device drivers (beyond those required for
  40.     hard disk access, if any).
  41.  
  42.  3. You must have a disk defragger (optimizer) that preserves the
  43.     entire directory entry for a file.  There are reserved bytes in
  44.     each entry of a FAT-formatted directory; these are used to store
  45.     pointers to extended attributes.  A few older programs did not
  46.     preserve the contents of these reserved bytes when manipulating
  47.     directory entries.  I've used SoftLogic Systems' "Disk Optimzer"
  48.     (v4.01 and later) and Norton's "Speedisk" (v4.5 and later)
  49.     successfully.  Other products are likely to work successfully as
  50.     well.  You can run the defragger from the disk being defragged, from
  51.     another FAT-format hard disk volume, or, if you copy the defragger
  52.     onto the bootable DOS diskette, from the diskette.
  53.  
  54.  4. You must have the OS/2 2.0 Installation diskette, as well as
  55.     diskettes 1 and 2.
  56.  
  57.  5. You must have a DOS utility, such as ATTRIB, or a disk editor, such
  58.     as Norton's DiskEdit, with which you can change the file attributes
  59.     of OS/2 system files that are to be defragged.  This utility must be
  60.     available on the bootable DOS diskette, or in a directory on a hard
  61.     disk volume.  Alternatively, you could perform the ATTRIB steps
  62.     described below while booted from the OS/2 installation diskettes,
  63.     by making explicit references to x:\OS2\ATTRIB.EXE, where x: is
  64.     the hard disk volume on which OS/2 2.0 is installed.  If you need
  65.     directions for the use of the ATTRIB command, refer to the online
  66.     OS/2 Command Reference, in the Information folder.  Its syntax
  67.     description is valid for both DOS (5.0) and OS/2.
  68.  
  69. *---------------------------------------------------------------------*
  70.  
  71. Procedure:
  72.  
  73.  0. Take a full backup of all volumes that you are going to defrag.
  74.     If you have an OS/2 backup program, all the better; it will handle
  75.     backing up and restoring extended attributes automatically.  If you
  76.     have a DOS backup program, look in the libraries in IBMOS2 for
  77.     one of the utilities that allow you to backup and restore the
  78.     OS/2 extended attributes using DOS backup software.  EABK10.ZIP
  79.     and EAPREP.CMD are two that I know of (I wrote the latter).  Also,
  80.     there is another program that saves the WorkPlace Shell configuration;
  81.     it is called WPSBK2.ZIP; highly recommended, regardless of the type
  82.     of backup software you have.
  83.  
  84.  1. Shutdown OS/2 (click the right mouse button on the desktop, then
  85.     select "Shut down" from the popup menu).
  86.  
  87.  2. When you see the message informing you that you can either press
  88.     CTRL+ALT+DEL or turn off the machine, insert the OS/2 2.0
  89.     Installation Diskette in drive A:, then press CTRL+ALT+DEL.
  90.  
  91.  3. When prompted, remove the installation diskette, insert OS/2 2.0
  92.     diskette 1 and press ENTER.  After the OS/2 logo is displayed, you
  93.     will be asked to press ESC to cancel or ENTER to continue with
  94.     installation.
  95.  
  96.  4. Press ESC.  You will then be dropped out of installation, to an
  97.     OS/2 command-line prompt, logged onto drive A:.
  98.  
  99.  5. Insert OS/2 2.0 diskette 2, which contains CHKDSK.
  100.  
  101.  6. Run CHKDSK /F against every volume that you are going to defrag,
  102.     while still logged onto the A: drive.
  103.  
  104.     Example:  If you are going to defrag volumes C:, E: and F:, issue
  105.               the following commands, from the [A:]> prompt:
  106.  
  107.                   CHKDSK C: /F
  108.                   CHKDSK E: /F
  109.                   CHKDSK F: /F
  110.  
  111.     This is necessary, so that there are no errors in the Extended
  112.     Attribute (EA) pointers prior to the defrag, and to reclaim space
  113.     from EAs that have been deleted.
  114.  
  115.     The reason you boot from floppy to do this is that CHKDSK cannot
  116.     fix disk errors on the disk that it is booted from, because of
  117.     system integrity issues.
  118.  
  119.  7. At this point, the faint at heart may want to re-boot OS/2 2.0
  120.     from the hard disk, just to make sure that everything still works,
  121.     particularly if errors were found during the CHKDSK execution(s).
  122.     If OS/2 won't reboot from the hard disk, DO NOT proceed to the
  123.     next step; instead, seek assistance, and/or restore your hard
  124.     disk from the backup.  If you successfully reboot OS/2 from the hard
  125.     disk at this point, shutdown again as described in step 1 before
  126.     continuing with the next step.
  127.  
  128.  8. Insert the DOS boot diskette into drive A: and press CTRL+ALT+DEL
  129.     to boot into DOS; do not, under any circumstances, try to run a
  130.     disk defragger/optimizer in a DOS session, either emulated or
  131.     specific, under OS/2 (or Windows, for that matter).  With the
  132.     current state of the art, you should always run a disk defragger
  133.     only under native DOS.
  134.  
  135.  9. If you are defragging the volume that contains SWAPPER.DAT, delete
  136.     the SWAPPER.DAT file.  (The drive and directory containing
  137.     SWAPPER.DAT is specified by the SWAPPATH entry in the OS/2
  138.     CONFIG.SYS.) Deleting SWAPPER.DAT prior to defragging has two
  139.     benefits:  it shortens the defrag time, and, since SWAPPER.DAT is
  140.     deleted and reallocated at every bootup, after defragging, the page
  141.     dataset initial allocation will be contiguous and located at the
  142.     "end" of the drive.
  143.  
  144. 10. If you are defragging a volume containing a Windows 3.0 or 3.1
  145.     SWAPFILE (386SPART.PAR), leave this file alone.  Do not unhide
  146.     or delete it.  Windows allocates this file contiguously; it
  147.     never needs to be defragged.  Of course, there is an exception:
  148.     should you need to enlarge the Windows SWAPFILE, use the Windows
  149.     SWAPFILE program (Win3.0) or the 386 Enhanced Mode Control Panel
  150.     applet (Win3.1) to delete the current 386SPART.PAR prior to
  151.     running the defrag procedure, then, after defragging, use the
  152.     Windows tool to allocate the larger Windows SWAPFILE.
  153.  
  154. 11. Invoke ATTRIB (or use a disk editor) to clear the HIDDEN, SYSTEM
  155.     and/or READ-ONLY attributes of the following files:
  156.  
  157.     On the OS/2 2.0 boot volume (if formatted for FAT):
  158.  
  159.       File Name                      Normal Attrs
  160.       -----------------------------  ------------
  161.       x:\EA DATA. SF                 Hid R-O Sys
  162.       x:\WP ROOT. SF                 Hid     Sys
  163.       x:\OS2LDR                      Hid R-O Sys
  164.       x:\OS2KRNL                     Hid R-O Sys
  165.       x:\OS2BOOT                     Hid R-O Sys
  166.     * x:\IBMLVL.INI                      R-O
  167.       x:\OS2\BITMAP\AAAAA.EXE        Hid     Sys
  168.       x:\OS2\BITMAP\AAAAA.MET        Hid     Sys
  169.    ** x:\OS2\SYSTEM\BOOT.OS2         Hid R-O
  170.       (plus any other hidden files you want to defrag)
  171.  
  172.       * Present only if you have installed Extended Services v1.0
  173.      ** Present only if you have installed for DualBoot
  174.  
  175.     On all other FAT volumes:
  176.  
  177.       x:\EA DATA. SF                 Hid R-O Sys
  178.       x:\WP ROOT. SF                 Hid     Sys
  179.       (plus any other hidden files you want to defrag)
  180.  
  181.     Depending on other products you may have installed, there may be
  182.     other hidden files that you may want to unhide, so that they can
  183.     be defragged, relocated, or both.
  184.  
  185. 12. To manipulate the files that have spaces embedded in their names,
  186.     use DOS wildcards, such as the following example, which will clear
  187.     all the file attributes for these files:
  188.  
  189.           ATTRIB -H -R -S x:\*.?SF
  190.  
  191.     This example resets the file attributes for the WP ROOT. SF file:
  192.  
  193.           ATTRIB +H +S x:\WP?ROOT.?SF
  194.  
  195. 13. If you are set up for DualBoot, and are defragging the boot disk,
  196.     DO NOT unhide the DOS system files.  Some versions of DOS are not
  197.     sensitive to the location of the system files, but others require
  198.     the system files to be located directly behind the root directory,
  199.     where they are normally placed when DOS formats the hard disk
  200.     and makes it bootable.  The files are usually named as follows:
  201.  
  202.        x:\IBMBIO.COM and x:\IBMDOS.COM    (for IBM PC-DOS)
  203.        x:\IO.SYS and x:\MSDOS.SYS         (for MS-DOS)
  204.  
  205.     If you unhide these files and the defragger relocates them, depending
  206.     on the version and/or DOS vendor, you may be unable to boot DOS from
  207.     the hard disk any longer; fixing this problem usually requires
  208.     reformatting.  OS/2 booting will be unaffected, and DOS itself can
  209.     still be booted from floppy, then run off the hard drive.  But it
  210.     is safer not to move these files.
  211.  
  212.     OS/2 1.3 and 2.0 system files are not position-dependent.  They can
  213.     be located anywhere on the boot volume; OS/2 uses directory entries
  214.     to locate these files.
  215.  
  216. 14. Defrag the disk(s).  When using Speedisk, I usually opt for full
  217.     optimization with file/directory reordering, not just defragging.
  218.  
  219. 15. When the defragging is complete, you can (if you want to) use ATTRIB
  220.     or a disk editor to reset the file attributes you changed in step 11
  221.     back to their original values.  This is not necessary, however.
  222.  
  223. 16. Remove the bootable DOS diskette from drive A: and press CTRL+ALT+DEL
  224.     to reboot into OS/2 v2.0.
  225.  
  226. 17. You are done.
  227.  
  228. =========================== END OF DOCUMENT ============================
  229.