public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* Data loss on unclean powercycle with JFFS2/NAND
@ 2008-12-18  0:48 Manu Rao
  2008-12-18  4:43 ` [linux-users-list] " Joseph Cheek
  2008-12-19 17:46 ` Kootsookos, Peter J       UTCFS
  0 siblings, 2 replies; 4+ messages in thread
From: Manu Rao @ 2008-12-18  0:48 UTC (permalink / raw)
  To: linux-mtd, linux-users-list


We have an embedded system with ARM9, running linux 2.6.22 and jffs2 on
Samsung nand.
As part of our bootup process, we modify the /etc/inittab so that the
getty login screen is replaced with our application.

  if sed "/^#*T0/cT0:23:respawn:/sbin/getty -L -n -l /our_app/app ttyS0"
/etc/inittab > /etc/inittab_tmp; then
	mv /etc/inittab_tmp /etc/inittab

We have recently discovered units where the inittab suddenly becomes a
zero-length file. My conjecture was that this had to do with the
write-buffering, and when I add a sync after the move, it helps
somewhat.

The way I understood jffs2, if we have a FileA that is being replaced
with a FileB, we should always have access to either FileA or FileB. But
without any doubt, inittab is getting zeroed out.

How does a move in the Filesystem occur? How can the size become zero?

Any pointers appreciated.

Thanks
Manu Rao
San Jose, CA

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

* Re: [linux-users-list] Data loss on unclean powercycle with JFFS2/NAND
  2008-12-18  0:48 Data loss on unclean powercycle with JFFS2/NAND Manu Rao
@ 2008-12-18  4:43 ` Joseph Cheek
  2008-12-18 18:25   ` Manu Rao
  2008-12-19 17:46 ` Kootsookos, Peter J       UTCFS
  1 sibling, 1 reply; 4+ messages in thread
From: Joseph Cheek @ 2008-12-18  4:43 UTC (permalink / raw)
  To: Linux Users list. Open to all LinuxLink subscribers.
  Cc: linux-mtd@lists.infradead.org

Hi Manu,

I don't know about the JFFS2 issue, but does this sed need to happen
dynamically?  Can you instead just ship the pre-modified inittab?

If not, you could possibly try sed -i (inplace edit) if you are using
sed proper and not busybox sed.  That might shorten the amount of time
in which inittab is in an in-between state.

Thanks!

Joseph Cheek, joseph.cheek@timesys.com
Packaging Technologies Team Lead
TimeSys Corp., www.timesys.com



Manu Rao wrote:
> We have an embedded system with ARM9, running linux 2.6.22 and jffs2 on
> Samsung nand.
> As part of our bootup process, we modify the /etc/inittab so that the
> getty login screen is replaced with our application.
>
>   if sed "/^#*T0/cT0:23:respawn:/sbin/getty -L -n -l /our_app/app ttyS0"
> /etc/inittab > /etc/inittab_tmp; then
> 	mv /etc/inittab_tmp /etc/inittab
>
> We have recently discovered units where the inittab suddenly becomes a
> zero-length file. My conjecture was that this had to do with the
> write-buffering, and when I add a sync after the move, it helps
> somewhat.
>
> The way I understood jffs2, if we have a FileA that is being replaced
> with a FileB, we should always have access to either FileA or FileB. But
> without any doubt, inittab is getting zeroed out.
>
> How does a move in the Filesystem occur? How can the size become zero?
>
> Any pointers appreciated.
>
> Thanks
> Manu Rao
> San Jose, CA
>
> _______________________________________________
> linux-users-list mailing list
> linux-users-list@lists.timesys.com
> https://lists.timesys.com/listinfo/linux-users-list
>   

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

* RE: [linux-users-list] Data loss on unclean powercycle with JFFS2/NAND
  2008-12-18  4:43 ` [linux-users-list] " Joseph Cheek
@ 2008-12-18 18:25   ` Manu Rao
  0 siblings, 0 replies; 4+ messages in thread
From: Manu Rao @ 2008-12-18 18:25 UTC (permalink / raw)
  To: Joseph Cheek,
	Linux Users list. Open to all LinuxLink subscribers.
  Cc: linux-mtd

Joseph:
Thanks for your response.
We sometimes have customers who like to use the serial port for their
own applications. We have made it this way so that customers can switch
it on and off. The replacing of the inittab is done only when the serial
service is turned on.

I will try the inplace edit, but I'm still intrigued by jffs2 behavior.
I'm not sure if its jffs2, mtd/NAND or sed that is to blame. We do have
a different linux based system that does not exhibit this problem, but
its slightly different in that it runs jffs2 on NOR rather than NAND.

Thanks a lot
Manu
PS: Do you know of any other forums that might be able to help?


-----Original Message-----
From: linux-mtd-bounces@lists.infradead.org
[mailto:linux-mtd-bounces@lists.infradead.org] On Behalf Of Joseph Cheek
Sent: Wednesday, December 17, 2008 8:44 PM
To: Linux Users list. Open to all LinuxLink subscribers.
Cc: linux-mtd@lists.infradead.org
Subject: Re: [linux-users-list] Data loss on unclean powercycle with
JFFS2/NAND

Hi Manu,

I don't know about the JFFS2 issue, but does this sed need to happen
dynamically?  Can you instead just ship the pre-modified inittab?

If not, you could possibly try sed -i (inplace edit) if you are using
sed proper and not busybox sed.  That might shorten the amount of time
in which inittab is in an in-between state.

Thanks!

Joseph Cheek, joseph.cheek@timesys.com
Packaging Technologies Team Lead
TimeSys Corp., www.timesys.com



Manu Rao wrote:
> We have an embedded system with ARM9, running linux 2.6.22 and jffs2
on
> Samsung nand.
> As part of our bootup process, we modify the /etc/inittab so that the
> getty login screen is replaced with our application.
>
>   if sed "/^#*T0/cT0:23:respawn:/sbin/getty -L -n -l /our_app/app
ttyS0"
> /etc/inittab > /etc/inittab_tmp; then
> 	mv /etc/inittab_tmp /etc/inittab
>
> We have recently discovered units where the inittab suddenly becomes a
> zero-length file. My conjecture was that this had to do with the
> write-buffering, and when I add a sync after the move, it helps
> somewhat.
>
> The way I understood jffs2, if we have a FileA that is being replaced
> with a FileB, we should always have access to either FileA or FileB.
But
> without any doubt, inittab is getting zeroed out.
>
> How does a move in the Filesystem occur? How can the size become zero?
>
> Any pointers appreciated.
>
> Thanks
> Manu Rao
> San Jose, CA
>
> _______________________________________________
> linux-users-list mailing list
> linux-users-list@lists.timesys.com
> https://lists.timesys.com/listinfo/linux-users-list
>   

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* RE: [linux-users-list] Data loss on unclean powercycle with JFFS2/NAND
  2008-12-18  0:48 Data loss on unclean powercycle with JFFS2/NAND Manu Rao
  2008-12-18  4:43 ` [linux-users-list] " Joseph Cheek
@ 2008-12-19 17:46 ` Kootsookos, Peter J       UTCFS
  1 sibling, 0 replies; 4+ messages in thread
From: Kootsookos, Peter J       UTCFS @ 2008-12-19 17:46 UTC (permalink / raw)
  To: Linux Users list. Open to all LinuxLink subscribers., linux-mtd

Manu,

NAND flash is more perilous than NOR.

Have a look at this:

http://download.micron.com/pdf/presentations/events/flash_mem_summit_jco
oke_inconvenient_truths_nand.pdf

For some good information.

I'm not sure it'll help, but it may give you some ideas about where the
root cause of the problem really lies.

Regards,

Peter K.

Peter J. Kootsookos
Ph: +1-860-284-3236

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

end of thread, other threads:[~2008-12-19 17:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-18  0:48 Data loss on unclean powercycle with JFFS2/NAND Manu Rao
2008-12-18  4:43 ` [linux-users-list] " Joseph Cheek
2008-12-18 18:25   ` Manu Rao
2008-12-19 17:46 ` Kootsookos, Peter J       UTCFS

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox