All of lore.kernel.org
 help / color / mirror / Atom feed
* Estimating flash life by reading EC (Erase Counters)
@ 2014-04-21 19:41 David Yat Sin
  2014-04-21 20:48 ` Richard Weinberger
  0 siblings, 1 reply; 3+ messages in thread
From: David Yat Sin @ 2014-04-21 19:41 UTC (permalink / raw)
  To: linux-mtd

Hi,
My goal is to be able to estimate the flash drive life in a production
environment, so if there is a better/easier way of achieving this,
please let me know.

I have a small embedded device using NAND than runs UBIFS for the user
partition. Our application constantly writes to log files, the log
files are appended and gzip'ed, so it is hard to determine how much
data is actually written to disk.

I am hoping to do this by:

1. Read the EC (Erase Count) headers for each page on the partition
2. Let my system run for several days/weeks/months
3. Read the EC headers again
4. Then extrapolate drive life expectancy by comparing number of erase
counts with the NAND endurance.

Is there a utility that I could use to read the Erase Counters on a
UBIFS partition?

Thank you
David

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Estimating flash life by reading EC (Erase Counters)
  2014-04-21 19:41 Estimating flash life by reading EC (Erase Counters) David Yat Sin
@ 2014-04-21 20:48 ` Richard Weinberger
  2014-04-22  7:13   ` Mats Kärrman
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Weinberger @ 2014-04-21 20:48 UTC (permalink / raw)
  To: David Yat Sin; +Cc: linux-mtd

On Mon, Apr 21, 2014 at 9:41 PM, David Yat Sin <jd.yatsin@gmail.com> wrote:
> Hi,
> My goal is to be able to estimate the flash drive life in a production
> environment, so if there is a better/easier way of achieving this,
> please let me know.
>
> I have a small embedded device using NAND than runs UBIFS for the user
> partition. Our application constantly writes to log files, the log
> files are appended and gzip'ed, so it is hard to determine how much
> data is actually written to disk.
>
> I am hoping to do this by:
>
> 1. Read the EC (Erase Count) headers for each page on the partition
> 2. Let my system run for several days/weeks/months
> 3. Read the EC headers again
> 4. Then extrapolate drive life expectancy by comparing number of erase
> counts with the NAND endurance.
>
> Is there a utility that I could use to read the Erase Counters on a
> UBIFS partition?

IIRC ubinfo can tell you the value of the highest EC.

-- 
Thanks,
//richard

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: Estimating flash life by reading EC (Erase Counters)
  2014-04-21 20:48 ` Richard Weinberger
@ 2014-04-22  7:13   ` Mats Kärrman
  0 siblings, 0 replies; 3+ messages in thread
From: Mats Kärrman @ 2014-04-22  7:13 UTC (permalink / raw)
  To: David Yat Sin; +Cc: Richard Weinberger, linux-mtd

On Monday, April 21, 2014 10:48 PM, Richard Weinberger wrote:
> On Mon, Apr 21, 2014 at 9:41 PM, David Yat Sin <jd.yatsin@gmail.com> wrote:
>> Hi,
>> My goal is to be able to estimate the flash drive life in a production
>> environment, so if there is a better/easier way of achieving this,
>> please let me know.
>>
>> I have a small embedded device using NAND than runs UBIFS for the user
>> partition. Our application constantly writes to log files, the log
>> files are appended and gzip'ed, so it is hard to determine how much
>> data is actually written to disk.
>>
>> I am hoping to do this by:
>>
>> 1. Read the EC (Erase Count) headers for each page on the partition
>> 2. Let my system run for several days/weeks/months
>> 3. Read the EC headers again
>> 4. Then extrapolate drive life expectancy by comparing number of erase
>> counts with the NAND endurance.
>>
>> Is there a utility that I could use to read the Erase Counters on a
>> UBIFS partition?
>
>IIRC ubinfo can tell you the value of the highest EC.

Same value can be found using:

cat /sys/class/ubi/ubi0/max_ec

As you probably know, both max and mean value can be found in the kernel message log after a reboot, e.g.:

UBI: max/mean erase counter: 10/7

BR // Mats

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-04-22  7:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-21 19:41 Estimating flash life by reading EC (Erase Counters) David Yat Sin
2014-04-21 20:48 ` Richard Weinberger
2014-04-22  7:13   ` Mats Kärrman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.