Formatting Partitions

 < Day Day Up > 



Formatting creates a file system in a partition and permanently deletes any existing data. Windows XP and Windows Server 2003 support FAT, FAT32, and NTFS file systems. FAT is the file system type supported by MS-DOS and Windows 3.1, Windows 95, Windows 98, and Windows Millennium Edition (Windows Me). FAT32 is a 32-bit version of FAT. NTFS is the native file system type for Windows NT, Windows 2000, Windows XP, and Windows Server 2003.

More Info

To learn about the features of each file system, see Chapter 13 in Microsoft Windows Server 2003 Administrator’s Pocket Consultant (Microsoft Press, 2003).

Using Format

To format a partition, you use the FORMAT command. If you are currently using DiskPart, type exit to leave its text-mode interpreter and return to the command prompt. When formatting hard disk drives, the basic syntax of the FORMAT command is

format Volume /fs:FileSystem /v:Label /a:UnitSize 

where Volume specifies the drive letter or mount point to format, FileSystem sets the file system type, Label sets the descriptive text name, and UnitSize sets the allocation unit size for bytes per disk cluster. A disk cluster, also referred to as a disk sector, is a small section of a disk made up of individual bytes. The volume label can be a maximum of 11 characters (including spaces) and is used with drive letters, not mount points. If you don’t set the allocation unit size, FORMAT chooses one for you based on the size of the volume. Valid allocation unit sizes include

  • 512 Sets 512 bytes per cluster

  • 1024 Sets 1024 bytes per cluster

  • 2048 Sets 2048 bytes per cluster

  • 4096 Sets 4096 bytes per cluster

  • 8192 Sets 8192 bytes per cluster

  • 16K Sets 16 kilobytes per cluster

  • 32K Sets 32 kilobytes per cluster

  • 64K Sets 64 kilobytes per cluster

To see how the Format utility is used, consider the following examples:

Format the F drive to use the FAT32 file system and label it AppData:

format f: /fs:fat32 /v:AppData

Format the mount point C:\Data to use the NTFS file system and 512 bytes per disk cluster:

format c:\data /fs:ntfs /a:512

Format the S drive to use the NTFS file system and label it
AppData:

format s: /fs:fat32 /v:AppData
Note

If there’s an existing file system, FORMAT prompts you to enter the current volume label as a precaution. After you type the current volume label, you will also need to confirm that you want to proceed with the formatting, which will wipe out any existing data on the volume. You can’t avoid these prompts.

Tip

In some cases, you might need to dismount the volume before you can format it. You can do this with the /X parameter. In addition, if you are working with a previously formatted drive that doesn’t have any known problems, you could perform a quick format instead of a thorough format using the /Q parameter. With a quick format, FORMAT prepares the file system for use without checking for errors. With large partitions, this option can save you a few minutes. However, it doesn’t allow FORMAT to mark bad sectors on the disk and lock them out.

Formatting: An Example

When FORMAT starts, it will display the current file system type and tell you what the new file system type will be, as follows:

C:\>format e: /fs:ntfs
The type of the file system is RAW.
The new file system is NTFS.

Note

In this example, an unallocated space is being formatted, which is why the type of file system is listed as RAW. Some applications also write RAW data to disks, and when they do, the data is written directly to the disk without the benefits of partitioning or an actual file system.

FORMAT will then warn you that any existing data will be lost and asks you to confirm that you want to continue:

WARNING, ALL DATA ON NON-REMOVABLE DISK
DRIVE E: WILL BE LOST!
Proceed with Format (Y/N)?

If you continue, FORMAT will verify the partition and then begin formatting it, showing the percentage of formatting complete:

Verifying 500M
25 percent completed.

FORMAT then creates the file system structures and reports that formatting is complete:

Creating file system structures.
Format complete.

FORMAT also reports the total disk space and the available disk space on the new partition:

    511999 KB total disk space.
507066 KB are available.
Tip

Use the /C parameter to turn on compression for the disk. Built- in compression is available only for NTFS. Under NTFS, compression is transparent to users and compressed files can be accessed just like regular files. If you select this option, files and directories on this drive are compressed automatically.



 < Day Day Up > 



Microsoft Windows Command-Line Administrator's Pocket Consultant
MicrosoftВ® WindowsВ® Command-Line Administrators Pocket Consultant
ISBN: 0735620385
EAN: 2147483647
Year: 2004
Pages: 114

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net