1.\"	$OpenBSD: fdformat.1,v 1.14 2003/06/12 12:59:50 jmc Exp $
2.\"
3.\" Copyright (C) 1993, 1994 by Joerg Wunsch, Dresden
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\"
15.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS
16.\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18.\" DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT,
19.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
23.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
24.\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25.\" POSSIBILITY OF SUCH DAMAGE.
26.\"
27.Dd September 16, 1993
28.Dt FDFORMAT 1
29.Os
30.Sh NAME
31.Nm fdformat
32.Nd format floppy disks
33.Sh SYNOPSIS
34.Nm fdformat
35.Bk -words
36.Op Fl q
37.Op Fl n | v
38.Op Fl c Ar cyls
39.Op Fl s Ar secs
40.Op Fl h Ar heads
41.Op Fl r Ar rate
42.Op Fl g Ar gap3len
43.Op Fl i Ar intleave
44.Op Fl S Ar secshft
45.Op Fl F Ar fillbyte
46.Op Fl t Ar steps_per_track
47.Ar device_name
48.Ek
49.Sh DESCRIPTION
50.Nm fdformat
51formats a floppy disk at device
52.Ar device_name .
53.Ar device_name
54should be a character device; it may be given either with a full path
55name of a raw device node for a floppy disk drive
56.Pq e.g., Pa /dev/rfd0c ,
57or default name in an abbreviated form,
58.Pq e.g., Em fd0 .
59Note that any geometry constraints of the device node
60.Pq minor device number
61are meaningless, since they're overridden by
62.Nm fdformat .
63.Pp
64The options are as follows:
65.Pp
66.Bl -tag -width Ds -compact
67.It Fl q
68Suppress any normal output from the command, and don't ask the
69user for confirmation whether to format the floppy disk at
70.Ar device_name .
71.Pp
72.It Fl n
73Don't verify floppy after formatting.
74.Pp
75.It Fl v
76Don't format; verify only.
77.Pp
78.It Fl c Ar cyls
79.It Fl s Ar secs
80.It Fl h Ar heads
81.It Fl r Ar rate
82.It Fl g Ar gap3len
83.It Fl i Ar intleave
84.It Fl S Ar secshft
85.It Fl F Ar fillbyte
86.It Fl t Ar steps_per_track
87An alternate method to specify the geometry data to write to the floppy disk.
88.El
89.Pp
90If the
91.Fl q
92flag has not been specified, the user is asked for confirmation
93of the intended formatting process.
94In order to continue, an answer of
95.Dq y
96must be given.
97.Sh DIAGNOSTICS
98Unless
99.Fl q
100has been specified, a single letter is printed to standard output
101to inform the user about the progress of work.
102First, an
103.Dq F
104is printed when the track(s) is being formatted, then a
105.Dq V
106while it's being verified, and if an error has been detected, it
107will finally change to
108.Dq E .
109.Pp
110An exit status of 0 is returned upon successful operation.
111Exit status
1121 is returned on any errors during floppy formatting, and an exit status
113of 2 reflects invalid arguments given to the program (along with
114appropriate information written to diagnostic output).
115.Sh SEE ALSO
116.Xr fdc 4
117.Sh HISTORY
118.Nm fdformat
119was developed for 386BSD 0.1 and upgraded to the new
120.Xr fd 4
121floppy disk driver.
122It later became part of
123.Fx 1.1 ,
124and was then ported to
125.Ox 1.2 .
126.Sh AUTHORS
127The program was contributed by Joerg Wunsch, Dresden,
128with changes by Serge Vakulenko and Andrew A. Chernov, Moscow.
129