Windows provides command line tool named fsutils to manage disk related issues. This tool provides management capabilities volume information to repairing file system, setting quotas to listing free space. In this tutorial we will look most needed usage scenarios of the fsutil
command.
Windows提供了名为fsutils的命令行工具来管理与磁盘相关的问题。 该工具提供管理功能卷信息以修复文件系统,设置配额以列出可用空间。 在本教程中,我们将研究fsutil
命令最需要的使用场景。
帮帮我 (Help)
Help about fsutil command can be get with just issuing the command.
只需发出命令,即可获得有关fsutil命令的帮助。
$ fsutil

列出所有驱动器(List All Drives)
While troubleshooting or diagnosing a problem first thing we will do is listing installed drives. All drives connected on the system can be listed with the following command.
在排除故障或诊断问题时,我们要做的第一件事就是列出已安装的驱动器。 可以使用以下命令列出系统上连接的所有驱动器。
$ fsutil fsinfo drives

We have only one drive current installed
我们仅安装了一个驱动器电流
打印驱动器类型(Print Drive Type)
Drive type is generally refer to the drive connection to the system. Local disk are generally used to install operating systems. In order to store data SAN storage is preferred. Disk type will give exact type of the drive.
驱动器类型通常是指驱动器与系统的连接。 本地磁盘通常用于安装操作系统。 为了存储数据,首选SAN存储。 磁盘类型将提供驱动器的确切类型。
$ fsutil fsinfo drivetype c:

As we can see C:
is a fixed and locally mounted drive.
我们可以看到C:
是一个固定的本地安装的驱动器。
打印量信息 (Print Volume Information)
Volumes have file system related features. These features can be listed with the following command. In this example we will list volume C:
file system information.
卷具有文件系统相关的功能。 可以使用以下命令列出这些功能。 在此示例中,我们将列出卷C:
文件系统信息。
$ fsutil fsinfo volumeinfo c:

This command will provide following information:
该命令将提供以下信息:
Volume Name
Volume Name
Volume Serial Number
Volume Serial Number
File System Length
File System Length
Supports
支持
- Case-sensitive File Names区分大小写的文件名
- Unicode File NamesUnicode文件名
- File based Compression基于文件的压缩
- Disk Quotas磁盘配额
- Sparse Files稀疏文件
- Reparse Files重新解析文件
- Object Identifiers对象标识符
- Encrypted File System加密文件系统
- Named Streams命名流
- Transactions交易次数
- Hard Links硬链接
- Extended Attributes扩展属性
- USN JournalsUSN期刊
- Preserves & Enforce ACL’s保留并执行ACL
列出文件系统信息 (List File System Information)
File systems holds all the data about operating systems, user files etc. Some information about the file system can be listed with the following command. We will list NTFS file system information of the drive C:
文件系统包含有关操作系统,用户文件等的所有数据。有关文件系统的某些信息可以使用以下命令列出。 我们将列出驱动器C:
NTFS文件系统信息C:
$ fsutil fsinfo ntfsinfo c:

As we can see from screenshot following information is printed about ntfs file system.
正如我们从屏幕快照中看到的,以下信息是关于ntfs文件系统的。
Version
will print NTFS file system versionVersion
将打印NTFS文件系统版本Number Sectors
Number Sectors
Total Clusters
Total Clusters
Free Clusters
Free Clusters
Total Reserved
Total Reserved
Bytes Per Sector
Bytes Per Sector
Bytes Per Cluster
Bytes Per Cluster
Bytes Per FileRecord Segment
Bytes Per FileRecord Segment
- Mft Valid Data Length` Mft有效数据长度`
- and other Mft related information 和其他与Mft相关的信息
打印可用空间 (Print Free Space)
Free space on the volume can be printed with the following command.
可以使用以下命令来打印卷上的可用空间。
$ fsutil volume diskfree c:

The sizes are printed as byte.
大小以字节打印。
维修档案系统 (Repair File System)
File systems are generally designed to be error prone and error corrective. But changes can change and file system can become corrupted. This corrupted file system can be corrected and repaired with the following command. c:
is the the we want to set automatic repair with 1
. Also if we give according to
1
this will make unset automatic repair operation.
文件系统通常设计为易于出错和纠正错误。 但是更改可能会更改,文件系统可能会损坏。 可以使用以下命令更正和修复此损坏的文件系统。 c:
是我们要设置为1
自动修复。 如果我们给根据
1
这将使未设置的自动修复操作。
$ fsutils repair set c: 1
翻译自: https://www.poftut.com/use-fsutil-check-repair-file-system-windows/