This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Check SD card errors
#2
(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 replacedWink

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...
Reply


Messages In This Thread
Check SD card errors - by buuuudzik - 23.02.2018, 21:21
RE: Check SD card errors - by baggins - 21.09.2018, 21:30
RE: Check SD card errors - by buuuudzik - 21.09.2018, 21:51
RE: Check SD card errors - by Daniel - 24.09.2018, 07:34
RE: Check SD card errors - by baggins - 24.09.2018, 11:28
RE: Check SD card errors - by buuuudzik - 24.09.2018, 07:50
RE: Check SD card errors - by Daniel - 24.09.2018, 08:15
RE: Check SD card errors - by buuuudzik - 24.09.2018, 08:29
RE: Check SD card errors - by Daniel - 24.09.2018, 08:32
RE: Check SD card errors - by buuuudzik - 24.09.2018, 11:49
RE: Check SD card errors - by FatMax - 28.10.2018, 15:07
RE: Check SD card errors - by buuuudzik - 28.10.2018, 15:22
RE: Check SD card errors - by FatMax - 28.10.2018, 15:24
RE: Check SD card errors - by admin - 29.10.2018, 07:01
RE: Check SD card errors - by buuuudzik - 29.10.2018, 07:14

Forum Jump: