home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PROGRAMS / UTILS / HARDWARE / LEDSTUFF.ZIP / CLUSTER.TXT < prev    next >
Encoding:
Text File  |  1986-07-06  |  7.2 KB  |  168 lines

  1.                         2K CLUSTERS WITH DOS 3.1
  2.                             Bill Higgins
  3.                          Compuserve IBM SIG
  4.  
  5. The following text was uploaded to CompuServes IBM SIG on July 16, 1985, by 
  6. Bill Higgins (70575,307) and later modified by Jim Gainsley (76701,1007), 
  7. one of the SysOps of the IBM PC SIG.  Anyone considering an upgrade to DOS 
  8. 3.1, especially XT owners, should be interested in Bill's remarks on the 
  9. efficient use of hard disk space.  You must have DOS 3.1 to utilize the 
  10. procedures outlined in the following text.
  11.  
  12. If you have a 10 megabyte hard disk the following information permits you 
  13. to use 2k clusters instead of the standard 4k clusters.  Typically, you 
  14. will free about 10% of the disk space you are currently using.
  15.  
  16. Standard 10 megabyte fixed disks formatted under DOS 3.1 utilize 4k 
  17. clusters (i.e. the minimum space allocated to any file is 4096 bytes), 
  18. while drives 20 megabyte and larger utilize 2k clusters.  I use a PC with 
  19. twin 10 megabyte drives under DOS 3.1.  Since I have a multitude of small 
  20. files on these disks, the smaller allocation unit's space saving advantage 
  21. far outweighs any theoretical disadvantage of additional overhead for DOS 
  22. to handle the added allocation units.
  23.  
  24. With the help of Bob Morse, Sysops Jim Gainsley and Conrad Kageyama and the 
  25. DOS Technical Reference, I was able to make the changes necessarry to use 
  26. 2k clusters on both of my 10 megabyte drives.  By following the step-by-
  27. step instructions that follow, you will be able to make the switch to 2k 
  28. clusters yourself.
  29.  
  30. NOTE!  THE FOLLOWING PROCEDURE WILL DESTROY ALL DATA ON THE FIXED DISC!
  31.  
  32. You will need the following:
  33.  
  34. 1) IBM PC-DOS version 3.1 (3.0 appears not to work).
  35.  
  36. 2) A disk utility such as DISK REPAIR (a part of the IBM Professional DEBUG 
  37. Facility), or DISMOD (a user supported program available on many BBS's), or 
  38. equivalent.  (NORTON Utilities is OK)  You will not need this if you use 
  39. the Alternate Methode in 4a.
  40.  
  41. Most critical to the process is the sequence in which this procedure is 
  42. attempted.  Here is the 4k to 2k cluster procedure:
  43.  
  44. 1) Do a COMPLETE backup of the fixed disk, using your current version of 
  45. DOS.
  46.  
  47. 2) Cold boot DOS 3.1, then run FDISK to create (or be sure there exists) a 
  48. DOS partition on the fixed disk.
  49.  
  50. 3) Format the fixed disk using the DOS 3.1 FORMAT.COM program.  DO NOT use 
  51. any parameters (no /S or /V).
  52.  
  53. 4) Using your disk utility, select the boot sector and view it.  At offset 
  54. 0Dh, you should see the value of 08, which is the number of sectors per 
  55. cluster.  Change this to 04.  (0Dh is decimal 13, which means the 14th 
  56. byte, since counting starts with byte 0.  Recall that each byte is 
  57. represented by a hex pair.)
  58.  
  59. At offset 16h, you should see a value of 0800, which is the number of 
  60. sectors per FAT (in hex word format).  Change this to 1500.  Figure 1 
  61. displays an example of the boot record (24 bytes) as it originally appears 
  62. and the new boot record as it should appear once patched for 2k clusters.
  63.  
  64. FIGURE 1.
  65. -------------------------------------------------------------------------
  66. Boot record before modification:
  67.  
  68. EB299049 424D2020 332E3100 02080100 090002F3 50F80800
  69.                              **                  ****
  70.  
  71. Boot record after 2k cluster size changes:
  72.  
  73. EB299049 424D2020 332E3100 02040100 020002F3 50F81500
  74.                              **                  ****
  75.  
  76. The data elements directly above the double ** are the number of sectors 
  77. per cluster; the data elements directly above the four **** are the number 
  78. of sectors per FAT.
  79. ------------------------------------------------------------------------
  80.  
  81. All changes to the FAT sectors required for 2k clusters will be 
  82. accomplished by the subsequent format in instruction 6 below.  No other 
  83. manual changes are required.
  84.  
  85. 4a) Alternate Method:  If you would rather, and if you are familiar with 
  86. the operation of DEBUG, the following method can be used ('XXXX' means 
  87. 'anything is okay' and <cr> means to press Enter.)
  88.  
  89.      Under DOS 3.1, do:
  90.  
  91.      DEBUG <cr>
  92.      -L 0 n 0 1 <cr>
  93.      -E 0D <cr>
  94.      XXXX:0D       08.04 <cr>
  95.      -E 16 <cr>
  96.      XXXX:16       08.16 <cr>
  97.      -W 0 n 0 1 <cr>
  98.      -Q
  99.  
  100.      where n equals the fixed disk drive code, as follows:
  101.  
  102.      Drive designation               n
  103.  
  104.             B                        1
  105.             C                        2
  106.             D                        3
  107.             E                        4
  108.  
  109. Note:  Be really careful when you do the L and W commands in the foregoing 
  110. sequence.  It would be best to check your work by invoking DEBUG, then 
  111. entering the commands:
  112.  
  113.      -L 0 n 0 1 <cr>
  114.      -D 0D L1 <cr>
  115.      -D 16 L1 <cr>
  116.  
  117. making sure that the results are 04 and 15, respectively.  Then exit with
  118. Q <cr>
  119.  
  120. A more detailed explanation of these two changes:  The number of sectors 
  121. per cluster would change from 08 to 04, since that what this is all about.  
  122. The sectors per FAT will change, in order to accomodate (1) the increased 
  123. number of possible FAT entries, and (2) the increased size of each FAT 
  124. entry, which will be in 16 bit format instead of the former 12 bits.  The 
  125. value to use for a 10 megabyte disk and 2k clusters would be 21 sectors, or 
  126. 1500 in hex word format (In this case the 15 is all that counts: 15 hex = 
  127. 21 decimal.)
  128.  
  129. 5)  Exit the disk utility and do a COLD BOOT (turn the machine off, then 
  130. back on) with DOS 3.1.  This is critical, since the boot sector is read by 
  131. DOS only once, at boot time, in order to build the BIOS parameter block.  
  132. Having different information in the boot sector from what's in the memory-
  133. resident BPB will give unpredictable results!
  134.  
  135. The following is the safest way to proceed.  Please use it.
  136.  
  137. 6)  Reformat the drive using DOS 3.1 FORMAT.COM.
  138.  
  139.     FORMAT C:/S
  140.  
  141. (You may also include the /V, if you wish to include a volume label.)
  142.  
  143. DOS 3.1 FORMAT will not affect your changes to the boot sector.  (This is 
  144. changed from the DOS 3.0 FORMAT, which re-writes the boot sector.)
  145.  
  146. 7)  Restore your files, being sure to use the RESTORE parameter, /P, which 
  147. issues a prompt before restoring system files.
  148.  
  149.     WARNING!  You must not allow the two system files, IBMBIO.COM and 
  150. IBMDOS.COM to be restored, even if they are DOS 3.1!  If you do, they will 
  151. not be put in the proper locations and your fixed disk will not be bootable 
  152. and you will have to reformat!
  153.  
  154. Avoid restoring an earlier version of COMMAND.COM, but if you do restore an 
  155. earlier version, nothing is lost; just be sure to copy a 3.1 version over 
  156. it afterwards.  You should now be operational again, with 2k clusters.
  157.  
  158. Further information on the entries in the boot sector entries used to build 
  159. the BIOS Parameter Block can be found in the DOS 3.1 Technical Reference 
  160. Manual, page 2-28.  Of course, I cannot warrant that this change will work 
  161. for all controller/disk combinations, particularly for controllers and 
  162. drivers that are not 'XT clones' though it 'should work' for all drives 
  163. compatible enough to work under DOS 3.1.
  164.  
  165. Reprinted by permission of the Capital PC Users Group (CPCUG).  This 
  166. article may not be distributed for personal gain and is intended to be 
  167. used/distributed freely between PC users.
  168.