Got it

HDFS fsck command

Created: Mar 23, 2020 06:45:37Latest reply: Mar 25, 2022 10:34:56 698 6 2 0 0
  Rewarded HiCoins: 0 (problem resolved)

Hello team,

Who can tell me about the hdfs fsck command in FusionInsight HD? Thank you.


  • x
  • convention:

Featured Answers
little_fish
Admin Created Mar 23, 2020 06:47:14

Hi Phany,

The hdfs fsck command is used to check the files on HDFS.

Usage: hdfs fsck <path> [-list-corruptfileblocks | [-move | -delete | -openforwrite] [-files [-blocks [-locations | -racks]]]]

  • <path>: specifies the path of the fsck file.

  • move: moves damaged files to /lost+found.

  • delete: deletes damaged files.

  • openforwrite: displays the file that is being opened for writing.

  • files: displays file information.

  • list-corruptfileblocks: displays the list of lost blocks and owning file information.

  • blocks: displays block information.

  • locations: displays the location of each block.

  • racks: displays the rack information about DataNodes.


This command can be used to check the health status of a file system, for example, whether blocks are lost and whether files are damaged. Additionally, this command can be used to delete damaged files. If the HDFS data volume is large, run this command during off-peak hours because this command brings great pressure on the NameNode.

Example: hdfs fsck /user/pippo/test.sh -files -blocks -locations

Thanks.


View more
  • x
  • convention:

Sokrin
Sokrin Created Oct 18, 2021 06:05:12 (0) (0)
 
olive.zhao
olive.zhao Admin Created Mar 18, 2022 09:47:09

If you want to see more HDFS commands, see HDFS Commands.


View more
  • x
  • convention:

All Answers
little_fish
little_fish Admin Created Mar 23, 2020 06:47:14

Hi Phany,

The hdfs fsck command is used to check the files on HDFS.

Usage: hdfs fsck <path> [-list-corruptfileblocks | [-move | -delete | -openforwrite] [-files [-blocks [-locations | -racks]]]]

  • <path>: specifies the path of the fsck file.

  • move: moves damaged files to /lost+found.

  • delete: deletes damaged files.

  • openforwrite: displays the file that is being opened for writing.

  • files: displays file information.

  • list-corruptfileblocks: displays the list of lost blocks and owning file information.

  • blocks: displays block information.

  • locations: displays the location of each block.

  • racks: displays the rack information about DataNodes.


This command can be used to check the health status of a file system, for example, whether blocks are lost and whether files are damaged. Additionally, this command can be used to delete damaged files. If the HDFS data volume is large, run this command during off-peak hours because this command brings great pressure on the NameNode.

Example: hdfs fsck /user/pippo/test.sh -files -blocks -locations

Thanks.


View more
  • x
  • convention:

Sokrin
Sokrin Created Oct 18, 2021 06:05:12 (0) (0)
 
user_4400653
user_4400653 Created Oct 18, 2021 06:02:31

Good one
View more
  • x
  • convention:

Unicef
Unicef MVE Created Oct 18, 2021 12:08:06

Good answer
View more
  • x
  • convention:

olive.zhao
olive.zhao Admin Created Mar 18, 2022 09:47:09

If you want to see more HDFS commands, see HDFS Commands.


View more
  • x
  • convention:

user_4358465
user_4358465 Created Mar 25, 2022 10:34:56

Great answers and help littlefish and Olive
View more
  • x
  • convention:

Comment

You need to log in to comment to the post Login | Register
Comment

Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " User Agreement."

My Followers

Login and enjoy all the member benefits

Login

Block
Are you sure to block this user?
Users on your blacklist cannot comment on your post,cannot mention you, cannot send you private messages.
Reminder
Please bind your phone number to obtain invitation bonus.
Information Protection Guide
Thanks for using Huawei Enterprise Support Community! We will help you learn how we collect, use, store and share your personal information and the rights you have in accordance with Privacy Policy and User Agreement.