Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Linux, protecting SD-card file system from power down

Status
Not open for further replies.

std_match

Advanced Member level 4
Joined
Jul 9, 2010
Messages
1,304
Helped
463
Reputation
926
Reaction score
448
Trophy points
1,363
Location
Sweden
Activity points
10,168
I have an embedded linux system with a mounted SD-card.
Normally, only read operations are done, but sometimes a file must be updated.
What is the best way to minimize the risk for a corrupted file system?
Power down can occur at any time.

Here are the two alternatives I'm considering now:

1. The file system is normally mounted "rw" (read/write).
After a write, the "sync" command is executed immediately to flush the buffers and write to the SD-card.

2. The file system is normally mounted "ro" (read only).
Before a write, the file system is remounted as "rw".
After the write, it is remounted again as "ro".

Alternative 1 can probably not be safer than alternative 2, but maybe they are equal?
Are there other alternatives?
 


I always use noatime and have never seen any problem with that.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top