|
|
HP-UX Reference > Ffloppy(7)HP-UX 11i Version 2: December 2007 Update |
|
NAMEfloppy — direct flexible (floppy) disk access DESCRIPTIONFlexible disk devices are removable-media disk devices that are typically used to share data with other systems. Media types are identified by physical size (such as 3.5-inch and 5.25-inch), number of data surfaces (or sides), and data density. By convention, flexible disk devices are named using the same conventions as those used for other disk devices (see disk(7)). Data can be stored on flexible disk media in a variety of logical formats. The capacity of these devices is generally too small to hold useful HP-UX file systems. Instead, DOS or LIF file systems (see dosif(4) and lif(4) for a detailed description of these file systems) are commonly used. Data can also be stored in an archive-utility format. For example, tar and cpio are commonly used to share data with other HP-UX systems (see tar(1) and cpio(1)). Logical volumes are not supported on flexible disks. The floppy disk does not support partitions. Section zero (0) is the only accessible partition. In addition to the various logical formats, data can be stored on flexible disk media in a variety of physical data formats called geometries. The following parameters are used to describe a flexible disk geometry:
The following table shows some useful flexible disk media geometries (without density information). The right-most column indicates which mediainit -f option should be used to format media to the indicated geometry (see mediainit(1)).
* For the LS-120 floppy, mediainit does not need the -f option. (The option is ignored.) mediainit formats the disk as a 120-MByte floppy. The following table shows the density information for some standard flexible disk media.
Abbreviations are interpreted as follows:
Normally each open() call causes the device and/or floppy device driver to attempt to determine the geometry of the installed media. As a result, the current flexible disk geometry is set to the supported geometry that matches the physical data format on the media currently installed in the device. To maintain reasonable open times, not all possible media geometries are checked. Therefore, it is possible that a flexible disk medium may contain valid data even though its format is not recognized. This automatic geometry sensing functionality may be disabled in some drivers by use of the O_NDELAY flag in the open() call or device driver dependent minor numbers. The Servers do not support this flag. The FLOPPY_GET_INFO ioctl indicates the characteristics and current status of a floppy device. Information for interpreting the media and data_encoding fields can be found in <sys/floppy.h>. The following macros are defined for decoding the status and valid fields. These macros return a non-zero (true) value for the associated conditions.
The argument x in the above macros refers to the status or valid fields of the FLOPPY_GET_INFO ioctl. Some floppy devices or floppy device drivers may be unable to determine some status information. The valid field indicates whether or not the corresponding status information is meaningful. Applying a macro to the valid field indicates whether or not the application of that same macro to the status field results in a valid device status. The FLOPPY_GET_GEOMETRY ioctl can be used to determine the flexible disk device's current media geometry. Current geometry parameters are indicated in the fields of the resultant floppy_geometry structure. The FLOPPY_SET_GEOMETRY ioctl can be used to specify the desired media geometry. Exclusive access to the device, obtained through use of the DIOC_EXCLUSIVE ioctl (see disk(7)), is required prior to setting the media geometry. Exclusive access is necessary to ensure that other applications are not affected. The Servers do not support this ioctl. The FLOPPY_FORMAT_TRACK ioctl can be used to reformat a media track. Exclusive access to the device, obtained through use of the DIOC_EXCLUSIVE ioctl (see disk(7)), is required prior to reformatting to ensure that other applications are not affected. The Servers do not support this ioctl. Flexible disk devices support the generic disk ioctls (see disk(7)), typically used for hard disk devices. Flexible disk device drivers may also support driver specific ioctls (see the appropriate driver manual section). The header file <sys/floppy.h> has useful information for flexible-media device control. The following is included from <sys/floppy.h>: /* ioctls for flexible (floppy) disk devices */ #define FLOPPY_GET_INFO _IOR('F', 1, struct floppy_info) #define FLOPPY_GET_GEOMETRY _IOR('F', 2, struct floppy_geom) #define FLOPPY_SET_GEOMETRY _IOW('F', 3, struct floppy_geom) #define FLOPPY_FORMAT_TRACK _IOW('F', 4, struct floppy_format) /* structure for FLOPPY_GET_INFO ioctl */ struct floppy_info { unsigned media; unsigned status; unsigned valid; }; /* structure for FLOPPY_GET_GEOMETRY and FLOPPY_SET_GEOMETRY ioctls */ struct floppy_geometry { unsigned heads; unsigned tracks; unsigned sectors; unsigned sector_size; unsigned transfer_rate; unsigned track_density; unsigned data_encoding; }; /* structure for FLOPPY_FORMAT_TRACK ioctl */ struct floppy_format { unsigned head; unsigned track; unsigned interleave; }; ERRORSThe following errors can be returned by a flexible-disk device-driver call:
WARNINGSMedia removal and/or replacement while the device is open is not supported. A floppy disk containing a mounted file system should not be removed prior to being unmounted. Removal of floppy disks containing mounted file systems is likely to result in file system errors, and system panics. Reformatting flexible disk media from one geometry to another that differs only in that it has fewer tracks can cause the automatic geometry sensing functionality of open() to fail to recognize the new media geometry. Bulk erasing (degaussing) the media or formatting the media to a substantially different geometry prior to reformatting prevents automatic geometry sensing problems. Single track formatting may not be supported by some floppy devices. Some devices permit configuration for geometries which they are unable to support. The FLOPPY_SET_GEOMETRY ioctl for such a configuration may not result in an error. However, subsequent I/O operations will fail. DEPENDENCIESWorkstationsWorkstation device special files reside in the directories /dev/rfloppy and /dev/floppy. ServersA flexible disk can be opened with no media. However, capacity changes resulting from subsequent media changes will not be recognized. (See scsi_disk(7)). Server device special files reside in the directories /dev/rdsk and /dev/dsk. The following table of Server Flexible Disk Media shows the disk geometries supported. The media inserted in the drive is formatted depending on the presence or absence of the HD hole in the flexible disk cartridge. HD media is formatted as a 1.44M diskette and DD media is formatted as a 720K diskette.
The following table shows the density information for the flexible disk media supported:
The FLOPPY_GET_INFO and FLOPPY_GET_GEOMETRY ioctls are supported on Servers. |
|