mediainit.1 (2010 09)
m
mediainit(1) mediainit(1)
When a given device supports format options, the allowable range of interleave factors may be related to
the specified format option. In such instances,
mediainit cannot check the interleave factor if one is
specified.
Notes
Most types of mass storage media must be initialized before they can be used. HP hard disks, flexible
disks, and cartridge tapes require some form of initialization, but 9-track tapes do not. Initialization usu-
ally involves formatting the media, writing and reading test patterns, then sparing any defective blocks.
Depending upon the media and device type, none, some, or all of the initialization process may have been
performed at the factory.
mediainit completes whatever steps are appropriate to prepare the media
for error-free operation.
Most HP hard disks are formatted and exhaustively tested at the factory by use of a process more
thorough but also more time-consuming than appropriate for
mediainit. However,
mediainit is
still valuable for ensuring the integrity of the media after factory shipment, formatting with the correct
interleave factor, and sparing any blocks which may have become defective since original factory testing
was performed.
HP flexible disks are not usually formatted prior to shipment, so they must undergo the entire initializa-
tion process before they can be used.
When a tape is certified, it is thoroughly tested and defective blocks are spared.
mediainit usually
certifies a tape only if it has not been certified previously. If the tape has been previously certified and
spared,
mediainit usually reorganizes the tape’s spare block table, retaining any previous spares, and
optimizing their assignment for maximum performance under sequential access. Reorganizing the spare
block table takes only a few seconds, whereas complete certification takes about a half-hour for 150-foot
tapes, and over an hour for 600-foot tapes.
Reorganization of a tape’s spare block table technically renders any existing data undefined, but the data
is not usually destroyed by overwriting. To ensure that old tape data is destroyed, which is useful for
security, complete tape re-certification can be forced with the
-r option.
Some applications may require that a file system be placed on the media before use.
mediainit
does
not create a file system; it only prepares media for writing and reading. If such a file system is required,
other utilities such as
newfs, lifinit,or mkfs must be invoked after running mediainit (see
newfs(1M), lifinit (1), and mkfs(1M)).
RETURN VALUE
mediainit returns one of the following values:
0 Successful completion.
1 A device-related error occurred.
2 A syntax-related error was encountered.
ERRORS
Appropriate error messages are printed on standard error during execution of mediainit.
EXAMPLES
Scrub the specified device special file using the default of three times (the default).
mediainit -S /dev/rdisk/disk7
Scrub the specified device special file twice with a scrub character of 0.
mediainit -S -c 0 -t 2 /dev/rdisk/disk7
Scrub the specified device special file twice with a scrub character of 0 and verify.
mediainit -S -V -c 0 -t 2 /dev/rdisk/disk7
WARNINGS
For a device that contains multiple units on a single controller, each unit can be initialized independently
from any other unit. It should be noted, however, that mediainit requires that there be no other
processes accessing the device before initialization begins, regardless of which unit is being initialized. If
there are accesses currently in progress, mediainit aborts.
Aborting
mediainit is likely to leave the medium in a corrupt state, even if it was previously initial-
ized. To recover, the initialization must be restarted.
HP-UX 11i Version 3: September 2010 − 3 − Hewlett-Packard Company 3