Hello, everyone!
I will share with you how to deal with the problem a disk has bad sectors and the file attribute is a question mark.
Symptom
The DataNode instance is abnormal. Log information indicates that some files on the disk cannot be accessed.
After the ll File name command is executed, the returned file attribute is ??.
This fault also occurs in non-HDFS files.
Possible Causes
The disk of the DataNode has bad sectors.
Fault Locating
Access the service instance and determine the fault node.
Log in to the node using PuTTY and run the following command (/export/data1 is the data directory of the DataNode):
ls -lR /export /srv 1>/dev/null

According to the command output, the file system of /export/data2 is damaged.
Run the following command:
ls -l /export/data2/dfs/data/current/BP-1450212980-210.X.X.12-1461640104094/current/finalized/subdir1/subdir29/

Question marks are displayed for some files.
Run the df -h command and find the disk to which /export/data2 is mounted. In this example, the disk is /dev/mapper/VG_SR5S5-ExportData2.

Solution
Run the following commands:
cd
umount /export/data2
xfs_repair /dev/mapper/VG_SR5S5-ExportData2
mount -a
NOTE:
1. This command is for your reference only.
2. Please call the operating system and hardware team to deal with this problem.
If the following information is returned when the umount command is executed, go to FusionInsight Manager and stop the faulty DataNode instance.

If the problem persists, run lsof | grep /export/data2 to view the process that is using the directory. If it is not a key process, kill it.
Restart the service (if you have stopped it in the preceding operations). The service is restored.
Check the NameNode list. The node is in the normal status.
We warmly welcome you to enjoy our community!



