2002-09-19 22:29:22

by Rob van Nieuwkerk

[permalink] [raw]
Subject: ext3 fs: no userspace writes == no disk writes ?

Hi all,

I have a question about ext3 write activity.

I am considering using an ext3 fs on a CompactFlash disk for my
data-logging application (power can disapear anytime).
The quantity & frequency of the data logged itself is not a
problem at all considering flash wear.

But I'm a bit worried about the kernel/ext3 doing regular writes
by itself even when there are no userspace writes. (worries are
partially caused by memories from long time ago about idle laptop
doing regular writes on disk).

Anybody out there who knows how this works ?

Can I use an ext3 fs without having regular "automatic" writes to
the device it is located on ? (and thus not destroy my CompactFlash
devices !)

greetings,
Rob van Nieuwkerk


PS1: of course nothing from userspace should write frequently to
the fs, and if there is regular read-activity the fs should
be mounted with "noatime")

PS2: yes, I know that jffs exists


2002-09-19 22:59:27

by Andrew Morton

[permalink] [raw]
Subject: Re: ext3 fs: no userspace writes == no disk writes ?

Rob van Nieuwkerk wrote:
>
> Hi all,
>
> I have a question about ext3 write activity.
>
> I am considering using an ext3 fs on a CompactFlash disk for my
> data-logging application (power can disapear anytime).
> The quantity & frequency of the data logged itself is not a
> problem at all considering flash wear.
>
> But I'm a bit worried about the kernel/ext3 doing regular writes
> by itself even when there are no userspace writes. (worries are
> partially caused by memories from long time ago about idle laptop
> doing regular writes on disk).

Should be OK - it's a matter of careful monitoring and
tuning of system activity.

There are frequently written areas of an ext3 filesystem - the
journal, the superblock. Those would wear out pretty quickly.

Increasing the commit interval to the maximum acceptable time
would reduce some of this wear and tear.

There seems to be some interest in doing this. Might be helpful
to ask on ext3-users: https://listman.redhat.com/mailman/listinfo/ext3-users

2002-09-19 23:16:16

by Alan

[permalink] [raw]
Subject: Re: ext3 fs: no userspace writes == no disk writes ?

On Fri, 2002-09-20 at 00:04, Andrew Morton wrote:
> There are frequently written areas of an ext3 filesystem - the
> journal, the superblock. Those would wear out pretty quickly.

CF is -supposed- to wear level.

> Increasing the commit interval to the maximum acceptable time
> would reduce some of this wear and tear.

Other one is the usual laptop noatime setting

2002-09-19 23:47:55

by Rob van Nieuwkerk

[permalink] [raw]
Subject: Re: ext3 fs: no userspace writes == no disk writes ?


Hi Alan,

> On Fri, 2002-09-20 at 00:04, Andrew Morton wrote:
> > There are frequently written areas of an ext3 filesystem - the
> > journal, the superblock. Those would wear out pretty quickly.
>
> CF is -supposed- to wear level.

Yes I know.

But I haven't been able to find any specs from any CF manufacturer
about this mechanism, percentage of spare sectors or number of allowed
write-cycles in general. Does it work by writing and than reading it
back and if it's different remapping the sector from a pool of spare
sectors ?

My guess is that it will work OK in a typical CF-in-a-camera situation:
after some thousands of photo's something gets remapped without the
user noticing.

But if you write every few seconds to the same block(s) (journal and/or
superblock, which I was/am afraid of happening with ext3 in my original
question) you'll run out of remap sectors and kill any CF reliably
within a couple of days. Suppose there is a write to a certain sector
every 5 seconds and assume a 100000 allowed writecycles (I read this
number several times in several flashdocs, but not in any CF docs ..).
That results in a lifetime of 5.8 days for this particular sector.
Then it gets remapped. How long you can get away with this depends on
how many "hot" sectors like this you have in your fs and how many spares
are available on your CF. But in the (not so far away) end you *will* kill
your CF I think.

Now if there are NO kernel/ext3 "automatic" writes and your application
has the right behaviour (mine has I think) using ext3 on CF looks like
a nice, easy & stable solution in which killing your CF takes many years :-)

greetings,
Rob van Nieuwkerk

2002-09-20 09:00:47

by Padraig Brady

[permalink] [raw]
Subject: Re: ext3 fs: no userspace writes == no disk writes ?

Rob van Nieuwkerk wrote:
> Hi Alan,
>
>>On Fri, 2002-09-20 at 00:04, Andrew Morton wrote:
>>
>>>There are frequently written areas of an ext3 filesystem - the
>>>journal, the superblock. Those would wear out pretty quickly.
>>
>>CF is -supposed- to wear level.
>
> Yes I know.
>
> But I haven't been able to find any specs from any CF manufacturer
> about this mechanism, percentage of spare sectors or number of allowed
> write-cycles in general.

me either.

Why don't you just mount the fs ro ?

P?draig

2002-09-20 09:04:50

by Rob van Nieuwkerk

[permalink] [raw]
Subject: Re: ext3 fs: no userspace writes == no disk writes ?


Hi P?draig,

P?draig Brady wrote:
> Rob van Nieuwkerk wrote:
> > Hi Alan,
> >
> >>On Fri, 2002-09-20 at 00:04, Andrew Morton wrote:
> >>
> >>>There are frequently written areas of an ext3 filesystem - the
> >>>journal, the superblock. Those would wear out pretty quickly.
> >>
> >>CF is -supposed- to wear level.
> >
> > Yes I know.
> >
> > But I haven't been able to find any specs from any CF manufacturer
> > about this mechanism, percentage of spare sectors or number of allowed
> > write-cycles in general.
>
> me either.
>
> Why don't you just mount the fs ro ?
>
> P?draig

Ehm .., because I need to store data on it ..

greetings,
Rob van Nieuwkerk

2002-09-20 09:10:51

by Padraig Brady

[permalink] [raw]
Subject: Re: ext3 fs: no userspace writes == no disk writes ?

Rob van Nieuwkerk wrote:
> Hi P?draig,
>
> P?draig Brady wrote:
>
>>Rob van Nieuwkerk wrote:
>>
>>>Hi Alan,
>>>
>>>
>>>>On Fri, 2002-09-20 at 00:04, Andrew Morton wrote:
>>>>
>>>>
>>>>>There are frequently written areas of an ext3 filesystem - the
>>>>>journal, the superblock. Those would wear out pretty quickly.
>>>>
>>>>CF is -supposed- to wear level.
>>>
>>>Yes I know.
>>>
>>>But I haven't been able to find any specs from any CF manufacturer
>>>about this mechanism, percentage of spare sectors or number of allowed
>>>write-cycles in general.
>>
>>me either.
>>
>>Why don't you just mount the fs ro ?
>>
>>P?draig
>
>
> Ehm .., because I need to store data on it ..

Ehm, well remount,rw before you store data on it
and remount,ro when finished?

P?draig.

2002-09-20 09:14:54

by Padraig Brady

[permalink] [raw]
Subject: Re: ext3 fs: no userspace writes == no disk writes ?

Padraig Brady wrote:
> Rob van Nieuwkerk wrote:
>
>> Hi P?draig,
>>
>> P?draig Brady wrote:
>>
>>> Rob van Nieuwkerk wrote:
>>>
>>>> Hi Alan,
>>>>
>>>>
>>>>> On Fri, 2002-09-20 at 00:04, Andrew Morton wrote:
>>>>>
>>>>>
>>>>>> There are frequently written areas of an ext3 filesystem - the
>>>>>> journal, the superblock. Those would wear out pretty quickly.
>>>>>
>>>>>
>>>>> CF is -supposed- to wear level.
>>>>
>>>>
>>>> Yes I know.
>>>>
>>>> But I haven't been able to find any specs from any CF manufacturer
>>>> about this mechanism, percentage of spare sectors or number of allowed
>>>> write-cycles in general.
>>>
>>>
>>> me either.
>>>
>>> Why don't you just mount the fs ro ?
>>>
>>> P?draig
>>
>>
>>
>> Ehm .., because I need to store data on it ..
>
>
> Ehm, well remount,rw before you store data on it
> and remount,ro when finished?

Note you can organise things (links from /etc/various /dev/various /var
to ramdisk/tmpfs/...) so that you never have to mount the CF rw.

P?draig.

2002-09-20 09:18:18

by Rob van Nieuwkerk

[permalink] [raw]
Subject: Re: ext3 fs: no userspace writes == no disk writes ?

> Rob van Nieuwkerk wrote:
> > Hi P?draig,
> >
> > P?draig Brady wrote:
> >
> >>Rob van Nieuwkerk wrote:
> >>
> >>>Hi Alan,
> >>>
> >>>
> >>>>On Fri, 2002-09-20 at 00:04, Andrew Morton wrote:
> >>>>
> >>>>
> >>>>>There are frequently written areas of an ext3 filesystem - the
> >>>>>journal, the superblock. Those would wear out pretty quickly.
> >>>>
> >>>>CF is -supposed- to wear level.
> >>>
> >>>Yes I know.
> >>>
> >>>But I haven't been able to find any specs from any CF manufacturer
> >>>about this mechanism, percentage of spare sectors or number of allowed
> >>>write-cycles in general.
> >>
> >>me either.
> >>
> >>Why don't you just mount the fs ro ?
> >>
> >>P?draig
> >
> >
> > Ehm .., because I need to store data on it ..
>
> Ehm, well remount,rw before you store data on it
> and remount,ro when finished?
>
> P?draig.

Will think about it. Wondering how much this would impact performance
(in my application).

greetings,
Rob van Nieuwkerk

2002-09-20 09:21:10

by Rob van Nieuwkerk

[permalink] [raw]
Subject: Re: ext3 fs: no userspace writes == no disk writes ?

> Padraig Brady wrote:
> > Rob van Nieuwkerk wrote:
> >
> >> Hi P?draig,
> >>
> >> P?draig Brady wrote:
> >>
> >>> Rob van Nieuwkerk wrote:
> >>>
> >>>> Hi Alan,
> >>>>
> >>>>
> >>>>> On Fri, 2002-09-20 at 00:04, Andrew Morton wrote:
> >>>>>
> >>>>>
> >>>>>> There are frequently written areas of an ext3 filesystem - the
> >>>>>> journal, the superblock. Those would wear out pretty quickly.
> >>>>>
> >>>>>
> >>>>> CF is -supposed- to wear level.
> >>>>
> >>>>
> >>>> Yes I know.
> >>>>
> >>>> But I haven't been able to find any specs from any CF manufacturer
> >>>> about this mechanism, percentage of spare sectors or number of allowed
> >>>> write-cycles in general.
> >>>
> >>>
> >>> me either.
> >>>
> >>> Why don't you just mount the fs ro ?
> >>>
> >>> P?draig
> >>
> >>
> >>
> >> Ehm .., because I need to store data on it ..
> >
> >
> > Ehm, well remount,rw before you store data on it
> > and remount,ro when finished?
>
> Note you can organise things (links from /etc/various /dev/various /var
> to ramdisk/tmpfs/...) so that you never have to mount the CF rw.

Yes I know. That will happen for the root partition anyway.
The whole discussion is about a dedicated data logging partition/fs
on the CF.

greetings,
Rob van Nieuwkerk

2002-09-20 23:26:51

by Ricardo Galli

[permalink] [raw]
Subject: Re: ext3 fs: no userspace writes == no disk writes ?

> Can I use an ext3 fs without having regular "automatic" writes to
> the device it is located on ? (and thus not destroy my CompactFlash
> devices !)

I was going to write you directly, but I prefered to translate to English a
previous article I had written in Spanish that explain how to save battery
energy in an iBook with ext3. Hope it helps:

http://bulmalug.net/body.phtml?nIdNoticia=1510


--
ricardo galli GPG id C8114D34
A paperless office has about as much a chance as a paperless bathroom