From: "Marcin Adamski" <mass85@tlen.pl>
To: linux-mtd@lists.infradead.org
Subject: File in JFFS2 corrupted after power loss during removal of other files
Date: Mon, 04 May 2015 14:42:52 +0200 [thread overview]
Message-ID: <553983c4.1e577cd2.5547694c.c00cd@tlen.pl> (raw)
Hi
I am working with Linux (3.4.31+) embedded system booting from JFFS2 partition. I frequently encounter a problem of a file corruption when power loss occurs while other files are being removed. It happens during upgrade procedure of the platform. These are simplified steps of the upgrade:
1. Download tar.gz containing (among other files) rootfs.squashfs image of file system that I am upgrading to, verify md5 checksum of the image.
2. Boot linux from a small JFFS2 partition that has a minimal set of tools required to perform upgrade.
3. Mount the large partition that must be upgraded.
4. Mount rootfs.squashfs which is stored in the big partition.
5. Remove all files from the large partition except from some migrated data files, the rootfs.squashfs image etc.
6. Copy all files from mounted rootfs.squashfs to the large partition
7. Boot from the large partition
The mentioned power loss occurs in 5. step. Note that the rootfs.squashfs is mounted as read only and is never altered during upgrade. Even though this file gets corrupted and after device is powered on you can see that the file's md5 checksum is different, size stays unchanged, image can be mounted but it is impossible to read some of the files from this image.
Shouldn't JFFS2 deal with this kind of scenario? Is there any way to recover from this situation?
Regards
Marcin Adamski
next reply other threads:[~2015-05-04 12:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-04 12:42 Marcin Adamski [this message]
2015-05-05 14:35 ` File in JFFS2 corrupted after power loss during removal of other files Richard Weinberger
2015-05-05 15:12 ` Marcin Adamski
2015-05-05 15:44 ` Richard Weinberger
2015-05-05 16:51 ` File in JFFS2 corrupted after power loss during removal of otherfiles Marcin Adamski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=553983c4.1e577cd2.5547694c.c00cd@tlen.pl \
--to=mass85@tlen.pl \
--cc=linux-mtd@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox