[Previous] [Contents] [Next]

lockfd

Lock a floppy drive to one capacity/media type (QNX)

Syntax:

lockfd [-l mediatype | -u]  [drivename]

Options:

-l mediatype
("el") Lock the drive at the specified mediatype, where mediatype is one of 360 or 1.2 for 5 1/4 inch disk drives, or 720, 1.4 or 2.8 for 3 1/2 inch drives.
-u
Unlock the drive.
drivename
The pathname of a floppy block special file to lock (default is /dev/fd0).

Description:

In normal operation, the Fsys.floppy driver will automatically detect the media size of the disk occupying the drive by reading the first block of the disk, where QNX writes that information. If a disk contains just raw data (for instance, if it was a tar archive), the first block will contain the first 512 bytes of data instead and will not contain the drive information. Having an invalid or incorrect value will cause the driver to behave erratically. The lockfd utility can be used to tell the Fsys.floppy driver to lock the drive to a specific media size, and to ignore (and not attempt to read) this data from the first block of the disk. This ensures correct operation regardless of the data stored on the disk, at the expense of having to run lockfd each time the media size needs to be changed.

Files:

If an error occurs, the lockfd utility will write a diagnostic message to the standard error. The standard input and standard output are unused.

The utility acts on a single block special file; either the one specified on the command line as the drivename parameter, or /dev/fd0 (the default). An ioctl() is sent to the device; currently the only driver which supports this ioctl() is the Fsys.floppy driver.

Exit status:

>0
An error occurred.
0
The drive was successfully locked to the specified media size.

See also:

Fsys, Fsys.floppy, pax, tar, vol


[Previous] [Contents] [Next]