如何使用Fsutil在Windows中检查和修复文件系统?

Windows的fsutil命令行工具用于管理磁盘问题,包括查看驱动器信息、文件系统信息、可用空间,以及修复文件系统。本文介绍了如何使用fsutil进行各种操作,如列出驱动器、打印驱动器类型、获取卷信息、检查文件系统状态以及修复损坏的文件系统。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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
fsutil Help
fsutil Help
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
List All Drives with fsutil
List All Drives with fsutil
列出所有带有fsutil的驱动器

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:
Print Drive Type
Print Drive Type
打印驱动器类型

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:
Print Volume Information
Print Volume Information
打印量信息

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 Names

      Unicode文件名
    • File based Compression

      基于文件的压缩
    • Disk Quotas

      磁盘配额
    • Sparse Files

      稀疏文件
    • Reparse Files

      重新解析文件
    • Object Identifiers

      对象标识符
    • Encrypted File System

      加密文件系统
    • Named Streams

      命名流
    • Transactions

      交易次数
    • Hard Links

      硬链接
    • Extended Attributes

      扩展属性
    • USN Journals

      USN期刊
  • 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:
List File System Information
List File System Information
列出文件系统信息

As we can see from screenshot following information is printed about ntfs file system.

正如我们从屏幕快照中看到的,以下信息是关于ntfs文件系统的。

  • Version will print NTFS file system version

    Version将打印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相关的信息
LEARN MORE  How To Compress Files and Folders In File System Level With Compact Command In Windows NTFS?
了解更多信息如何在Windows NTFS中使用压缩命令在文件系统级别压缩文件和文件夹?

打印可用空间 (Print Free Space)

Free space on the volume can be printed with the following command.

可以使用以下命令来打印卷上的可用空间。

$ fsutil volume diskfree c:
Print Free Space
Print Free Space
打印可用空间

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/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值