How to find out all files with replication factor 1 in HDFS?

Posted on In QA

How to find out all files with replication factor 1 in HDFS?

The hdfs dfsadmin -report shows there are blocks with replication factor 1:

Missing blocks (with replication factor 1): 7

How to find them out?

You can run hdfs fsck to list all files with their replication counts and grep those with replication factor 1. Run the following command as a HDFS superuser:

$ hdfs fsck / -files -blocks -racks | grep repl=1

Eric Ma

Eric is a systems guy. Eric is interested in building high-performance and scalable distributed systems and related technologies. The views or opinions expressed here are solely Eric's own and do not necessarily represent those of any third parties.

Leave a Reply

Your email address will not be published. Required fields are marked *