[linux-users-list] Data loss on unclean powercycle with JFFS2/NAND

Manu Rao MRao at AlienTechnology.com
Thu Dec 18 13:25:02 EST 2008


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 at lists.infradead.org
[mailto:linux-mtd-bounces at 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 at 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 at 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 at lists.timesys.com
> https://lists.timesys.com/listinfo/linux-users-list
>   

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



More information about the linux-mtd mailing list