- 帖子
- 40
- 积分
- 64
- 技术
- 1
- 捐助
- 0
- 注册时间
- 2012-11-7
|
[其他] 每天一文:format命令微软官网翻译。12.11.14
该命令仍需修改
Format
Formats a disk to accept Windows files.
将一个磁盘格式化来兼容windows文件。
格式化究竟操作了什么?目的于何?
Syntax
语法
________________________________________
format <Volume> [/fs:{FAT|FAT32|NTFS}] [/v:<Label>] [/q] [/a:<UnitSize>] [/c] [/x] [/p:<asses>]
format <Volume> [/v:<Label>] [/q] [/f:<Size>] [/p:<Passes>]
format <Volume> [/v:<Label>] [/q] [/t:<Tracks> /n:<Sectors>] [/p:<Passes>]
format <Volume> [/v:<Label>] [/q] [/p:<Passes>]
format <Volume> [/q]
Parameters
参数
________________________________________
Parameter
参数 Description
描述
<Volume>
<卷> Specifies the mount point, volume name, or drive letter (followed by a colon) of the drive that you want to format. If you do not specify any of the following command-line options, format uses the volume type to determine the default format for the disk.
指定你想要格式化的固定的点,卷名称,或者驱动器字母(后面跟一个冒号)。如果你不指定任何下面的命令行选项,format使用卷类型来决定对磁盘的默认格式化。
/fs:{FAT|FAT32|NTFS|UDF} Specifies the type of the file system: FAT, FAT32, NTFS, or UDF. Floppy disks can use only the FAT file system.
指定文件系统类型:fat,fat32,ntfs,或者udf。软盘只能用fat文件系统。
这几种文件类型是怎么回事?决定他们的因素是什么?
/v:<Label> Specifies the volume label. If you omit the /v command-line option or use it without specifying a volume label, format prompts you for the volume label after the formatting is complete. Use the syntax /v:to prevent the prompt for a volume label. If you use a single format command to format more than one disk, all of the disks will be given the same volume label.
指定卷标。如果你忽略/v参数或者使用它却不指定卷标,format会在格式化完成以后提示你输入卷标。使用语法是:/v:为了防止提示输入卷标。如果你使用单个format命令来格式不知一个磁盘,所有的磁盘将会被设置为统一卷标。
/a:<UnitSize> Specifies the allocation unit size to use on FAT, FAT32, or NTFS volumes. If you do not specify UnitSize, it is chosen based on volume size. Default settings are strongly recommended for general use. The following list presents valid values for NTFS, FAT, and FAT32 UnitSize:
指定分配单元的大小来使用到fat,fat32,或者ntfs卷。如果你不指定单元大小,他的选择会基于卷大小。强烈建议一般使用默认设置。下面的列表提出了ntfs,fat和fat32合法的单元大小值:
512
1024
2048
4096
8192
16K
32K
64K
FAT and FAT32 also support 128K and 256K for a sector size greater than 512 bytes.
Fat和fat32同样支持128k和256k作为一个扇区大小大于512字节。
/q Performs a quick format. Deletes the file table and the root directory of a previously formatted volume, but does not perform a sector-by-sector scan for bad areas. You should use the /q command-line option to format only previously formatted volumes that you know are in good condition. Note that /q overrides /p.
执行一个快速格式化。删除文件表和根目录以前格式化的卷,但是并不会对每个扇区的坏区进行浏览。你因该使用/q命令选项来格式化之前格式化过的卷并且你知道该卷处于良好状态。注意/q会覆盖/p
/f:<Size> Specifies the size of the floppy disk to format. When possible, use this command-line option instead of the /t and /n command-line options. Windows accepts the following values for size:
指定软盘大小来格式化。如果可能,使用这个命令行选项来代替/t和/n命令行选项。
Windows兼容以下卷大小:
• 1440 or 1440k or 1440kb
• 1.44 or 1.44m or 1.44mb
• 1.44-MB, double-sided, quadruple-density, 3.5-inch disk
四倍密度,3.5英寸磁盘
/t:<Tracks> Specifies the number of tracks on the disk. When possible, use the /f command-line option instead. If you use the /t option, you must also use the /n option. These options together provide an alternative method of specifying the size of the disk that is being formatted. This option is not valid with the /f option.
指定磁盘上的磁道数。如果可能的话,使用/f命令行来取代。如果使用/t选项,你必须也使用/n选项。这些选项一起提供选择指定磁盘大小的方法来格式化。这个选项不适用于/f选项。
/n:<Sectors> Specifies the number of sectors per track. When possible, use the /f command-line option instead of /n. If you use /n, you must also use /t. These two options together provide an alternative method of specifying the size of the disk that is being formatted. This option is not valid with the /f option.
指定每个磁道上的分区数。如果可能,使用/f命令行选项来代替/n。如果你使用/n你必须也使用/t。这两个选项一起来提供指定磁盘大小的方法。这个选项不适用于/f选项。
/p:<Passes> Zeros every sector on the volume for the number of passes specified. This option is not valid with the /q option.
为passes中指定的卷清零每个扇区。
/c NTFS only. Files created on the new volume will be compressed by default.
仅适用于ntfs。建立在新卷上的文件将会默认被压缩。
/x Causes the volume to dismount, if necessary, before it is formatted. Any open handles to the volume will no longer be valid.
/? Displays help at the command prompt.
在命令行中显示帮助信息。
Remarks
________________________________________
• Administrative credentials
系统管理认证
You must be a member of the Administrators group to format a hard drive.
你必须作为管理员组的成员来格式化这个硬盘驱动器。
• Using format
使用format
The format command creates a new root directory and file system for the disk. It can also check for bad areas on the disk, and it can delete all data on the disk. To be able to use a new disk, you must first use this command to format the disk.
Format命令为磁盘建立一个新的根目录和文件系统。它同样可以检查磁盘上的坏区。并且可以删除所有磁盘上的数据。为了可以使用一个新的磁盘,你必须首先用这个命令来格式化磁盘。
• Adding a volume label
添加一个卷标
After formatting a floppy disk, format displays the following message:
格式化完一个软盘以后,format显示以下信息:
Volume label (11 characters, ENTER for none)?
卷标(11个字符,输入一个)?
To add a volume label, type up to 11 characters (including spaces). If you do not want to add a volume label to the disk, press ENTER.
为了添加一个卷标,输入11字符(包括空格)。如果你不想太你家卷标,直接按回车。
• Formatting a hard disk
格式化一个硬盘
Note
注意
You must be a member of the Administrators group to format a hard disk.
你必须是管理员组中的一个成员来格式化硬盘
When you use the format command to format a hard disk, a warning message similar to the following displays:
当你使用format命令来格式化硬盘时,类似于以下的提示信息会显示:
WARNING, ALL DATA ON NON-REMOVABLE DISK
DRIVE x: WILL BE LOST!
Proceed with Format (Y/N)? _
警报,所有在non-removable 磁盘上的数据
驱动器 x:将会丢失!
执行格式化(Y/N)?_
To format the hard disk, press Y; if you do not want to format the disk, press N.
如果需要格式化输入Y,如果不需要格式化,按下N
• Unit size
单元大小
FAT file systems restrict the number of clusters to no more than 65526. FAT32 file systems restrict the number of clusters to between 65527 and 4177917.
Fat文件系统限制簇大小不超过65526.Fat32文件系统限制簇大小在65527到4177917之间。
NTFS compression is not supported for allocation unit sizes above 4096.
Ntfs压缩不支持单元大小在4096之上。
Note
注意
Format will immediately stop processing if it determines that the previous requirements cannot be met using the specified cluster size.
Format将会直接停止运行如果它检测到之前的请求不能满足指定的簇大小。
• Format messages
格式化信息
When formatting is complete, format displays messages that show the total disk space, the spaces marked as defective, and the space available for your files.
当格式化完成时,format显示的信息会告诉你磁盘的总空间,有错误的空间,以及可用空间。
• Quick formatting
快速格式化
You can speed up the formatting process by using the /q command-line option. Use this option only if there are no bad sectors on your hard disk.
你可以加快格式化程序通过使用/q命令选项。使用这个选项仅当扇区中没有错误时。
• Using format with a reassigned drive or a network drive
对重新分配的驱动器或网络驱动器格式化
You should not use the format command on a drive that was prepared by using the subst command. You cannot format disks over a network.
你不可以对一个使用过subst命令的驱动器进行格式化命令。也不可以格式化网络驱动器。
• Format exit codes
Format退出代码
The following table lists each exit code and a brief description of its meaning.
下面的表格列出了每个退出代号和和简明的描述信息。
Exit code
退出代码 Description
描述信息
0 The format operation was successful.
格式化成功执行
1 Incorrect parameters were supplied.
应用了错误的参数
4 A fatal error occurred (which is any error other than 0, 1, or 5).
发生了重大错误(与0,1,5不同的错误)
5 The user pressed N in response to the prompt "Proceed with Format (Y/N)?" to stop the process.
使用者选择了N来取人是否进行格式化(Y/N)来结束了格式化程序。
You can check these exit codes by using the ERRORLEVEL environment variable with
the if batch command.
你可以通过使用errorlevel环境变量检查这些退出代码。
• Using format at the Recovery Console
在可恢复控制台中使用format
The format command, with different parameters, is available from the Recovery Console.
该命令所有参数均可应用于可恢复控制台。
Examples
例子
________________________________________
To format a new floppy disk in drive A using the default size, type:
为了格式化一个新软盘驱动器A,输入:
format a:
To perform a quick format operation on a previously formatted floppy disk in drive A, type:
为了对之前格式化过的软盘A进行一个快速格式化操作,输入:
format a: /q
To format a floppy disk in drive A and assign it the volume label "DATA," type:
为了格式化一个软盘A并标记卷标为”DATA,输入:”
format a: /vATA |
|