home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 1998 July / Image.bin / FESTPLAT / PRESIZER / PRESZR!.EXE / PRESIZER.DOC < prev    next >
Encoding:
Text File  |  1994-10-22  |  35.6 KB  |  676 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.                         Partition Resizer v. 1.0.4
  10.                         ==========================
  11.                              (c) Zeleps 1994
  12.                              ===============
  13.  
  14.  
  15.                 Program's Manual and Technical Information
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26. This file contains important information about the working and usage of
  27. Partition Resizer. Please read it carefully before using Partition Resizer.
  28. You MUST also read README.1ST before running Partition Resizer.
  29.  
  30. NOTE: This program is freeware. You may freely copy it and distribute it,
  31. as long as it remains unchanged and it is distributed with its original 
  32. doc files. The author is not responsible for any damage caused by the use of 
  33. this program. Using this program is completely at your own responsibility.
  34.  
  35. 1- What is Partition Resizer
  36.  
  37.    1.1 Why you need Partition Resizer
  38.    1.2 How does it work?
  39.    1.3 Is it safe?
  40.    1.4 Changes made to previous versions
  41.  
  42. 2- Working with Partition Resizer
  43.  
  44.    2.1 Safety precautions
  45.    2.2 Running the program: What does what
  46.  
  47. 3- Technical matters
  48.  
  49.    3.1 The partition system
  50.    3.2 The DOS partition structure
  51.    3.3 Is it all that easy?
  52.  
  53. 4- Partitioning Techniques
  54.  
  55.    4.1 Deciding what you want
  56.    4.2 Collecting many small partitions into a larger one
  57.    4.3 Splitting a partition in two
  58.    4.4 Playing with partitions' sizes and positions
  59.  
  60. 5- Credits and addresses
  61.  
  62.                                 -------||-------
  63.  
  64. 1- What is Partition Resizer
  65.  
  66.    1.1 Why you need Partition Resizer
  67.  
  68. For the last two years, more and more people search for more power in the
  69. new Operating Systems, like OS/2 or Windows NT, or even Linux and other
  70. Unices. But trying to escape from the black and white world of DOS isn't
  71. always that easy, since most of the existing (and interesting) software is
  72. still running under DOS. So, most of these users try to keep a DOS partition
  73. along with the new OS's partition. But this is not always easy, since
  74. repartitioning means loss of data, leading to the need of backup streamers,
  75. or worse (floppy backups). So, many users prefer to loose some of their data,
  76. while backing up the most valuable of it, in order to repartition their hard
  77. drive. I was in the same situation myself, so I thought: "Why not make a 
  78. resizing program? This would save me time and money". So I made this little
  79. program, which does exactly that: It can change a FAT partition's size, and
  80. it can move this partition into the empty disk space, so that you can make
  81. space to create new partitions, or when you get many small partitions, you can
  82. grow them into one larger. Well, all you have to do is to read carefully all
  83. the instructions, and then use the program. In section 3, I have included
  84. many technical information that will help you not only understand how this
  85. program works, but to get some basic knowledge on the partitioning and
  86. FAT file system.
  87.  
  88. But remember: This program does not intend to replace FDISK. It's rather
  89. complementary to it. You will need FDISK as soon as you make some empty
  90. disk space, in order to create the new partition. Partition Resizer does not
  91. remove partitions, and it does not create new ones.
  92.  
  93.  
  94.    1.2 How does it work?         
  95.    
  96. Well, this is the tricky part. The details are described in section 3, but
  97. I'll try to make a start from here. I assume that everybody understands the
  98. importance of partitioning. I also assume that most of you understand how 
  99. partitioning is achieved. For those who don't, here it is: 
  100.  
  101. Partitioning is just a marking of territories on the physical disk's surface.
  102. At the first sector of the disk (sector 1, head 0, cylinder 0) resides an 
  103. executable code block, which looks for the bootable partition, and runs
  104. it's boot sector code. That sector contains the information needed to 
  105. divide the disk space into partitions. Later on, the boot sector (which is
  106. created by the OS's format utility) loads the OS Kernel (in DOS's case it
  107. loads the IO.SYS and the MSDOS.SYS), which continue the job by loading
  108. the information of all the partition structure into memory.
  109.  
  110. Partition Resizer does two things: When moving, apart from moving the data, 
  111. it changes the information contained in the partition structure. When
  112. resizing, it changes the file system's data, which is contained in the
  113. boot sector and the FAT area. Both partition and FAT FS structures are
  114. explained at section 3. 
  115.  
  116.  
  117.    1.3 Is it safe?
  118.  
  119. The program has worked correctly in all cases, and no bugs have been 
  120. detected after hundreds of tests. I have tested all the partition combinations
  121. I could think of, and it worked correctly. After the tests, every file in
  122. the partition was compared with the originals, and the partition itself
  123. was checked byte by byte with the Disk Editor. Everything seems to work fine,
  124. and so is for several other systems. I also tried it on my primary hard
  125. disk, which is a Western Digital Caviar 2340, without backing up my data
  126. (I ensure you that I have valuable data stored in there). Everything went
  127. great, and the system is working perfectly, without a byte missing.
  128.  
  129. But reliability isn't everything. Stability is also a great factor. And this
  130. program is so stable that it can restore its work even after a sudden power
  131. shutdown! Normally, if the program was interrupted during the resizing
  132. or moving process, it would be impossible to access the partition's data again.
  133. This program stores every single step, so it always knows what the last action
  134. was. For speed and safety reasons I use the cmos's bytes 1,3 and 5 (the
  135. alarm bytes) to store the step counter number. Because the contents of the 
  136. cmos are preserved even when the power is off, the program can always find
  137. the last step and continue it's work like nothing happened. If you don't 
  138. believe it, test it.
  139.  
  140. There is only one thing that I couldn't prevent: Bad sectors. In case your
  141. disk has bad sectors, the program will not run, in order to protect your
  142. data. It will make a surface scan before it starts, but if you are certain
  143. that your disk is free of defects, you may skip it. It would be better if you
  144. had your disk surface scanned with a commercial program (like Norton Disk 
  145. Doctor or PC Tools DiskFix) before you run Partition Resizer. 
  146.  
  147.  
  148.    1.4 Changes made to previous versions
  149.  
  150. - Linux partition incompatibility from v. 1.0.1 fixed.
  151. - Stack overflow error when trying to resize an extended partition from
  152.   v. 1.0.2 fixed.
  153. - Many drives support (instead of two) added.
  154. - Minor changes in the interface.
  155.  
  156.  
  157. 2- Working with Partition Resizer
  158.  
  159.    2.1 Safety Precautions
  160.  
  161. As with every program that messes with your data, you should be extra
  162. careful. It is not difficult to make a mistake that will cost you valuable 
  163. data. So, you must follow carefully the instructions contained in the
  164. file README.1ST, in order to ensure data safety. It would be a good idea
  165. to print TROUBLE.DOC file in order to have it available when something
  166. wrong happens.
  167.  
  168.  
  169.    2.2 Running the program: What does what
  170.  
  171. The program will first look for the disk characteristics, it will scan the
  172. partition information, and it will identify and check all the DOS partitions
  173. of the disk. After some basic checks, it will continue with the main menu
  174. of the program. Here you have 5 choices. The first is resizing a DOS partition
  175. or an extended partition. This option will resize a partition in order to 
  176. make free space for a new partition to be created. It will also grow a 
  177. partition if there is unallocated space available and the cluster size is big
  178. enough. You can also resize extended partitions. When you resize the 
  179. partition, you may use the second option, move partition, to move the
  180. partition in the empty space. This way you will be able to change the order
  181. of the partitions in the disk. The third option is used to change a 
  182. partition's cluster size. This will help you to make a small new partition 
  183. able to grow up to any size you want. This option should be used ONLY on
  184. empty and formatted partitions, since it deletes all the data inside the
  185. partition. The fourth option will show you detailed information for every
  186. partition on the disk. This may sometimes help you find out which partition
  187. you want to move or resize. The last option will exit the program, and if
  188. you made any changes to the partition structure it will immediately reboot
  189. the machine, so that the new information will be loaded from the disk.
  190.  
  191. Every choice but 5, will lead you to a menu where you will be asked to choose
  192. the partition which should be modified. Just enter the partition's number
  193. and press enter. On the left of every partition description, there can be 
  194. three markings. The marking * shows that the specified partition can be 
  195. resized. Only partitions with * can be resized. The marking # shows which 
  196. partitions can be moved. Marking ! shows that a partition is incompatible with 
  197. the program, therefore it cannot be moved or resized. All partitions can be 
  198. moved, but this is not always safe. I have tried moving FAT and HPFS 
  199. partitions successfully, but I cannot be sure for every partition type. If you 
  200. decide to move any other partition type but FAT, you will be proceeding at 
  201. your own risk. 
  202.  
  203. After choosing the partition you want, you will be asked to change the
  204. new partition's size or move it. This can be done on the Cylinders map,
  205. with the +,-,*,/ keys. You can always press ESC to quit to main menu. 
  206. If you decide that the new setting satisfy you, you may then press enter.
  207. You will be asked to confirm your action, so you should press 'y' here.
  208. Any other key will get you back to main menu. 
  209.  
  210. The screen will now clear, and you will be asked whether you want to perform
  211. a surface test or not. This is not necessary if you know that your disk
  212. is free of defects or if you performed a surface test recently, since
  213. it will take some time (from several seconds to 15 minutes, depending on the
  214. size of the partition). If you are uncertain, perform the surface test, since
  215. bad sectors can be dangerous to your data. If the program finds any bad 
  216. sectors, it will quit immediately. If the surface test concludes normally,
  217. the program will start performing the requested changes. This may take from
  218. a few seconds to a few hours, so be prepared. If the program is terminated
  219. abnormally, p.e. in case of a power shutdown, don't worry, you can always
  220. reboot and run the program again. It will continue exactly from the point it
  221. stopped, so there is no worry. After it finishes, you may proceed with more
  222. changes, or exit the program, which will boot your machine.
  223.  
  224. Sounds easy? Well, it should be. But if you are confused, you better check out
  225. what's on the next section, just to get an idea about the whole partitioning
  226. system. If you still have questions, you can get help from friends, or contact
  227. me via my Internet, Fidonet, or Signet addresses (see the end of this 
  228. document). If you don't have access to any of these networks, you can send
  229. me a letter (postcard preferred) and I will try to help you as much as I can.
  230. Don't forget to tell me details about your system, your partitions, and if
  231. you can, send me hard copies of the info screens from Partition Resizer.
  232.  
  233.  
  234. 3- Technical Matters
  235.  
  236.    3.1 The partition system
  237.  
  238. The partition system is one of the most important things on the disk 
  239. subsystem. It is a standard beyond File Systems and Operating Systems.
  240. The partition structure looks very much like the DOS directory structure. 
  241. The root directory here is the root sector, the first sector of the disk.
  242. When the machine boots, bios loads this sector at address 7C00:0000, 
  243. and jumps there. As you understand, there is code written at the beginning
  244. of that sector. This code searches the primary partition list to see which
  245. one is bootable, then loads its first sector (the boot sector) at the same
  246. address (7C00:0000) and it jumps there. After that, it is the operating 
  247. system that takes control. 
  248. Let's see some more details. Here is a detailed map of the root partition
  249. sector (sector 1, head 0, cylinder 0) (you may often see it as MBR, master
  250. boot record):
  251.  
  252. Offset             Description                
  253.  
  254. 0x000-0x0DA        Boot code
  255. 0x1BE-0x1CD        First Primary partition descriptor
  256. 0x1CE-0x1DD        Second Primary partition descriptor
  257. 0x1DE-0x1ED        Third Primary partition descriptor
  258. 0x1EE-0x1FD        Fourth Primary partition descriptor
  259. 0x1FE-0x1FF        System Marking word (0xAA55)
  260.  
  261. Boot code it the executable code that was described above. The partition
  262. descriptors, have the following form:
  263.  
  264. Offset             Description
  265.  
  266. 0x0                Boot marking
  267. 0x1                Side                    \
  268. 0x2                Sector & Cylinder 8-9    >  Starting location
  269. 0x3                Cylinder 0-7            /
  270. 0x4                System Description
  271. 0x5                Side                    \
  272. 0x6                Sector & Cylinder 8-9    >  Ending location
  273. 0x7                Cylinder 0-7            /
  274. 0x8-0xB            Relative sector
  275. 0xC-0xF            Number of sectors in partition
  276.  
  277. Boot marking is a byte value, which can be either 0 or the drive number
  278. (0x80). If it is 0x80 then the partition is the active partition of the
  279. disk (boot partition), and that's where the system boots from. The next
  280. 3 bytes contain the side, cylinder and sector where the partition begins.
  281. Sector and cylinder are stored in two bytes. Bits 0-7 of the cylinder
  282. value are stored in the second byte, while bits 8-9 are stored at the
  283. high bits of the first byte. The sector value is stored at bits 0-5 of the
  284. first byte. So, the word is bitmapped like this:
  285.  
  286. FEDCBA98 76543210
  287. CCCCCCCC CCSSSSSS
  288. 76543210 98543210
  289.  
  290. where C are Cylinder bits (the number below shows which cylinder bit is
  291. which) and S are Sector bits. Right after is the system byte, which is
  292. the identification byte for the partition. A value of 0 Means that the 
  293. partition is not being used, while other values depend on the file system.
  294. DOS uses values 1,4 and 6 for FAT12, FAT16 and BigDOS partitions respectively.
  295. A value of 5 means Extended partition, which is explained later on. 
  296. Next, there is the ending location (sector) of the partition, and later on,
  297. the relative sector value. This is a number that shows the position of the
  298. partition relative to the present sector. So, for primary partitions, it's
  299. the starting sector of the partition (Primary partitions are the partitions
  300. that are described in the root of the partition structure. As we will see
  301. later on, there are partition descriptors in other places on the disk as 
  302. well, which are called logical drives). The last item of the descriptor,
  303. is the partition length (in sectors). 
  304.  
  305. In the root sector, there is space for 4 descriptors. Right after them, there
  306. is a word value of 0xAA55, which marks the sector as system sector. This
  307. value exists on every sector of the partition structure (including boot 
  308. sectors) and if it doesn't exist, then the structure may probably be damaged.
  309.  
  310. Now, concerning extended partitions, they are described as any other partition
  311. in the root sector, but their treatment is different. These partitions are
  312. specifically treated by the Operating Systems. They point to a sector which
  313. contains partition descriptors for other partitions and extended partitions,
  314. and so on. This is how we can have more than 4 partitions on a disk. Let's
  315. see a small graphic example:
  316.  
  317. MBR     1st Ext         2nd Ext         3rd Ext
  318.        -----------------------------------------------------
  319. 1:p    | 1:l           | 1:l           | 1:l               |
  320. 2:p    | 2:e-----------| 2:e-----------| 2:-               |
  321. 3:e----| 3:-           | 3:-           | 3:-               |
  322. 4:p    | 4:-           | 4:-           | 4:-               |
  323.        -----------------------------------------------------
  324. In this example, we see a map of a partition structure. MBR stands for
  325. Master Boot Record (root sector) and 1st, 2nd and 3rd Ext stand for 
  326. 1st, 2nd and 3rd Extended partition nodes. 'p' stands for primary partition,
  327. 'e' stands for extended partition and 'l' stands for logical drive. 
  328. The 'e' partition in the MBR, is called main or root or primary extended
  329. partition. This is because the whole extended partition structure is depending
  330. on that partition. Now, the starting location of the primary extended 
  331. partition points to the 1st extended partition. The space that the primary
  332. extended partition allocates, is reserved for logical drives. The 1st 
  333. extended partition (and the rest as well) contain information about their
  334. respective logical drives, in a way identical to the MBR (described above),
  335. but without the boot code part. Every extended partition has 4 descriptors
  336. as well, which may contain logical drives, or extended partitions as well.
  337. So, the partition structure is a linked list structure, which can be
  338. as long as we like. (Every extended partition description sector has the
  339. 0xAA55 mark at its end, to identify it as a system sector).
  340.  
  341. There are of course some specifications for partitions. Partitions must 
  342. start at the beginning of a cylinder, and end at a cylinder's end. This is
  343. that starting location must always be Cyl: XXXX  Head: (0 or 1)  Sector 1 and 
  344. the ending location must be Cyl: YYYY  Head: k-1  Sector l, where k is the
  345. number of heads of the physical disk, and l the number of sectors per track
  346. of the physical disk. Also, if you delete one of the middle logical drives, 
  347. (p.e. the 2nd Ext.) then the previous extended partition will be connected
  348. directly to the next, replacing the link. 
  349.  
  350. If you want to see the whole thing yourself, you can make your primary DOS
  351. partition smaller, and create some new logical drives just to play with
  352. them. You can get much help from a commercial Disk Editor, and you can of
  353. course play with Partition Resizer. 
  354.  
  355.  
  356.    3.2 The DOS partition structure
  357.  
  358. The MBR executable code will load the boot partition's boot record. This
  359. is the second step of the booting procedure. And this is where the whole 
  360. thing differs from OS to OS. We will only look at DOS's proceedings for now,
  361. since the rest OS's are less documented and more complicated (although on the
  362. next version of Partition Resizer I'll manage to resize OS/2 partitions, and
  363. if I get lucky enough, why not NTFS...). 
  364.  
  365. The DOS partition is rather simple: The first sector is the boot sector,
  366. right after there are two copies of the FAT (File Allocation Table), right
  367. then we have 32 sectors for the root directory, and finally we have clusters
  368. 0 and 1 (unused) and later on the rest of the clusters. 
  369.  
  370. The Boot record, is an executable code block, which is loaded by the MBR,
  371. and it makes some preparation in order to load the IO.SYS file, which is
  372. the DOS kernel (if we can call it a kernel... ;-)). This is useless to us,
  373. since only the processor can understand machine code, but the boot sector
  374. also contains useful information. This information begins at offset 3 of 
  375. the sector and contains the following:
  376.  
  377. Offset            Description
  378. 0x03-0x0A         OEM ID: This is a small string written by the formatter.
  379. 0x0B-0x0C         Bytes per sector: This is always 512 (it depends on the
  380.                   physical disks characteristics). If you have a disk with
  381.                   a different value, please don't hesitate to inform me.
  382.                   Partition Resizer WON'T WORK FOR DISKS WITH SECTOR SIZE 
  383.                   OTHER THAN 512!
  384. 0x0D              Sectors per Cluster: The cluster is the basic block of
  385.                   information on a FAT drive. A FAT drive cannot have more 
  386.                   than 65527 clusters. This size can limit the maximum size
  387.                   a partition can reach after resizing.
  388. 0x0E-0x0F         Reserved sectors at beginning: This is normally 1, the
  389.                   boot sector. After these sectors, begins the FAT area.
  390. 0x10              FAT copies: How many FAT copies are there. Normally there
  391.                   are two copies of FAT.
  392. 0x11-0x12         Root directory entries: This is normally 512. This shows
  393.                   the maximum number of files and directories that root 
  394.                   directory can hold. This is because the root directory has
  395.                   a constant length (512 entries * 32 bytes/entry / 
  396.                   512 bytes/sector = 32 sectors)
  397. 0x13-0x14         Total sectors on disk (small): If we have less than 65536
  398.                   sectors in the partition, this value contains the number. 
  399.                   If it's more, then the number is stored in bytes 0x20-0x23.
  400.                   This is an entry that was left from the old DOS versions,
  401.                   when partitions could have up to 65536 sectors.
  402. 0x15              Media descriptor byte: This byte is always F8 for hard
  403.                   disks.
  404. 0x16-0x17         Sectors per FAT: This shows how many sectors does each FAT
  405.                   take up. This depends on how many clusters the partition 
  406.                   has, and what is the FAT type (12bit/16bit). This can be
  407.                   from 1 to 255 sectors.
  408. 0x18-0x19         Sectors per track: Same as the physical disk's sectors per
  409.                   track value.
  410. 0x1A-0x1B         Sides: Same as the physical disk's head number.
  411. 0x1C-0x1F         Special hidden sectors: This is how many sectors exist
  412.                   between the partition's description sector and the boot
  413.                   sector. Usually one track.
  414. 0x20-0x23         Big total number of sectors: If we have more than 65536 
  415.                   sectors in the partition, their number is written here.
  416. 0x24-0x25         Physical drive number: This is the physical drive number
  417.                   (c:0x80, d:0x81 etc.).
  418. 0x26              Extended boot record signature: This marks an extended 
  419.                   boot record. If it is 29, the disk was formatted by DOS
  420.                   4.0 or later.
  421. 0x27-0x2A         Volume serial number: This is the partition's serial number.
  422. 0x2B-0x35         Volume label: This is the partition's label string.
  423. 0x36-0x3D         FS ID: This is a string that identifies a partition as
  424.                   12bit FAT or 16bit FAT. 
  425.  
  426. This is a detailed description of the boot record information. This will
  427. help you to understand more about the FAT file system. 
  428.  
  429. The boot sector is the first sector of a DOS partition. The number of
  430. reserved sectors (which is normally 1) shows how many sectors we have before
  431. the FAT area. So in most cases, the first FAT sector is sector 2 of the
  432. partition (from now on, every sector number will be taken relatively from
  433. the beginning of the partition). The first FAT, who's length is given 
  434. in the boot sector, contains entries that mark the partition's space 
  435. allocation. Every file has a small descriptor of 32 bytes, which resides in
  436. its directory area (not in FAT). The directory area is itself a file, which
  437. is described in its parent directory, and so on until we reach root directory,
  438. which is a constant area in the partition (we'll see that later on). A word
  439. value in the file descriptor, tells DOS which is the file's first cluster.
  440. FAT consists of word values (or 12bit values if it is a 12bit FAT system),
  441. which begin from the first sector, and continue until the last one. Every
  442. value represents a cluster, which one is depending on the value's offset from
  443. the FAT's beginning. So, the 3rd word of the FAT stands for the 3rd cluster
  444. of the partition, and so on. So when DOS knows a file's first cluster, it's
  445. looking it up to find the value that is stored in the FAT's respective 
  446. position. That value points to the next cluster of the file, and so on, until
  447. an EOF marking of 0xFFFF is found (0xFFF for 12bit FAT). Empty clusters are
  448. marked with 0 and bad clusters with 0xFFF7. This is how FAT works. Now, the
  449. first two positions of the FAT are reserved, and they have an identification
  450. code which is 0xFFFFFFF8 (0xFFFFF8 for 12bit FAT). 
  451.  
  452. The rest FATs (2nd, 3rd etc.) are identical to the first one. They are
  453. exact copies of the first FAT, and they begin right after the end of the
  454. first FAT. Right after the last FAT, resides the root directory. This is
  455. normally 32 sectors long, and contains 32 byte entries which describe the
  456. root directory's files and directories. Right after the root directory, 
  457. begins the first cluster (cluster 0) which is unused, and so is for cluster 1.
  458. Right after these two clusters, begins the user's space, where the files are
  459. stored.
  460.  
  461. This is the whole story about DOS's file system. This file system was designed
  462. to be fast (it's very easy to find the unallocated space) but it has certain
  463. disadvantages: One is the very large amount of unused space, which is caused
  464. by the use of clusters. For example, if you have a 340MB disk, you have to
  465. use 8192 bytes cluster size (16 sectors). This means that, if you write
  466. a file that is 0 or several bytes long, you will consume space of 8K. This 
  467. could be resolved if we could use more than 65536 clusters in a DOS partition,
  468. which could mean a 20bit fat or more, in order to have clusters of 1 sector.
  469. Since this is not possible, there is another solution: Why should I have
  470. one partition with 8K cluster size, and not 2 partitions with 4K cluster size?
  471. The loss is lowered dramatically, and it would save many megs. This is not 
  472. though always possible, since changing cluster size without loosing the 
  473. existing data is extremely complicated. But who knows, wait till you see the
  474. next version of Partition Resizer...
  475.  
  476.  
  477.    3.3 Is it all that easy?
  478.  
  479. Well, actually it isn't. DOS partitions were designed to remain unchanged. 
  480. So, I faced lots of problems while trying to successfully resize them. The
  481. worst was the FAT12 to FAT16 and vice versa conversion. Why is that needed?
  482. Because those #$%#$@#^!@ who designed the FAT file system, thought it would
  483. be smart to determine the FAT type from the partition's clusters number...
  484. runtime! This means that when you boot your machine, DOS calculates the
  485. number of clusters in a partition, and if it is less than 4088, it's assuming
  486. the FAT to be 12bit, or if it's greater or equal that 4088 it takes it to be
  487. 16bit! Well, I couldn't find a good reason to this technique, but it caused
  488. much trouble, since if I grow a partition over 4088 clusters, or shrink it
  489. to less than 4088, I have to change the FAT from 12 to 16 or vice versa.
  490.  
  491. Another thing that troubled me was the fact that PC Tools DiskFix found
  492. errors in the partition structure while everything seemed to be OK. Later
  493. on, I discovered that PC Tools give a false alarm, if there is empty space
  494. in the extended partition before the first logical drive. This means that,
  495. if you have two logical drives in the extended partition, and you delete the
  496. first one, then PC Tools will warn you without a reason. This is not because
  497. of my program, since the same thing happens with FDISK too. 
  498.  
  499. Still more problems appeared, when I fixed all the above, since PC Tools
  500. consider the cluster limit to be 4080 clusters, and not 4088. So, while
  501. DOS and CHKDSK found the partition to be OK with 4084 clusters and 12bit
  502. FAT, PC Tools DiskFix considered it as 16bit, and it appeared to be messed
  503. up. So, I avoid to make a partition to have clusters number between 4080
  504. and 4088, just to avoid similar problems with other programs.
  505.  
  506. So, normally the partition should be resized correctly. But in case your
  507. diagnostics program finds FAT errors or anything, don't jump to conclusions.
  508. Try the good old CHKDSK. And if you still doubt your partition's integrity,
  509. try a third diagnostics program to get rid of all your doubts.
  510.  
  511.  
  512. 4- Partitioning Techniques
  513.  
  514.    4.1 Deciding what you want
  515.  
  516. Well, OK, you've got the program. But now what happens? Where will you 
  517. create the proper space for a new partition? And which partition is the one
  518. you want to shrink or grow? How should you place the partitions in the 
  519. empty space to order them as you like? How will you grow a partition which
  520. refuses to grow more? 
  521.  
  522. First of all, you have to decide what you want. Take a look at the partition
  523. list that FDISK or Partition Resizer provide you. Decide which partitions)
  524. you need to resize. You may recognise them by their size, or serial numbers.
  525. Then you'll have to think what the new sizes will be. Don't forget that
  526. resizing a logical drive doesn't make space for primary partitions, but only
  527. for logical drives. You will have to move the partitions inside the extended
  528. partition, and then resize the extended partition itself in order to make
  529. space for a new primary partition. The same is for logical drives. Think
  530. of the extended partition like a balloon in a box. You cannot get space in
  531. the box if you don't deflate the balloon, and you cannot inflate the balloon
  532. if you don't empty some space in the box. Remember that what's inside the
  533. extended partition cannot get out of it, and what's outside cannot get inside 
  534. either.
  535.  
  536. Now, here are some useful techniques to use in certain situations. Just take
  537. a look to see if they meet your needs.
  538.  
  539.    
  540.    4.2 Collecting many small partitions into a larger one
  541.  
  542. Sometimes, you get your disk divided into three or four partitions, which
  543. is not a useful thing. Until now, the only solution was to backup all
  544. your data, delete the whole partition structure, and then create a large 
  545. partition to put your data inside. Partition Resizer can resolve the 
  546. problem without any backing up. It's much faster and easier. Just do the 
  547. following:
  548.  
  549. a. Decide which partition will be the one to remain. Normally, you should
  550. choose a primary partition. The problem is if it can grow enough. Decide 
  551. what is the size the partition will finally grow to, and check if your
  552. primary partition can grow to that size. If it can't, go to step b, otherwise 
  553. read step c.
  554.  
  555. b. If you want to create a partition that can grow enough for your needs,
  556. you will have to empty your primary partition. To do this, you have to 
  557. shrink it to its minimum, while growing a logical drive. This can be done by
  558. shrinking the primary partition, expanding downwards the extended partition,
  559. moving the first logical drive to the beginning of the extended partition,
  560. and growing it to the max. Then, exit the program, move as much files as you
  561. can from the primary partition to the grown logical drive, defrag the 
  562. primary partition, and repeat step b until the primary partition is empty.
  563. When you empty it, use the program to change its cluster size that matches 
  564. your needs. You can provide the program with the desired size, which is the
  565. size you want the partition to have when you finish the whole process. 
  566. Partition Resizer will then suggest you a cluster size to apply to the
  567. partition, which is the optimum size for the given desired partition size. 
  568. If this was your boot partition, you will have to make it a system partition
  569. again, so run SYS to do that.
  570.  
  571. c. Now that your primary partition is able to grow enough, start moving 
  572. data into it. Try to get data from small partitions, so that you can 
  573. finish with them early and get rid of them. If you filled up the primary
  574. partition and there's still data in the partition which you are emptying,
  575. move data from the emptying partition to other partitions, in order to 
  576. empty it faster. When the partition is empty, you can delete it with FDISK.
  577. If you cannot empty it, then defrag it, shrink it to its minimum, and move
  578. it to the end of the empty space created, grow the previous partition to
  579. reclaim the empty space created, exit the program, and move the rest of the
  580. data remaining into the grown partition. Repeat this until you empty the 
  581. partition, and then delete it with FDISK.
  582.  
  583. d. One of the small partitions is now deleted. You can now move all the
  584. other logical drives to the end of the empty space, and resize the extended
  585. partition in order to make more space to grow the primary partition. Then
  586. choose another partition and repeat step c until you empty and delete all the
  587. logical drives. With the last one, you can delete the extended partition
  588. too. And presto! You can now grow the primary partition to fill all the
  589. empty space in the disk.
  590.  
  591.  
  592.    4.3 Splitting a partition in two
  593.  
  594. This technique is much alike the previous one. Suppose you have one primary
  595. partition, and you want to split it in two partitions. This is faster and
  596. easier than the previous procedure, just do the following:
  597.  
  598. a. Defrag the primary partition, and then shrink it to the minimum. This way,
  599. you will create empty space for the new partition.
  600.  
  601. b. Using FDISK create an extended partition, and then a logical drive in it.
  602. Format the logical drive, and run Partition Resizer. You will now have to
  603. decide the final size of the new partition, in order to change its cluster
  604. size while it is still empty. When you decide the final size, choose the
  605. third option of Partition Resizer's main menu, and give as desired size the
  606. size you decided. The program will suggest you a cluster size that is optimum
  607. for the partition, and you should apply that size.
  608.  
  609. c. When you finish creating and modifying the new partition, exit the program,
  610. and move the data you want in the new partition. Then, shrink the primary
  611. partition again (defraging is necessary here), extend the extended partition's
  612. starting position towards the beginning of the disk, and then move the logical
  613. drive to the beginning of the extended partition. Grow the logical drive
  614. to the maximum, and repeat this step, until you reach the desired size.
  615.  
  616.    
  617.    4.4 Playing with partitions' sizes and positions
  618.  
  619. And now, some general advice about partition resizing:
  620.  
  621. a. When shrinking a partition, always defrag it first. This will leave 
  622. space at the end of the partition, which will be freed by the program. The
  623. less space you have at the end of the partition, the less the shrinking will
  624. be. When defraging take special care for the unmovable files: They must be
  625. moved too, so change their attributes before defraging the disk. System
  626. files are a special case of unmovable files. You must be extra careful with
  627. these. Check the TROUBLE.DOC to see more info about the system files.
  628.  
  629. b. Although Partition Resizer can move primary partitions, you will rarely
  630. need to do this. You should always leave your DOS primary partitions in their
  631. original place, unless you absolutely need to move them. This will not harm
  632. the partition, but it might leave unused space before the primary partition
  633. which will never be used by DOS's FDISK. 
  634.  
  635. c. If you want to install a new operating system, you may have to delete
  636. much of your data in the DOS partition, since you cannot move that data in
  637. the new partition. So, you will only have to shrink your DOS partition once.
  638.  
  639. d. Always follow the safety rules described in README.1ST. Playing with your
  640. data can be REALLY dangerous sometimes, so be very careful.
  641.  
  642.  
  643. 5- Credits and addresses
  644.  
  645. First of all, I would like to thank everyone that believed in my project
  646. (that is ABSOLUTELY NOBODY!). I would like to thank Laertis (Billy Anagnostou)
  647. for sharing his work with me, since he was the first to disassemble MBR
  648. code and Boot record code, and gave me the basic knowledge on partitioning.
  649. I would also like to thank Raymond Skevakis for testing my program on his
  650. disk before I even finish it. I also thank you, for spending the time to
  651. read this document and for using my program. I hope that the technical info 
  652. included in here will seriously help many of you to create your own programs. 
  653. If you find this program useful, you can always send me a postcard to the 
  654. following address:
  655.  
  656.         John Lagonikas
  657.         17 Lycourgou Str.
  658.         16675 Glyfada
  659.         ATHENS, GREECE
  660.  
  661. or send me a netmail to any of these addresses:
  662.  
  663.         FidoNet: 2:410/124.6
  664.         SigNet: 27:1330/100.6
  665.         GrUnNet: 30:3001/108.1
  666.  
  667. or leave mail for me in the Internet address:
  668.  
  669.         zeleps@hol.ath.forthnet.gr
  670.  
  671. Of course, if you have any question you'd like to ask me about the program or
  672. the technical info, don't hesitate to send me a message. I'll be glad to help
  673. you (if I can of course).
  674.  
  675.                                ------||------
  676.