Sunday, January 01, 2012

DOS Commands - Format




FORMAT

Prepares a new disk so that DOS can store files on it. Keep in mind however, that FORMAT is lethal to disks that already contain files because it wipes their little data banks totally clean!!

DOSspeak:

FORMAT drive: [/v[ :label]] [/q]
[/u] [/f :size] [/b] [/s]

or

FORMAT drive: [/v[ :label]] [/q]
[/u] [/t :tracks /n:sectors] [/b] [/s]

or

FORMAT drive: [/v[ :label]] [/q]
[/u] [/l] [/4] [/8] [/b] [/s]


Variable or Option                                       Function
--------------------------------------------------------------------------------------------
drive:                                                     Specifies the letter of the drive that contains the
                                                              disk you want formatted. Unless you really
                                                              intend to wipe out all the data on your hard disk,
                                                              you will want to restrict this drive: parameter to
                                                              only A or B, the designation for your first and
                                                              second floppy disk drives, respectively.


/v[:label]                                                 In versions before 4, indicates that you want to
                                                              assign a volume label to the disk (versions after 4
                                                              automatically prompt you to enter a volume label
                                                              when you format the disk). In versions 4+, you
                                                              can avoid the label prompt by specifying a label
                                                              parameter with the /v switch that contains the
                                                              text of the volume label (up to 11 characters)
                                                              following a colon.


/q                                                           (Versions 5+) Performs a quick format of a
                                                              previously formatted disk.


/u                                                           (Versions 5+) Performs an unconditional format
                                                              that destroys all previous data on the disk--
                                                              data that cannot later be restored with the
                                                              UNFORMAT command. (This type of formatting
                                                              is what versions of DOS before 5.0 perform.)


/f:size                                                     (Versions 4+) Specifies the size of the disk to
                                                              format. Size parameters can include 160 for a
                                                              160K disk, 180 for 180K, 320 for 320K, 360 for
                                                              360K, 720 for 720K, 1.2 for 1.2M, 1.44 for 1.44M,
                                                              and 2.88 (Versions 5+) for 2.88M. Don't use this
                                                              switch with the /l, /8, /t or /n switches.


/b                                                           Formats the disk to use only eight sectors per
                                                              track (even when formatting a disk with 9 or 15
                                                              sectors) and leaves space for the DOS system
                                                              files (without copying them on the disk -- use
                                                              SYS to do this part). You can't use this switch
                                                              with /t or /s switches.


/s                                                           Copies the system files to the formatted disk so
                                                              that you can boot from that disk.


/t:tracks                                                  (Version 3.3 only) Specifies the number of tracks
                                                              on the formatted disk.


/n:sectors                                                (Version 3.3 only) Specifies the number of sectors
                                                              per track on the formatted disk.


/l       (L)                                                 Formats only one side of a floppy disk.


/4                                                            (Versions 3.2+) Formats a double-density (360K)
                                                               disk in a high density (1.2M) drive.


/8                                                            Formats eight sectors per track on 5 1/4" floppy
                                                               disks instead of the normal 9 for double-sided or
                                                               15 for high-density disks. You can't use this
                                                               switch with the /t or /v switches.




Sample:

Your department has run out of new high-density (1.2M) 5 1/4" floppy disks, and you need to copy some files for Al in finance. You decide to trash an old high-density disk that you find in the Boss's office. To reformat this disk, you enter:

format a:



Later on that day, Sue comes over with a new double-density 5 1/4" disk and asks you to format it for her (she can't do it because Cindy's doing payroll on her machine.) Because you know Sue's computer only has a double-sided floppy drive, you enter the following command to format her disk on your high-density floppy drive:

format a: /4

Note that you could also accomplish this task by entering:

format a: /f:360


More Stuff:

If you're using DOS Version 5 or later and (knock on wood) you reformat a floppy disk that has valuable data on it, you may be able to recover the files (or most of them anyway) with the UNFORMAT command, provided that you use this command before you put any new files on this disk.


No comments:

Post a Comment