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 December 4, 2017 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 41The 42.Nm 43utility formats a floppy disk at 44.Ar device , 45where 46.Ar device 47may either be given as a full path 48name of a device node for a floppy disk drive 49(e.g.\& 50.Pa /dev/fd0 ) , 51or using an abbreviated name that will be looked up 52under 53.Pa /dev 54(e.g.\& 55.Dq Li fd0 ) . 56.Pp 57The options are as follows: 58.Bl -tag -width ".Fl s Ar fmtstr" 59.It Fl F Ar fill 60Use 61.Ar fill 62as the fill byte for newly formatted sectors. 63The 64.Ar fill 65argument 66must be a number in the range 0 through 255 using common C 67language notation. 68The default value is 69.Dq Li 0xf6 . 70.It Fl f Ar fmt 71Specify the density settings for a 72.Ar fmt 73kilobyte format, as described in 74.Xr fdcontrol 8 . 75.It Fl s Ar fmtstr 76Specify the density settings using explicit parameters, as 77described in 78.Xr fdcontrol 8 . 79.It Fl n 80Do not verify floppy after formatting. 81.It Fl q 82Suppress any normal output from the command, and do not ask the 83user for a confirmation whether to format the floppy disk at 84.Ar device . 85.It Fl v 86Do not format, verify only. 87.It Fl y 88Do not ask for confirmation whether to format the floppy disk but 89still report formatting status. 90.El 91.Pp 92For non-autoselecting subdevices, neither 93.Fl f Ar fmt 94nor 95.Fl s Ar fmtstr 96may be specified, since the preconfigured media density settings 97from the kernel driver will always be used. 98However, if 99.Ar device 100is a device with automatic media density selection (see 101.Xr fdc 4 ) , 102both methods can be used to override the density settings for the 103newly formatted medium (without permanently changing the density 104settings of 105.Ar device ) . 106.Pp 107If the 108.Fl q 109flag has not been specified, the user is asked for a confirmation 110of the intended formatting process. 111In order to continue, an answer 112of 113.Ql y 114must be given. 115.Pp 116Note that 117.Nm 118does only perform low-level formatting. 119In order to create 120a file system on the medium, see the commands 121.Xr newfs 8 122for a 123.Tn UFS 124file system, or 125.Xr newfs_msdos 8 126for an 127.Tn MS-DOS 128(FAT) 129file system. 130.Sh EXIT STATUS 131An exit status of 0 is returned upon successful operation. 132Exit status 1331 is returned on any errors during floppy formatting, and an exit status 134of 2 reflects invalid arguments given to the program (along with an 135appropriate information written to diagnostic output). 136.Sh DIAGNOSTICS 137Unless 138.Fl q 139has been specified, a single letter is printed to standard output 140to inform the user about the progress of work. 141First, an 142.Ql F 143is printed when the track is being formatted, then a 144.Ql V 145while it is being verified, and if an error has been detected, it 146will finally change to 147.Ql E . 148Detailed status information (cylinder, head and sector number, and the 149exact cause of the error) will be printed for up to 10 errors after the 150entire formatting process has completed. 151.Sh SEE ALSO 152.Xr fdc 4 , 153.Xr fdcontrol 8 , 154.Xr newfs 8 , 155.Xr newfs_msdos 8 156.Sh HISTORY 157The 158.Nm 159utility 160has been developed for 161.Bx 386 0.1 162and upgraded to the new 163.Xr fdc 4 164floppy disk driver. 165It later became part of the 166.Fx 1.1 167system. 168Starting with 169.Fx 5.0 , 170it uses the unified density specifications as described in 171.Xr fdcontrol 8 . 172.Sh AUTHORS 173.An -nosplit 174The program has been contributed by 175.An J\(:org Wunsch , 176Dresden, with changes by 177.An Serge Vakulenko 178and 179.An Andrey A. Chernov , 180Moscow. 181