tuds47
Posts: 3
Joined: Wed May 18, 2016 7:38 pm

Readonly file system got error

Wed May 02, 2018 9:11 pm

Hi all :-)
I have a bunch of pi with a read only file system. Now one of the pi is not acting correctly and it seems that there is some change on the sd card content when performing an md5 of the partition. Is it possible that errors can occur on the sd card even if it is readonly? What could cause such errors?
Best regards
Thorbjørn

Paul Hutch
Posts: 527
Joined: Fri Aug 25, 2017 2:58 pm
Location: Blackstone River Valley, MA, USA
Contact: Website

Re: Readonly file system got error

Thu May 03, 2018 12:58 am

I would think that with a read-only file system the most likely cause is a defective/damaged uSd card. Not sure but it seems possible that if there was a read problem detected by the uSD card's internal controller it could try moving data to healthy areas and if power was cut while that was happening it could destroy the card's data.

Try re-formatting the card and running some tests to see if the card's hardware's bad or if it was just corrupted data.

hommar
Posts: 191
Joined: Sat Mar 25, 2017 1:55 pm
Location: Russia, Yekaterinburg

Re: Readonly file system got error

Thu May 03, 2018 6:32 am

http://s.stdns.ru/up/forum/736647_3.pdf
JEDEC Standard No. 218
Page 4

3.19
Retention failure
A data error occurring when the SSD is read after an extended period of time following the previous write.
NOTE
A number of distinct failure mechanisms are responsible for retention failures, and in general these are accelerated in different ways by temperature and other adjustable qualification parameters. For example, in floating-gate memories, failure may occur due to defects that allow charge to leak through the transfer dielectric or by the detrapping of charge in the transfer dielectric; the former can be weakly accelerated or even decelerated by high temperature, and the latter can be highly temperature accelerated (see JEP122). For these reasons, retention may depend on temperature but it is not known a priori whether high temperature is worse than low temperature, or vice-versa.
For examle, some RAIDs rewrite old data on HDDs for protect of demagnetization
SSDs need rewrite old data too.

PS my English is very bad for tell about it

hippy
Posts: 7355
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Readonly file system got error

Thu May 03, 2018 9:25 am

tuds47 wrote:
Wed May 02, 2018 9:11 pm
Is it possible that errors can occur on the sd card even if it is readonly? What could cause such errors?
Being "read only" doesn't mean the card is actually write protected; it is only an indicator that nothing should be written to the card.

It is possible errant software could write to the card and a card can still be instructed to do things at odds with being read only.

On a Pi a user program seems to have full and complete control over GPIO registers and GPIO seems to be what the SD Card connects to. That was the case for earlier Pi but we don't have full schematics for the later and current Pi.

It is not clear what happens if a user program does something which affects GPIO to the SD Card or is at odds with how the OS expects things to be when interacting with the card.

For example; what happens if the OS is sending commands or data to the card and a user program alters GPIO and ends up disabling or messing up the SD card interface during that ? Can that happen ? Is there a mechanism to prevent that happening ? I don't know.

If it can happen it could explain why some people report SD card corruption while others report no problems at all over long periods of time.

Paul Hutch
Posts: 527
Joined: Fri Aug 25, 2017 2:58 pm
Location: Blackstone River Valley, MA, USA
Contact: Website

Re: Readonly file system got error

Thu May 03, 2018 6:23 pm

Thanks hommar for the link to the JEDEC SSD Test Method document.

Now knowing to search on "SD card retention failure" I found some information that may explain the failure at the SD Association web site.
What to Know Before Storing Data on a SD Memory Card
The 5 most critical traits about SD memory cards

https://www.sdcard.org/press/thoughtlea ... _Card.html

In section four Reliability:
The Static Data Refresh firmware algorithm prevents read disturbance by moving data from high-error bits blocks to a healthy one. Moreover, the risk of data retention can be minimized with Dynamic Data Refresh, the sequential background scanning mechanism.
It does appear that a uSD card set to read only will still occasionally get written by the uSD cards microcontroller. So if power fails at just the right time the card could get scrambled.

tuds47
Posts: 3
Joined: Wed May 18, 2016 7:38 pm

Re: Readonly file system got error

Sun May 13, 2018 9:28 pm

Thanks for your suggestions.
I still think it is highly unlikely that an SD card containing readonly partitions will fail due to retention failure, since I hope that the mechanism to move data around will copy the data before the uSD microprocessor will use the new data location... or am I totally off here?
I have tried to copy all data from the SD card and get some random read errors, hence I think that something critical is wrong with the SD card, making this an unavoidable but unlikaly issue :-)

hommar
Posts: 191
Joined: Sat Mar 25, 2017 1:55 pm
Location: Russia, Yekaterinburg

Re: Readonly file system got error

Mon May 14, 2018 6:57 am

tuds47 wrote:
Sun May 13, 2018 9:28 pm
I have tried to copy all data from the SD card and get some random read errors, hence I think that something critical is wrong with the SD card, making this an unavoidable but unlikaly issue :-)
What brand name do you have on your SDcard?

Paul Hutch
Posts: 527
Joined: Fri Aug 25, 2017 2:58 pm
Location: Blackstone River Valley, MA, USA
Contact: Website

Re: Readonly file system got error

Tue May 15, 2018 1:41 pm

tuds47 wrote:
Sun May 13, 2018 9:28 pm
I still think it is highly unlikely that an SD card containing readonly partitions will fail due to retention failure, since I hope that the mechanism to move data around will copy the data before the uSD microprocessor will use the new data location... or am I totally off here?
It appears you missed my point, yes the uSD card's controller is doing the shifting around. The problem is that the power can be cut while this is happening leaving the uSD card in a non-recoverable state..

Return to “Advanced users”