14451f142SCy Schubert.\" Copyright (C) 1993, 1994, 1995, 2001 by Joerg Wunsch, Dresden 24451f142SCy Schubert.\" All rights reserved. 34451f142SCy Schubert.\" 44451f142SCy Schubert.\" Redistribution and use in source and binary forms, with or without 54451f142SCy Schubert.\" modification, are permitted provided that the following conditions 64451f142SCy Schubert.\" are met: 74451f142SCy Schubert.\" 1. Redistributions of source code must retain the above copyright 84451f142SCy Schubert.\" notice, this list of conditions and the following disclaimer. 94451f142SCy Schubert.\" 2. Redistributions in binary form must reproduce the above copyright 104451f142SCy Schubert.\" notice, this list of conditions and the following disclaimer in the 114451f142SCy Schubert.\" documentation and/or other materials provided with the distribution. 124451f142SCy Schubert.\" 134451f142SCy Schubert.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS 144451f142SCy Schubert.\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 154451f142SCy Schubert.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 164451f142SCy Schubert.\" DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, 174451f142SCy Schubert.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 184451f142SCy Schubert.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 194451f142SCy Schubert.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 204451f142SCy Schubert.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 214451f142SCy Schubert.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 224451f142SCy Schubert.\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 234451f142SCy Schubert.\" POSSIBILITY OF SUCH DAMAGE. 244451f142SCy Schubert.\" 25*e0524746SMurray Stokely.Dd May 23, 2020 264451f142SCy Schubert.Dt FDFORMAT 8 274451f142SCy Schubert.Os 284451f142SCy Schubert.Sh NAME 294451f142SCy Schubert.Nm fdformat 304451f142SCy Schubert.Nd format floppy disks 314451f142SCy Schubert.Sh SYNOPSIS 324451f142SCy Schubert.Nm 334451f142SCy Schubert.Op Fl F Ar fill 344451f142SCy Schubert.Op Fl f Ar fmt 354451f142SCy Schubert.Op Fl s Ar fmtstr 364451f142SCy Schubert.Op Fl nqvy 374451f142SCy Schubert.Ar device 384451f142SCy Schubert.Sh DESCRIPTION 394451f142SCy SchubertThe 404451f142SCy Schubert.Nm 414451f142SCy Schubertutility formats a floppy disk at 424451f142SCy Schubert.Ar device , 434451f142SCy Schubertwhere 444451f142SCy Schubert.Ar device 454451f142SCy Schubertmay either be given as a full path 464451f142SCy Schubertname of a device node for a floppy disk drive 47*e0524746SMurray Stokely(e.g.,\& 484451f142SCy Schubert.Pa /dev/fd0 ) , 494451f142SCy Schubertor using an abbreviated name that will be looked up 504451f142SCy Schubertunder 514451f142SCy Schubert.Pa /dev 52*e0524746SMurray Stokely(e.g.,\& 534451f142SCy Schubert.Dq Li fd0 ) . 544451f142SCy Schubert.Pp 554451f142SCy SchubertThe options are as follows: 564451f142SCy Schubert.Bl -tag -width ".Fl s Ar fmtstr" 574451f142SCy Schubert.It Fl F Ar fill 584451f142SCy SchubertUse 594451f142SCy Schubert.Ar fill 604451f142SCy Schubertas the fill byte for newly formatted sectors. 614451f142SCy SchubertThe 624451f142SCy Schubert.Ar fill 634451f142SCy Schubertargument 644451f142SCy Schubertmust be a number in the range 0 through 255 using common C 654451f142SCy Schubertlanguage notation. 664451f142SCy SchubertThe default value is 674451f142SCy Schubert.Dq Li 0xf6 . 684451f142SCy Schubert.It Fl f Ar fmt 694451f142SCy SchubertSpecify the density settings for a 704451f142SCy Schubert.Ar fmt 714451f142SCy Schubertkilobyte format, as described in 724451f142SCy Schubert.Xr fdcontrol 8 . 734451f142SCy Schubert.It Fl s Ar fmtstr 744451f142SCy SchubertSpecify the density settings using explicit parameters, as 754451f142SCy Schubertdescribed in 764451f142SCy Schubert.Xr fdcontrol 8 . 774451f142SCy Schubert.It Fl n 784451f142SCy SchubertDo not verify floppy after formatting. 794451f142SCy Schubert.It Fl q 804451f142SCy SchubertSuppress any normal output from the command, and do not ask the 814451f142SCy Schubertuser for a confirmation whether to format the floppy disk at 824451f142SCy Schubert.Ar device . 834451f142SCy Schubert.It Fl v 844451f142SCy SchubertDo not format, verify only. 854451f142SCy Schubert.It Fl y 864451f142SCy SchubertDo not ask for confirmation whether to format the floppy disk but 874451f142SCy Schubertstill report formatting status. 884451f142SCy Schubert.El 894451f142SCy Schubert.Pp 904451f142SCy SchubertFor non-autoselecting subdevices, neither 914451f142SCy Schubert.Fl f Ar fmt 924451f142SCy Schubertnor 934451f142SCy Schubert.Fl s Ar fmtstr 944451f142SCy Schubertmay be specified, since the preconfigured media density settings 954451f142SCy Schubertfrom the kernel driver will always be used. 964451f142SCy SchubertHowever, if 974451f142SCy Schubert.Ar device 984451f142SCy Schubertis a device with automatic media density selection (see 994451f142SCy Schubert.Xr fdc 4 ) , 1004451f142SCy Schubertboth methods can be used to override the density settings for the 1014451f142SCy Schubertnewly formatted medium (without permanently changing the density 1024451f142SCy Schubertsettings of 1034451f142SCy Schubert.Ar device ) . 1044451f142SCy Schubert.Pp 1054451f142SCy SchubertIf the 1064451f142SCy Schubert.Fl q 1074451f142SCy Schubertflag has not been specified, the user is asked for a confirmation 1084451f142SCy Schubertof the intended formatting process. 1094451f142SCy SchubertIn order to continue, an answer 1104451f142SCy Schubertof 1114451f142SCy Schubert.Ql y 1124451f142SCy Schubertmust be given. 1134451f142SCy Schubert.Pp 1144451f142SCy SchubertNote that 1154451f142SCy Schubert.Nm 1164451f142SCy Schubertdoes only perform low-level formatting. 1174451f142SCy SchubertIn order to create 1184451f142SCy Schuberta file system on the medium, see the commands 1194451f142SCy Schubert.Xr newfs 8 1204451f142SCy Schubertfor a 1214451f142SCy Schubert.Tn UFS 1224451f142SCy Schubertfile system, or 1234451f142SCy Schubert.Xr newfs_msdos 8 1244451f142SCy Schubertfor an 1254451f142SCy Schubert.Tn MS-DOS 1264451f142SCy Schubert(FAT) 1274451f142SCy Schubertfile system. 1284451f142SCy Schubert.Sh EXIT STATUS 1294451f142SCy SchubertAn exit status of 0 is returned upon successful operation. 1304451f142SCy SchubertExit status 1314451f142SCy Schubert1 is returned on any errors during floppy formatting, and an exit status 1324451f142SCy Schubertof 2 reflects invalid arguments given to the program (along with an 1334451f142SCy Schubertappropriate information written to diagnostic output). 134*e0524746SMurray Stokely.Sh EXAMPLES 135*e0524746SMurray StokelyTo format a new double-sided, high-density (HD) 1.44 MB disk 136*e0524746SMurray Stokelyinserted in the first floppy disk drive, issue: 137*e0524746SMurray Stokely.Pp 138*e0524746SMurray Stokely.Dl "/usr/sbin/fdformat -f 1440 /dev/fd0" 139*e0524746SMurray Stokely.Pp 140*e0524746SMurray StokelyAfter low-level formatting the disk with 141*e0524746SMurray Stokely.Nm , 142*e0524746SMurray Stokelycreate a disk label so that the system can determine the size and 143*e0524746SMurray Stokelygeometry of the disk. 144*e0524746SMurray StokelyThe supported geometry values are listed in 145*e0524746SMurray Stokely.Pa /etc/disktab , 146*e0524746SMurray Stokelyand we will use 147*e0524746SMurray Stokely.Va fd1440 148*e0524746SMurray Stokelyfor this example. 149*e0524746SMurray StokelyTo write the disk label, use 150*e0524746SMurray Stokely.Xr bsdlabel 8 : 151*e0524746SMurray Stokely.Pp 152*e0524746SMurray Stokely.Dl "/sbin/bsdlabel -B -w /dev/fd0 fd1440" 153*e0524746SMurray Stokely.Pp 154*e0524746SMurray StokelyThe floppy is now ready to be high-level formatted with a file system. 155*e0524746SMurray StokelyTo format the floppy disk with FAT, issue: 156*e0524746SMurray Stokely.Pp 157*e0524746SMurray Stokely.Dl "/sbin/newfs_msdos /dev/fd0" 1584451f142SCy Schubert.Sh DIAGNOSTICS 1594451f142SCy SchubertUnless 1604451f142SCy Schubert.Fl q 1614451f142SCy Schuberthas been specified, a single letter is printed to standard output 1624451f142SCy Schubertto inform the user about the progress of work. 1634451f142SCy SchubertFirst, an 1644451f142SCy Schubert.Ql F 1654451f142SCy Schubertis printed when the track is being formatted, then a 1664451f142SCy Schubert.Ql V 1674451f142SCy Schubertwhile it is being verified, and if an error has been detected, it 1684451f142SCy Schubertwill finally change to 1694451f142SCy Schubert.Ql E . 1704451f142SCy SchubertDetailed status information (cylinder, head and sector number, and the 1714451f142SCy Schubertexact cause of the error) will be printed for up to 10 errors after the 1724451f142SCy Schubertentire formatting process has completed. 1734451f142SCy Schubert.Sh SEE ALSO 1744451f142SCy Schubert.Xr fdc 4 , 175*e0524746SMurray Stokely.Xr bsdlabel 8 , 1764451f142SCy Schubert.Xr fdcontrol 8 , 1774451f142SCy Schubert.Xr newfs 8 , 1784451f142SCy Schubert.Xr newfs_msdos 8 1794451f142SCy Schubert.Sh HISTORY 1804451f142SCy SchubertThe 1814451f142SCy Schubert.Nm 1824451f142SCy Schubertutility 1834451f142SCy Schuberthas been developed for 1844451f142SCy Schubert.Bx 386 0.1 1854451f142SCy Schubertand upgraded to the new 1864451f142SCy Schubert.Xr fdc 4 1874451f142SCy Schubertfloppy disk driver. 1884451f142SCy SchubertIt later became part of the 1894451f142SCy Schubert.Fx 1.1 1904451f142SCy Schubertsystem. 1914451f142SCy SchubertStarting with 1924451f142SCy Schubert.Fx 5.0 , 1934451f142SCy Schubertit uses the unified density specifications as described in 1944451f142SCy Schubert.Xr fdcontrol 8 . 1954451f142SCy Schubert.Sh AUTHORS 1964451f142SCy Schubert.An -nosplit 1974451f142SCy SchubertThe program has been contributed by 1984451f142SCy Schubert.An J\(:org Wunsch , 1994451f142SCy SchubertDresden, with changes by 2004451f142SCy Schubert.An Serge Vakulenko 2014451f142SCy Schubertand 2024451f142SCy Schubert.An Andrey A. Chernov , 2034451f142SCy SchubertMoscow. 204