[Previous] [Contents] [Next]

Fatfsys

DOS FAT12/16/32 filesystem manager (QNX)

Syntax:

Fatfsys [options]... [dos_drive=host_device]... &

Options:

-d
Name of the directory to hold the DOS drives. (Default: /dos)
-D
Enable the FAT32 volume to be marked "dirty" at mount, "clean" at unmount. This forces Windows to do a ScanDisk the next time it boots. (Default: disabled)
-f
Set the maximum number of concurrent open files. This option also sizes the internal caches based on this value. (Default: 128)
-F
Disable usage/update of the FAT32 FSInfo record, which contains the free cluster count and a hint of the next free cluster. By default Fatfsys loads and uses this information at mount, and writes back any changes at unmount. This option disables that usage.
-H
Specify how to display DOS hidden files:
ignore
Never display hidden files.
show
Always display hidden files.
dot
Display hidden files with a leading "." (useful with ls -a).

The default is show.

-i
Set the user/group IDs to apply as the owner of all DOS files. These may be specified as numeric values (in the form of num:num) or as a user ID from /etc/passwd or group ID from etc/group. (Default: 0:0)
-L
Specify how to treat long filenames:
ignore
Never show or create long filenames; use only the corresponding short name (e.g. PROGRA~1).
show
Display and create long filenames where appropriate (i.e. if the filename is longer than 8.3 or is mixed-case).
always
Always create long filenames to preserve case.

The default is show.

-m
Set mount options to apply to all subsequent DOS filesystem mountpoints. Valid options are:
ro
Mark file as read-only.
rw
Mark file as read-write.
noatime
Don't record the time the file was last accessed.
atime
Record the access time.
noexec
Don't allow executable files to load.
exec
Allow executable files to load.
nocreat
Don't allow files to be created.
creat
Allow files to be created.
async
Enable asynchronous writes.
sync
Enable synchronous writes.

The defaults are rw, noatime, exec, creat, async.

-P
Set POSIX-like emulation/checking level. Valid options are:
ignore
Don't do any emulation or checks.
emulate
Attempt to provide features not present in the DOS filesystem (e.g. link counts on directories, . and .. entries at the root).
strict
Use the emulate features, but also check for any attribute changes that DOS can't handle (e.g. a chown() to a user other than that specified in -i, or a utime() to a time before 1980, the DOS epoch). If you don't specify strict, such attribute changes are silently ignored.

The default is ignore.

-s
Toggle the automatic device scanning sequence (based on user-specified mounts).

If any user mounts are specified on the command line, then Fatfsys won't scan the /dev directory. Use -s to toggle scanning on.

If no user mounts are specified on the command line, then Fatfsys will scan the /dev directory. Use -s to toggle scanning off.

-S
Specify how to treat short (8.3) filenames (assuming -L ignore is specified):
lower
Use all lowercase.
upper
Use all uppercase.
windows
Try to behave like Windows -- use a leading uppercase letter and the rest lowercase, unless overridden by the case attribute in the directory entry.

The default is lower.

-t
Set the timeout for removable media. After the timeout, the media is assumed to be possibly stale and is auto-remounted. (Default: 2 seconds)
-T
Disable silent 8.3 name truncation. This option is valid only if long filenames are being ignored (via -L ignore). By default, DOS truncates filenames to fit into the 8.3 format, so the files FILENAME.C and FILENAMETWO.C are considered identical. The -T option will raise an ENAMETOOLONG error rather than truncate.
-u
Set a umask to apply to all DOS files. A umask specifies a set of permission bits that should be cleared for a file. You can specify the umask using a numeric form or a symbolic string (of the form u=rwx,g=rwx,o=rwx) as an inverse umask. (Default: 0)
-v
Increase level of verbosity for information/error messages.
-V
Specify how to treat the DOS volume label:
ignore
Never display the volume label.
show
Show the label unchanged.
equals
Display the label with a leading = in the name.

When not being ignored, the volume label (if present) will be a name-special file with no access permissions.

The default is equals.

-w
Specify how long to wait for devices to be set up. This is useful in sysinit or boot files. (Default: 10 seconds)
-X
Control the setting of the executable bit:
none
No files will be executable.
all
All files will be executable.
system
Use the DOS "system" attribute to indicate an executable file.
auto
Let the DOS filename extension (e.g. *.EXE, *.COM, *.BAT) dictate if a file should be executable.

The default is auto.

dos_drive
A DOS drive name (typically a letter from a to z).
host_device
The name of the QNX device or file to open (e.g. /dev/hd1t6).

Description:

Fatfsys provides transparent access to DOS disks, so you can treat DOS filesystems as though they were QNX filesystems.

If started with no arguments, Fatfsys will scan the /dev directory for DOS devices to adopt. Hard drive partitions of types 1, 4, 6, 11, 12, and 14 will be assumed to contain a DOS filesystem. And any removable device (floppy, LS-120, etc.) will be assumed to be capable of having media containing a DOS filesystem inserted into it.

You may also specify explicit mount devices on the command line, using the form dos_drive=host_device (e.g. c=/dev/hd1t6). Specifying any device in this way will suppress the default device scan, but you can re-enable scanning by using the -s option.

Using mount and mount_dos

You can also mount DOS filesystems at runtime using the mount utility:

mount -t dos /dev/fd0 /dos/a

or the mount_dos utility:

mount_dos /dev/fd0 /dos/a

Note: Typically, mount_dos is invoked via the mount utility. But if this isn't possible (e.g. if the device is being mounted from within the boot image), then you may run the mount_dos utility directly.

Using umount

You can unmount a DOS filesystem at runtime using the standard umount utility (e.g. umount /dos/c). Note that when Fatfsys is terminated (with a SIGTERM or simple slay Fatfsys), all current DOS filesystems are implicitly unmounted (this will affect FAT32 volumes; see the -D and -F options).

Removable media

Fatfsys maintains an activity timeout on removable media. After 2 seconds (see -t) of inactivity, the next attempted access to that filesystem will force a relearn of the DOS filesystem.

Fatfsys relies on the volume-tracking details of a disk to detect changes, then uses a heuristic (any open valid FDs) to determine if the media represents the same or a different filesystem.

Caching

Fatfsys maintains no local physical data block cache. All reads and writes to the host device are passed immediately to Fsys, which has a data cache.

To force Fsys to flush its cache, you may use the fsync() routine or O_SYNC flag on a per-FD basis, or use the -m sync option to affect all files written to the host device.

Fatfsys does contain a number of logical data caches (names, attributes, and cluster mappings), which are invalidated for removable media as described above. The size of these caches is based on the -f value.

Examples:

Start Fatfsys, mounting the floppy drive as /dos/a:

Fatfsys a=/dev/fd0 &

Start Fatfsys, mounting the floppy drive as read-only and the hard disk as read-write:

Fatfsys -m ro a=/dev/fd0 -m rw c=/dev/hd1t6 &

See also:

Blkfsys, fdisk, Fsys, Fsys.*, mount, mount_dos, textto, tr, umask, umount

QNX Installation & Configuration


[Previous] [Contents] [Next]