Flash filesystem spare block

Can someone explain to me what role does a spare block play in a
filesystem. I have a peculiar problem with my flash file system and it may
be a buggy driver.

If I don’t specify a spare block and set my partition size to 192K, I am
unable to perform subsequent writes to this partition once I try to copy a
file greater than 192K. I can write as long as I never attempt to copy a
file greater than 192K.

My block size for this parition is 64K (three blocks in partition). The
only way I can make use of this parition after a write failure is to
unmount, erase, format, and remount.

Once I add one spare block, the available partition size goes down to 128K
(and I expect this to happen) however, I never have the problem of failing
on subsequent writes even after attempting to copy files greater than 128K.

Do I always need to use a spare block ?

Thanks

  • Murtaza

“Murtaza Amiji” <Murtaza_Amiji@nmss.com> wrote in message
news:ac0vhm$k3b$1@inn.qnx.com

Can someone explain to me what role does a spare block play in a
filesystem. I have a peculiar problem with my flash file system and it
may
be a buggy driver.

If I don’t specify a spare block and set my partition size to 192K, I am
unable to perform subsequent writes to this partition once I try to copy a
file greater than 192K. I can write as long as I never attempt to copy a
file greater than 192K.

My block size for this parition is 64K (three blocks in partition). The
only way I can make use of this parition after a write failure is to
unmount, erase, format, and remount.

Once I add one spare block, the available partition size goes down to 128K
(and I expect this to happen) however, I never have the problem of failing
on subsequent writes even after attempting to copy files greater than
128K.

Do I always need to use a spare block ?

Yes. Erase granularity is 64K hence if the driver tries to recover the
space
of a delete file it needs to put the valide data of that sector somewhere
else.
That’s what the spare block is for.

Thanks

  • Murtaza