Frequent Writes to NAND flash with UBIFS in sychronous mode

Ricard Wanderlof ricard.wanderlof at axis.com
Fri Nov 9 04:10:24 EST 2012


On Thu, 8 Nov 2012, Joe wrote:

> Hi,
> I have the following observation when UBIFS is mounted as synchronous fs. (-o
> sync option from bootargs).
>
> 1. For every file read, there are writes  to nand flash.
> 2. For the execution of every command, there are writes to nand flash.
> For ex. On execution of any command, say 'cd' or 'ls' i observe quiet a few
> writes happening to NAND flash.

I'm no expert but I could imagine two reasons, one, that there are cached 
writes which are being performed shortly after your read operations.

Two, it could be that the UBI scrub functionality is (erroneously) 
detecting that the data needs to be rewritten and consequently does a 
rewrite whenever something is read.

Does this only happen in synchronous mode?

In general reading should not cause anything to be written. In fact, you 
can mount a static UBI volume as a file system (which cannot be rewritten 
on a block basis, only on a volume basis) which wouldn't be possible if 
there were writes being performed. (In all honesty, I haven't tried using 
-o sync when doing this though).

/Ricard
-- 
Ricard Wolf Wanderlöf                           ricardw(at)axis.com
Axis Communications AB, Lund, Sweden            www.axis.com
Phone +46 46 272 2016                           Fax +46 46 13 61 30



More information about the linux-mtd mailing list