21.09.2018, 21:30
(23.02.2018, 21:21)buuuudzik Wrote: Here you have script for checking SD card current errors:
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
Recently I've been hit with a read-only SD card. Could this script be used in detecting a read-only SD card?
I became aware of this after a power cut and a reboot of the LM. It appeared that the card was already in read-only mode for quite a while. As a result of this I lost quite some trend log data...