FileMount V1.10 Copyright (C) 1993 by Dan Babcock Freely redistributable for non-commercial purposes Introduction FileMount is a simple utility designed to create what I call "pseudo-partitions". A pseudo-partition has all the characteristics of a real partition, but resides within a file. Now, this begs the question, "what is a partition"? On the Amiga a partition is simply a set of contiguous sectors on a disk. A file on the other hand is not required to comprise only contiguous sectors; each data block may reside anywhere on the disk. To bridge this gap various people have written device drivers that operate on files, for example FMS by Matt Dillon or FDEV by Timo Rossi. They do a good job, but have some disadvantages. For one, they are slow compared to a real partition. What's worse, though, is that you can't use them with AMAX, or other operating systems, because AmigaDOS won't be around to access the file. FileMount takes a different approach, creating a file composed of only contiguous blocks, which can then be used like a true partition. Compared to a "real" partition, you have a couple big advantages: you don't need to backup/partition/restore (although some steps may need to be taken if your hard drive is highly fragmented) and you can recover the space simply by deleting the file. Limitations FileMount requires Kickstart 2.04 or higher. FileMount is designed for use on Fast File System (FFS) partitions *ONLY*. Trying to use it on a partition using some other file system WILL corrupt your data. So don't try it. Changes V1.10 fixes a major flaw of 1.00: various important MountList parameters such as MaxTransfer are now inherited from the host partition, rather than being hard-coded into FileMount. This isn't important for AMAX, but is very important for FFS or CrossDOS usage. Usage FileMount is usable from the CLI only. Type "filemount ?" to see the command line options. It has two modes of operation, CREATE and MOUNT. CREATE: The CREATE option takes a filename for the pseudo-partition file that you wish to create. The name of the file (apart from the directory path) will be the device name when you use the MOUNT option (described below). Along with the filename, there is a mandatory SIZE parameter which specifies the size of the pseudo-partition in kilobytes. Examples: To create an AMAX partition of 15MB: filemount create devs:amax size 15000 To create a CrossDOS partition of 5MB: filemount create devs:pcc size 5000 Assuming everything proceeded successfully, you should see some information printed including the starting and ending block numbers of the pseudo-partition. If you wanted, you could use this information to construct a MountList entry or a mount file. Normally, however, you will want to use the automatic mounting facility of FileMount, in which case you don't have to worry about anything. If your hard drive is highly fragmented, you may lack sufficient contiguous space for the pseudo-partition. You might choose to run a disk defragmentation utility (heeding the warnings given elsewhere if you already have pseudo-partitions installed) or go through a backup/restore cycle. The file created with CREATE will be delete-protected for your safety. If you really want to delete it either use Workbench or the CLI's PROTECT command to enable deletion. After deleting the file, REBOOT YOUR SYSTEM IMMEDIATELY (the reason is, if you accidentally use the pseudo-partition that you just deleted, your main partition will be corrupted). WARNING! The CREATE option operates at the device level and *IF* there is a bug in this code it would have the potential to corrupt your hard drive. On the other hand, if your hard drive does not validate successfully after using CREATE, it isn't necessarily the fault of this program - your hard drive may have been corrupt already without you knowing it. In fact, this happened to me during the development of FileMount: my hard drive was "corrupted" after running FileMount, and since the code was basically untested, I assumed a bug in FileMount. I later found out that FileMount had in fact worked perfectly but that my hard drive was corrupted beforehand due to an incorrect MountList for my AMAX partition. MOUNT: The mount option activates the pseudo-partition and makes it known to AmigaDOS. You should place the appropriate "filemount mount" commands in your startup-sequence or user-startup files to automatically mount the partitions each time you boot. The MOUNT option takes as its argument the path/name of the file that you created earlier with the CREATE option. The name of the mounted device will be the same as the filename (excluding the path, of course). You only have two options for mounting the file: either for Fast File System (FFS), which will also work for AMAX, or for CrossDOS (either the version supplied with 2.1/3.0 of the OS or V5 of the full commercial version). FFS is the default. If you want the partition mounted for use with CrossDOS/CrossPC, specify the CROSSDOS option. Examples: To mount the file "devs:AMAX" for FFS or AMAX: filemount mount devs:amax To mount the file "devs:PCC" for use with CrossDOS/CrossPC: filemount mount devs:pcc crossdos IMPORTANT INFO: The CROSSDOS option always mounts the pseudo-partition with a DOSTYPE of "MSH". That tells CrossDOS that the pseudo-partition is an MS-DOS hard drive ("MSD" would indicate a floppy). Clearly then, you can't simulate an MS-DOS floppy (no big deal). Rather, it is intended for the use of CrossPC or PC-Task. You can not format the CrossDOS partition with the AmigaDOS Format command!!! (The AmigaDOS format will only format "MSD" devices because it can't do the job of FDISK). You must run the MS-DOS program FDISK under CrossPC/PC-Task to create a partition on your simulated MS-DOS hard drive, and then use the MS-DOS Format command (don't forget the /S option to install system files!) to format the MS-DOS hard drive partition. Then and only then will you be able to read from and write to the partition with CrossDOS. The MOUNT option automatically checks the file for integrity and will refuse to mount if the pseudo-partition has been corrupted (that is, if the file no longer comprises only contiguous blocks). This protects your main Amiga partition. !!!WARNINGS!!! !!!PLEASE READ!!! FileMount is a somewhat "dangerous" utility is the sense that it requires some responsibility from the user. Failing to adhere to these precautions can be hazardous to your data. First and foremost, any time you copy the pseudo-partition file somewhere (during a hard drive backup, for example), you should assume all the data in the partition (that is, in the backup of the partition) to be LOST. So, don't bother to include pseudo-partitions in your Amiga data backups - it won't do any good. (OK, this is not entirely true. There are ways of putting the data back, but it isn't easy). Using a disk defragmentation utility will probably corrupt the pseudo-partitions. I say "probably" because it is entirely possible that a given defragmentor utility may place all blocks in all files contiguously - in which case the pseudo-partitions are safe. Unless you wrote the defragmentor yourself, you don't know, so you must assume that the pseudo-partitions will be corrupted. It is safe to rename the pseudo-partition file. The Author I can be reached at Dan_E_Babcock@cup.portal.com. Other fine freeware software products by me available by Fish/FTP: QMouse: A small multi-functional "mouse utility" with a unique set of features Hackdisk: A trackdisk.device replacement offering a verify option