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

Joseph Cheek
2008-12-18T04:44:11Z

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
>