]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.sbin/fdformat/fdformat.8
THIS BRANCH IS OBSOLETE, PLEASE READ:
[FreeBSD/FreeBSD.git] / usr.sbin / fdformat / fdformat.8
1 .\" Copyright (C) 1993, 1994, 1995, 2001 by Joerg Wunsch, Dresden
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\"
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS
14 .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15 .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16 .\" DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT,
17 .\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
18 .\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19 .\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
21 .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22 .\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
23 .\" POSSIBILITY OF SUCH DAMAGE.
24 .\"
25 .\" $FreeBSD$
26 .\"
27 .Dd May 23, 2020
28 .Dt FDFORMAT 8
29 .Os
30 .Sh NAME
31 .Nm fdformat
32 .Nd format floppy disks
33 .Sh SYNOPSIS
34 .Nm
35 .Op Fl F Ar fill
36 .Op Fl f Ar fmt
37 .Op Fl s Ar fmtstr
38 .Op Fl nqvy
39 .Ar device
40 .Sh DESCRIPTION
41 The
42 .Nm
43 utility formats a floppy disk at
44 .Ar device ,
45 where
46 .Ar device
47 may either be given as a full path
48 name of a device node for a floppy disk drive
49 (e.g.,\&
50 .Pa /dev/fd0 ) ,
51 or using an abbreviated name that will be looked up
52 under
53 .Pa /dev
54 (e.g.,\&
55 .Dq Li fd0 ) .
56 .Pp
57 The options are as follows:
58 .Bl -tag -width ".Fl s Ar fmtstr"
59 .It Fl F Ar fill
60 Use
61 .Ar fill
62 as the fill byte for newly formatted sectors.
63 The
64 .Ar fill
65 argument
66 must be a number in the range 0 through 255 using common C
67 language notation.
68 The default value is
69 .Dq Li 0xf6 .
70 .It Fl f Ar fmt
71 Specify the density settings for a
72 .Ar fmt
73 kilobyte format, as described in
74 .Xr fdcontrol 8 .
75 .It Fl s Ar fmtstr
76 Specify the density settings using explicit parameters, as
77 described in
78 .Xr fdcontrol 8 .
79 .It Fl n
80 Do not verify floppy after formatting.
81 .It Fl q
82 Suppress any normal output from the command, and do not ask the
83 user for a confirmation whether to format the floppy disk at
84 .Ar device .
85 .It Fl v
86 Do not format, verify only.
87 .It Fl y
88 Do not ask for confirmation whether to format the floppy disk but
89 still report formatting status.
90 .El
91 .Pp
92 For non-autoselecting subdevices, neither
93 .Fl f Ar fmt
94 nor
95 .Fl s Ar fmtstr
96 may be specified, since the preconfigured media density settings
97 from the kernel driver will always be used.
98 However, if
99 .Ar device
100 is a device with automatic media density selection (see
101 .Xr fdc 4 ) ,
102 both methods can be used to override the density settings for the
103 newly formatted medium (without permanently changing the density
104 settings of
105 .Ar device ) .
106 .Pp
107 If the
108 .Fl q
109 flag has not been specified, the user is asked for a confirmation
110 of the intended formatting process.
111 In order to continue, an answer
112 of
113 .Ql y
114 must be given.
115 .Pp
116 Note that
117 .Nm
118 does only perform low-level formatting.
119 In order to create
120 a file system on the medium, see the commands
121 .Xr newfs 8
122 for a
123 .Tn UFS
124 file system, or
125 .Xr newfs_msdos 8
126 for an
127 .Tn MS-DOS
128 (FAT)
129 file system.
130 .Sh EXIT STATUS
131 An exit status of 0 is returned upon successful operation.
132 Exit status
133 1 is returned on any errors during floppy formatting, and an exit status
134 of 2 reflects invalid arguments given to the program (along with an
135 appropriate information written to diagnostic output).
136 .Sh EXAMPLES
137 To format a new double-sided, high-density (HD) 1.44 MB disk
138 inserted in the first floppy disk drive, issue:
139 .Pp
140 .Dl "/usr/sbin/fdformat -f 1440 /dev/fd0"
141 .Pp
142 After low-level formatting the disk with
143 .Nm ,
144 create a disk label so that the system can determine the size and
145 geometry of the disk.
146 The supported geometry values are listed in
147 .Pa /etc/disktab ,
148 and we will use
149 .Va fd1440
150 for this example.
151 To write the disk label, use
152 .Xr bsdlabel 8 :
153 .Pp
154 .Dl "/sbin/bsdlabel -B -w /dev/fd0 fd1440"
155 .Pp
156 The floppy is now ready to be high-level formatted with a file system.
157 To format the floppy disk with FAT, issue:
158 .Pp
159 .Dl "/sbin/newfs_msdos /dev/fd0"
160 .Sh DIAGNOSTICS
161 Unless
162 .Fl q
163 has been specified, a single letter is printed to standard output
164 to inform the user about the progress of work.
165 First, an
166 .Ql F
167 is printed when the track is being formatted, then a
168 .Ql V
169 while it is being verified, and if an error has been detected, it
170 will finally change to
171 .Ql E .
172 Detailed status information (cylinder, head and sector number, and the
173 exact cause of the error) will be printed for up to 10 errors after the
174 entire formatting process has completed.
175 .Sh SEE ALSO
176 .Xr fdc 4 ,
177 .Xr bsdlabel 8 ,
178 .Xr fdcontrol 8 ,
179 .Xr newfs 8 ,
180 .Xr newfs_msdos 8
181 .Sh HISTORY
182 The
183 .Nm
184 utility
185 has been developed for
186 .Bx 386 0.1
187 and upgraded to the new
188 .Xr fdc 4
189 floppy disk driver.
190 It later became part of the
191 .Fx 1.1
192 system.
193 Starting with
194 .Fx 5.0 ,
195 it uses the unified density specifications as described in
196 .Xr fdcontrol 8 .
197 .Sh AUTHORS
198 .An -nosplit
199 The program has been contributed by
200 .An J\(:org Wunsch ,
201 Dresden, with changes by
202 .An Serge Vakulenko
203 and
204 .An Andrey A. Chernov ,
205 Moscow.