Support Questions

Find answers, ask questions, and share your expertise

is it safe to run e2fsck -y /dev/sdXX on hdfs files

avatar

we see the system log on one of the worker machine ( dmesg )

and from the log we saw that:

(sdc): warning: mounting fs with errors, running e2fsck is recommended

disk - sdc include the HDFS folder - hdfs files

df | grep sdc  /dev/sdc                 1922721048  1560852 1921143812   1% /grop/sdc

ls /grop/sdc/hadoop/

hdfs  yarn

so is it safe to run the following ( as OS logs recommended ) , <in spite disk include HDFS files , is it risky?>

e2fsck -y /dev/sdc


Michael-Bronson
1 ACCEPTED SOLUTION

avatar

f you don't run the filesystem checker, the apparent corruption in the filesystem may get worse. Unchecked, this can lead to data corruption or at the unlikely worst destruction of the filesystem.

During the filesystem check, file structures within the filesystem will be checked, and if necessary repaired. The repair takes no account of content; it's all about making sure the filesystem is self-consistent.

If you run e2fsck -y /dev/sdc you have no opportunity to validate the corrections being applied.

On the other hand if you run e2fsck -n /dev/sdc you can see what would happen without it actually being applied, and if you run e2fsck /dev/sdc you will be asked each time a significant correction needs to be applied.

In summary

  • If you ignore the warning and do nothing, over time you may lose your data
  • If you run with -y you have no option to review the potentially destructive changes, and you may lose your data
  • If you run with -n you will not fix any errors, and over time may lose your data, but you will get to review the set of changes that would be made
  • If you run with no special flag you will be prompted to fix relevant errors, and you can decide for each whether you are going to need direct professional assistance

Recommendation

  • Run e2fsck -n /dev/sdc to review the errors
  • Decide whether this merits a subsequent e2fsck /dev/sdc (or possibly e2fsck -y /dev/sdc) or whether you would prefer to obtain direct professional assistance
Michael-Bronson

View solution in original post

1 REPLY 1

avatar

f you don't run the filesystem checker, the apparent corruption in the filesystem may get worse. Unchecked, this can lead to data corruption or at the unlikely worst destruction of the filesystem.

During the filesystem check, file structures within the filesystem will be checked, and if necessary repaired. The repair takes no account of content; it's all about making sure the filesystem is self-consistent.

If you run e2fsck -y /dev/sdc you have no opportunity to validate the corrections being applied.

On the other hand if you run e2fsck -n /dev/sdc you can see what would happen without it actually being applied, and if you run e2fsck /dev/sdc you will be asked each time a significant correction needs to be applied.

In summary

  • If you ignore the warning and do nothing, over time you may lose your data
  • If you run with -y you have no option to review the potentially destructive changes, and you may lose your data
  • If you run with -n you will not fix any errors, and over time may lose your data, but you will get to review the set of changes that would be made
  • If you run with no special flag you will be prompted to fix relevant errors, and you can decide for each whether you are going to need direct professional assistance

Recommendation

  • Run e2fsck -n /dev/sdc to review the errors
  • Decide whether this merits a subsequent e2fsck /dev/sdc (or possibly e2fsck -y /dev/sdc) or whether you would prefer to obtain direct professional assistance
Michael-Bronson