Here you have script for checking SD card current errors:
It can be helpful in monitoring SD card and knowing about start of problems and that it must replaced
Code:
function checkSDCardErrors()
f = assert (io.popen('dmesg | grep mmcblk'))
errorsCounter = 0
for line in f:lines() do
isThereSDError = line:match("mmcblk*..*: (.*error*..*)")
if isThereSDError then errorsCounter = errorsCounter + 1 end
end
f:close()
return errorsCounter
end
log(checkSDCardErrors())
It can be helpful in monitoring SD card and knowing about start of problems and that it must replaced