Table of Contents

About

Runs the HDFS filesystem checking utility for various inconsistencies.

Unlike a traditional fsck utility for native file systems, this command does not correct the errors it detects.

It will report problems with various files, such as:

Syntax

  • By default fsck ignores open files but provides an option to select all files during reporting.
  • fsck can be run on the whole file system or on a subset of files.

fsck is a command if hdfs

bin/hdfs fsck

Example

hdfs fsck /
Connecting to namenode via http://ip:50070/fsck?ugi=ubuntu&path=%2F
FSCK started by ubuntu (auth:SIMPLE) from /ip for path / at Tue Jul 18 04:34:19 UTC 2017
Status: HEALTHY
 Total size:    0 B
 Total dirs:    1
 Total files:   0
 Total symlinks:        0
 Total blocks (validated):  0
 Minimally replicated blocks:   0
 Over-replicated blocks:    0
 Under-replicated blocks:   0
 Mis-replicated blocks:     0
 Default replication factor:    3
 Average block replication: 0.0
 Corrupt blocks:        0
 Missing replicas:      0
 Number of data-nodes:      32
 Number of racks:       1
FSCK ended at Tue Jul 18 04:34:19 UTC 2017 in 1 milliseconds
The filesystem under path '/' is HEALTHY

Documentation / Reference