home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / fips15.zip / fips.doc < prev    next >
Text File  |  1995-08-22  |  24KB  |  524 lines

  1.                   Welcome to FIPS
  2.     The First nondestructive Interactive Partition Splitting program
  3.  
  4.                 Version 1.5
  5.                   august 22, 1995
  6.  
  7.              Copyright 1993-95 by Arno Schaefer
  8.  
  9.  
  10. 0.  What you need to use FIPS
  11. 1.  Introduction
  12. 2.  What FIPS does
  13. 3.  Safety
  14. 4.  Restrictions
  15. 5.  Before you start
  16. 6.  Use with a multitasking OS
  17. 7.  Using FIPS
  18. 8.  After splitting the partition
  19. 9.  Commandline Switches
  20. 10. Troubleshooting
  21. 11. Credits
  22.  
  23.  
  24. In file SPECIAL.DOC:
  25.  
  26. S1. Use with Stacker/SuperStor/Doublespace etc.
  27. S2. Use with OS/2
  28. S3. Use with OnTrack Disk Manager and similar drivers
  29.  
  30.  
  31. FIPS is a program designed to split an existing DOS partition without deleting
  32. the data on it.
  33.  
  34. FIPS is free software; you can redistribute it and/or modify
  35. it under the terms of the GNU General Public License as published by
  36. the Free Software Foundation; either version 2, or (at your option)
  37. any later version.
  38.  
  39. FIPS is distributed in the hope that it will be useful,
  40. but WITHOUT ANY WARRANTY; without even the implied warranty of
  41. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  42. GNU General Public License for more details.
  43.  
  44. You should have received a copy of the GNU General Public License
  45. along with FIPS; see the file COPYING.  If not, write to
  46. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  47.  
  48. Report problems and direct all questions to:
  49.  
  50.     schaefer@rbg.informatik.th-darmstadt.de
  51.  
  52.  
  53. 0. What you need to use FIPS
  54.  
  55. You need a defragmentation program in order to move all data to the beginning
  56. of the hard disk. FIPS will only split your partition if you have enough free
  57. space at the end. DOS 6.0 and later contains DEFRAG, which is suitable for
  58. this purpose. Other suitable programs are Norton Speedisk (actually DEFRAG
  59. is speedisk with less functions, licensed from Norton), PCTools' Compress,
  60. DISKOPT in Novell DOS 7, or the shareware programs ORG, DOG or SAFPAK
  61. (available by anonymous FTP from any SimTel mirror in the diskutil directory).
  62. I did not test these however, so don't blame me if they don't work for you.
  63.  
  64. You may also want to use a program like Norton Disk Doctor (or 'scandisk'
  65. in DOS 6.2) to check your harddisk before and after using FIPS.
  66.  
  67. FIPS was developed under DOS 5.0. It should work fine with anything above
  68. 3.0, perhaps even with 2.0. However it will not be of much use with older
  69. DOS versions, since the large partition sizes are only available since DOS 4.
  70. It has been reported to work with DOS 6.0 and 6.2 and Novell DOS 7. I have
  71. also received reports about successful use with Windows95 partitions. Note
  72. that the long filenames are no problem for FIPS, because it works on a
  73. lower level where directory structure is of no concern. It is probably
  74. sensible to boot from a DOS disk before using FIPS in such a setup (see 6.)
  75.  
  76.  
  77.  
  78. 1. Introduction
  79.  
  80. The program was inspired by the Linux Project. When installing Linux on a
  81. PC that was used for DOS / Windows, many people want to retain a smaller
  82. partition for their DOS software. However, since most Harddisks contain
  83. only one large partition, you would normally be required to do a complete
  84. backup, erase the partition and build two (or more) new partitions. Then you
  85. would restore the backup to one of the new partitions. On today's systems
  86. with hard disk capacities of usually 500MB or more, a complete backup becomes
  87. practically infeasible without large media like streamer tapes once the
  88. drive has filled up to some considerable fraction. Even though many people
  89. backup their most valuable date (a practice which I would highly recommend
  90. in any case), the process of reinstalling all the software packages takes
  91. many hours or even days.
  92.  
  93. FIPS was written to remedy this problem. You can now split a partition
  94. without losing any data, provided there is enough free space for the new
  95. partition at the end of the old one.
  96.  
  97.  
  98. 2. What FIPS does
  99.  
  100. FIPS reduces the size of a partition by changing some values in the
  101. partition table and boot sector. It does not change the formatting of
  102. the partition, especially not the cluster size and the size of the file
  103. allocation table (FAT). Therefore the reduced partition will have a FAT
  104. that is in part unused, but this is not a problem for DOS.
  105.  
  106. From the free space that is won by this, FIPS creates a new _primary_ DOS
  107. partition.
  108.  
  109. If you want to use the new partition under a different OS (e.g. Linux), use
  110. its supplied fdisk program to make any necessary changes (refer to the OS
  111. manuals).
  112.  
  113. If you want to use the new partition under DOS/Windows, you can use it as
  114. it is (after formatting!), but be aware of the following:
  115.  
  116. According to the official references, DOS can only have one primary
  117. partition. All DOS versions (at least from v5.0 on) will happily work with
  118. multiple primary partitions, but this is an 'undocumented feature'. If
  119. you want to follow the official rules, you can delete the new partition with
  120. fdisk and create an extended partition in its place.
  121.  
  122. There are reasons for having multiple primary partitions, among them the
  123. possibility to boot from different partitions by changing the active par-
  124. tition with fdisk.
  125.  
  126. Known problems with multiple primary partitions are:
  127.  
  128. - If you accidentally delete one primary partition with fdisk, you can not
  129.   easily recreate it, since fdisk will refuse to. There may be other fdisk
  130.   programs around that work, and if all else fails you can boot from a
  131.   Linux boot disk to run Linux' fdisk, but it is always a hassle.
  132.  
  133. - There exist some software packages that work with the partition table and
  134.   which may be confused by multiple primary partitions. Among them was SFS,
  135.   the 'Secure file system' by Peter Gutmann. I think Peter has made a change
  136.   to his program to accept some unusual configuration, but there may exist
  137.   other software packages that will have problems.
  138.  
  139.  
  140. 3. Safety
  141.  
  142. FIPS was specifically designed to provide a maximum of safety. On startup
  143. it checks the Partition Table, Boot Sector and FAT for any inconsistencies.
  144. If it finds anything suspicious, it will tell you so. If there are errors,
  145. FIPS will not proceed.
  146. You have the possibility to write backup copies of your root and boot sector
  147. to a floppy disk before proceeding. If something goes wrong, you may restore
  148. these with the program 'restorrb.exe' (see section 5). I strongly recommend
  149. making use of this feature. It will also enable you to reverse the partition
  150. split afterwards, so it might be a good idea to save the root/boot sector
  151. image in a safe place.
  152. FIPS checks for free space on the partition and will let you choose the
  153. new start cylinder accordingly.
  154. After having calculated the new partition table and boot sector, FIPS will
  155. check everything again, so that possible bugs in the calculation may be
  156. detected. Only if everything is ok, FIPS will ask for permission to write
  157. the new root and boot sector.
  158.  
  159.  
  160. 4. Restrictions
  161.  
  162. FIPS will only work with Hard Disk BIOSes that use interrupt 13h for low
  163. level harddisk access. This is true for almost all PCs. I have received
  164. a report that an older Adaptec SCSI controller had a software driver
  165. that worked on a higher level. In this case you can only hope to get a
  166. new driver from Adaptec. This is no problem any more for all newer
  167. Adaptecs (I personally use one).
  168.  
  169. FIPS will only work on disks with a sector size of 512 bytes.
  170. It seems that DOS is prepared to deal with different sector sizes, but
  171. so far I have never seen this.
  172.  
  173. FIPS will not split partitions with 12 bit FATs (you would not want to split
  174. partitions with less than 10 MB, would you?).
  175.  
  176. FIPS will only split DOS partitions. Partition pable and boot sector must
  177. conform to the MSDOS 3.0+ conventions. This is marked by the system
  178. indicator byte in the partition table, it must have the value 4 (16 bit
  179. sector number) or 6 (32 bit sector number).
  180. It will especially *not* split Linux partitions.
  181.  
  182. FIPS does not yet work on extended DOS partitions. Support for these has
  183. been planned for a long time, but I can't say when it will come.
  184.  
  185. FIPS will not work if you already have four partitions, since it needs one
  186. free partition entry.
  187.  
  188. FIPS will not reduce the original partition to a size with less than 4085
  189. clusters, because this would imply rewriting the 16 bit FAT to a 12 bit FAT.
  190.  
  191.  
  192. 5. Before you start
  193.  
  194. Run CHKDSK or (under DOS 6.2) SCANDISK on the partition you want to split.
  195. If you have Norton Disk Doctor or something similar, you may use it alter-
  196. natively. Make sure there remain no 'dead' clusters on the disk.
  197.  
  198. Prepare a bootable floppy disk in drive A:. Under DOS this is usually done
  199. by giving the command 'sys a:' or 'format a:/s'. Under Windows NT or OS/2
  200. this may be different, if in doubt check your manual or boot from a boot
  201. disk from a DOS PC.
  202.  
  203. Copy the FIPS files RESTORRB.EXE, FIPS.EXE and ERRORS.TXT to this disk.
  204.  
  205. Test booting from the prepared floppy disk. Read you manual or ask a local
  206. guru if you can't boot from floppy disk or if you can not access your hard
  207. disk after booting (test this by giving the command 'dir c:', you should
  208. see your hard disk's root directory). If all else fails, try using FIPS
  209. after booting normally from the hard disk (a bit more risky, but sometimes
  210. the last resort).
  211.  
  212. When you start FIPS (later!), you will be given the opportunity to write
  213. backup copies of your root and boot sector to a file on drive A: called
  214. ROOTBOOT.00x (where x stands for a digit from 0 to 9). If anything goes wrong
  215. while using FIPS, you can restore the original configuration by booting from
  216. the floppy and running RESTORRB. Please note: if you use FIPS more than once
  217. (this is normally not necessary, but it may happen), more than one ROOTBOOT
  218. file is written to the floppy disk. RESTORRB lets you choose which configu-
  219. ration file to restore. The file RESTORRB.000 contains your original confi-
  220. guration. Try not to confuse the versions.
  221.  
  222. You will need this backup file (ROOTBOOT.00x) if you want to undo the
  223. partition split later.
  224.  
  225. But before starting FIPS you _must_ now defragment your Harddisk. All of the
  226. space that will be used for the new partition must be free. Be aware that the
  227. Windows Swapfile will not be moved by most defragmentation programs. You must
  228. uninstall it (in the 386enhanced part of the Windows Control Panel) and rein-
  229. stall it after using FIPS.
  230. If you use IMAGE or MIRROR, the last sector of the hard disk contains a
  231. hidden system file with a pointer to your mirror files. You _must_ delete this
  232. file before using FIPS (it will be recreated the next time you run mirror).
  233. Do 'attrib -r -s -h image.idx' or 'attrib -r -s -h mirorsav.fil' in the root
  234. directory, then delete the file.
  235. If FIPS does not offer as much disk space for creation of the new partition
  236. as you would expect it to have, this may mean that
  237.  
  238. a. You still have too much data in the remaining partition. Consider making
  239.    the new partition smaller or deleting some of the data.
  240.  
  241. b. There are hidden files in the space of the new partition that have not
  242.    been moved by the defragmentation program. You can find the hidden files
  243.    on the disk by typeing the command 'dir /a:h /s' (and 'dir /a:s /s' for
  244.    the system files). Make sure to which program they belong. If a file is
  245.    a swap file of some program (e.g. NDOS) it is possible that it can be
  246.    safely deleted (and will be recreated automatically later when the need
  247.    arises). See your manual for details.
  248.  
  249.    If the file belongs to some sort of copy protection, you must uninstall
  250.    the program to which it belongs and reinstall it after repartitioning.
  251.  
  252.    I can't give you more aid in this - if you really can't figure out what
  253.    to do, contact me directly.
  254.  
  255. Attention! Do _not_ try to move DOS' hidden system files (ibmbio.com &
  256. ibmdos.com or something similar). You may end up with a hard disk that
  257. will not boot any more. Since these files are already in the first sectors
  258. of the partition, it is not necessary to move them. In DOS 5.0 and later,
  259. at least one of the system files _may_ be moved, but it is nevertheless a
  260. good idea to leave it alone.
  261.  
  262. When you have run FIPS, you must reboot, so make sure to disable any
  263. programs in the config.sys and autoexec.bat that write to the disk, in
  264. particular mirror or image. Consider temporarily renaming these files.
  265.  
  266. Be aware that the location of your DOS partitions in the partition table may
  267. change after using FIPS. If you use the new partition under DOS _and_ you
  268. have an extended partition and/or two drives, this means that the names of
  269. the partitions may change (e.g. D: may become E:). I have taken care that C:
  270. always remains C:, so that you will still be able to boot.
  271.  
  272. Also if you have a CD-ROM, it will in most cases change its drive letter.
  273. If you use the /L switch to explicitly specify the drive letter in the call
  274. to MSCDEX in the autoexec.bat file, you might have to change it accordingly.
  275. If you don't use the /L switch, MSCDEX will automatically choose the first
  276. free letter, so that you do not need to change anything.
  277.  
  278. Apropos drive letters: DOS uses the following order to assign them:
  279. 1. The first primary partition on each drive
  280. 2. The volumes inside the extended partitions on all drives
  281. 3. The remaining primary partitions on all drives
  282.  
  283. Example:
  284.  
  285. C: first primary partition on first HD
  286. D: first primary partition on second HD
  287. E: first volume in extended partition on first HD
  288. F: second volume in extended partition on first HD
  289. G: first volume in extended partition on second HD
  290. H: second primary partition on second HD
  291. I: CD ROM
  292.  
  293. I am not aware of an easy way to change this scheme. In particular you
  294. can not assign an arbitrary drive letter to a partition. You can however
  295. influence the ordering by changing a primary partition into an extended one.
  296.  
  297. For Linux users:
  298. The possible change of the location of the DOS paritition in the partition 
  299. table also means that the device number of the DOS partition under Linux may
  300. change (e.g. /dev/hda3 may become /dev/hda1). Any existing Linux partitions
  301. will not change, so that you will have no trouble booting. You just need to
  302. edit your /etc/fstab file if you mount your DOS partition on bootup.
  303.  
  304.  
  305. 6. Use with a multitasking OS
  306.  
  307. You should not use FIPS in multitasking environments like OS/2, Desqview,
  308. Windows, Novell Task Manager or the Linux DOS Emulator. These systems might
  309. still write to the disk after FIPS has changed the hard disk structure,
  310. which may result in corrupting the disk. This is not necessarily so, I'd
  311. suppose that in most cases it would work nevertheless. But since safety is my
  312. first concern with FIPS, I would recommend booting from a DOS boot disk and
  313. then running FIPS, that should be safe.
  314. In version 1.0 I added some code by Dave McCaldon to detect Windows and
  315. Desqview (thanks, Dave!). OS/2 and Novell Task Manager are not yet detected.
  316. I had to remove the code for detecting the Linux DOS emulator because it
  317. caused a hangup on many machines.
  318.  
  319.  
  320. 7. Using FIPS
  321.  
  322. If you have prepared a bootable floppy disk as described in section 5,
  323. boot from it now.
  324.  
  325. Important! Make sure not to have a disk cache program like Smartdrive
  326. running. It has been reported that in some cases the changes FIPS made
  327. were only written to the disk in part, which resulted in hard disk
  328. corruption later. I think this may be caused by the use of Smartdrive,
  329. which in the default configuration delays the disk writes for some seconds.
  330. If you reboot too fast, some of the changes may be lost.
  331.  
  332. You start FIPS by typing FIPS at the DOS prompt, followed by <ENTER>.
  333. You may exit from the program at any time by pressing <CTRL-C>.
  334.  
  335. FIPS will first try to detect under which OS it is running. If it is
  336. Windows or Desqview, it will complain and tell you to boot from a floppy
  337. disk. You can proceed nevertheless, but this is at your own risk (see
  338. section 8).
  339.  
  340. Then FIPS will detect your hard disks, if you have more than one, it will
  341. ask you which one you want to work on.
  342. In previous releases, FIPS failed to detect the correct number of hard disks
  343. with some BIOSes (esp. in Gateway Pentium machines). I hope to have corrected
  344. this. If FIPS fails to detect the correct number of disks, please let me
  345. know. In the meantime you may use the '-n' switch to select the drive
  346. by hand (see below).
  347.  
  348. FIPS then reads the root sector of the hard disk and displays the partition
  349. table.
  350.  
  351. Example:
  352.  
  353.      |        |     Start      |      |      End       | Start  |Number of|
  354. Part.|bootable|Head Cyl. Sector|System|Head Cyl. Sector| Sector |Sectors  |  MB
  355. -----+--------+----------------+------+----------------+--------+---------+----
  356. 1    |    yes |   0  148      1|   83h|  15  295     63|  149184|   149184|  72
  357. 2    |     no |   1    0      1|   06h|  15  139     63|      63|   141057|  68
  358. 3    |     no |   0  140      1|   06h|  15  147     63|  141120|     8064|   3
  359. 4    |     no |   0    0      0|   00h|   0    0      0|       0|        0|   0
  360.  
  361.  
  362. If you don't know what to make of this, don't worry too much. You may just use
  363. the number of Megabytes to identify your partitions.
  364.  
  365. The root sector is then checked for errors.
  366.  
  367. If you have more than one partition on the disk, you will be asked which one
  368. you want to split.
  369.  
  370. The boot sector of the chosen partition is read and some information is dis-
  371. played.
  372.  
  373. Example:
  374.  
  375. Bytes per sector: 512
  376. Sectors per cluster: 8
  377. Reserved sectors: 1
  378. Number of FATs: 2
  379. Number of rootdirectory entries: 512
  380. Number of sectors (short): 0
  381. Media descriptor byte: f8h
  382. Sectors per FAT: 145
  383. Sectors per track: 63
  384. Drive heads: 16
  385. Hidden sectors: 63
  386. Number of sectors (long): 141057
  387. Physical drive number: 80h
  388. Signature: 29h
  389.  
  390.  
  391. FIPS checks if this information is consistent with the partition table and
  392. tries to detect other errors.
  393.  
  394. It then verifies if the two copies of the FAT are identical, if they are not,
  395. FIPS will exit with an error message.
  396.  
  397. If everything checks out ok, FIPS now looks for free space at the end of
  398. the partition. The new partition must have at least one cylinder, so if
  399. the last cylinder is not free, you have no chance of splitting the
  400. partition: FIPS will exit with an error message. Probably you forgot
  401. to remove a mirror or image file (see above).
  402.  
  403. You must now enter on which cylinder the new partition should start.
  404. Use the cursor keys right/left to increase or decrease the cylinder
  405. count. The size of the remaining partition and the new partition are
  406. displayed in the process, so you will have no trouble choosing the
  407. right cylinder. With cursor up/down you can change the count in steps
  408. of 10. When ready, press enter to continue.
  409.  
  410. FIPS will check again if the space for the new partition is empty -
  411. this is an additional security measure and should never show an error,
  412. since the free space was already determined before.
  413.  
  414. After this, FIPS will calculate the changes to the root sector, check the
  415. changes and display the new partition table. You may now choose to reedit the
  416. partition table (this will return you to the point where you select the par-
  417. tition) or to continue. If you type 'c', FIPS will calculate the changed
  418. boot sector, check it again and prompt you if you want to proceed. If you type
  419. 'y' then, FIPS will write the changes to the disk and exit.
  420.  
  421.  
  422. 8. After splitting the partition
  423.  
  424. Make sure that the changes have been written to the disk. If you used
  425. a disk cache like Smartdrive (despite my explicit recommendation not
  426. to use it :-), wait for some seconds so that the cache is flushed to disk.
  427.  
  428. Your new partition will be recognized by DOS after you rebooted. DO NOT
  429. WRITE ANYTHING TO THE DISK BEFORE REBOOTING. After rebooting, use CHKDSK
  430. or Norton Disk Doctor to make sure your old (now smaller) partition is ok.
  431.  
  432. There have been cases where the changes made by FIPS were not correctly
  433. written. To make sure that this is not the case, run FIPS again with the
  434. -t (test mode) switch after rebooting. Select the drive and partition that
  435. you were splitting. If FIPS displays no error until the cylinder selection
  436. dialogue, there is no problem and you can stop the program with CTRL-C.
  437. Otherwise you should undo the changes with 'restorrb' and contact me by
  438. email.
  439.  
  440. If you don't find any errors, you may now reboot with your normal config.sys
  441. and autoexec.bat. Start some programs and make sure you can still read your
  442. data.
  443.  
  444. If you want to use your new partition under DOS, you must format it. If you
  445. have multiple partitions, make sure to format the right one, the drive names
  446. may have changed!
  447. If you want to use the partition under Linux, you may now change the system
  448. indicator byte with Linux' fdisk, then use MKFS.
  449.  
  450. If you want to split the new partition again in two smaller ones, you must
  451. first format it under DOS, otherwise FIPS will complain.
  452.  
  453.  
  454. 9. Commandline Switches
  455.  
  456. Here is the explanation of FIPS' commandline switches. If you prefer the DOS
  457. style, you may use '/' instead of '-' as the switch character. The switches
  458. may be arbitrarily combined. Type 'FIPS -help' to get a list of the switches.
  459. Here is a more detailed explanation:
  460.  
  461. -t or -test : test mode (no writes to disk)
  462.  
  463. This doesn't need much explanation.
  464.  
  465. -d or -debug : debug mode
  466.  
  467. In this mode, a complete transcript of your session along with some additio-
  468. nal information is written to the file FIPSINFO.DBG in the current directory.
  469. You can send this file to me in case of trouble (see below).
  470.  
  471. -h or -help or -? : help page
  472.  
  473. A short summary of the switches
  474.  
  475. -n<num>   : select drive <num>
  476.  
  477. Preselect the drive number with this switch. Valid numbers are 128 to 255.
  478. This may also be used to override the automatic drive detection - if for any
  479. reason the drive is not found by FIPS, you may try this switch.
  480.  
  481.  
  482. 10. Troubleshooting
  483.  
  484. FIPS is still somewhat experimental, although it has been used by many
  485. people successfully and without serious problems.
  486. When in doubt I usually decided to stay safe and display error messages
  487. when encountering suspicious configurations. Some of the minor errors may
  488. be overridden.
  489.  
  490. Please make sure you have read this doc carefully and also look in the file
  491. FIPS.FAQ that covers some frequently asked questions.
  492.  
  493. If you can't resolve a problem yourself, or have a configuration not sup-
  494. ported by FIPS, or if you suspect a bug in FIPS, make a transcript of your
  495. session using the -d switch and send the full FIPSINFO.DBG file along with a
  496. short comment to schaefer@rbg.informatik.th-darmstadt.de. Possibly your
  497. problem has already been solved.
  498.  
  499.  
  500. 11. Credits
  501.  
  502. FIPS is based on the procedure described by Drew Eckhardt in Linux digest132.
  503. Most of what I know about Harddisk structures comes from the excellent german
  504. book 'Scheibenkleister II' by Claus Brod and Anton Stepper. It is for the
  505. Atari ST, but much of it applies to PCs also.
  506. Information on the Harddisk Interrupts was drawn from Ralf Brown's Interrupt
  507. List. Thanks to Hamish Coleman for some useful info and to Paul Smith for
  508. his good suggestions. Gunnar Hilmarsson suggested the procedure for stacked
  509. drives, and Miguel Alvarez helped me improve the partition ordering. Chetan
  510. Patil, Rand Phares and Eric Jung pointed me at bugs in the program and
  511. documentation. Stefan Andreasen provided important informations about OS/2.
  512. Keith Crews suggested some additions to the documentation concerning the
  513. preparation of the boot disk and new features of DOS 6.x. Dave McCaldon
  514. wrote the code for detecting the OS FIPS is running under. Scott Ellentuch
  515. and Billy Patton provided info about OnTrack Disk Manager.
  516. A very valuable piece of info on EIDE drives and address translation is the
  517. Linux EIDE-Mini-HOWTO by Patrick LoPresti.
  518. Thanks to all others who sent me feedback and suggestions. FIPS would not be
  519. the same program without the innumerable emails I received.
  520.  
  521.  
  522. Arno Schaefer
  523. schaefer@rbg.informatik.th-darmstadt.de
  524.