Skip to content

Recover deleted media from YAFFS2, JFFS2 and UBIFS volumes - #197

Merged
abrignoni merged 1 commit into
mainfrom
feat/flash-deleted-recovery
Sep 26, 2026
Merged

abrignoni merged 1 commit into
mainfrom
feat/flash-deleted-recovery

Conversation

@abrignoni

Copy link
Copy Markdown
Owner

Recovers deleted media from YAFFS2, JFFS2 and UBIFS volumes, through qnxprobe 1.36's recover_deleted().

  • Deleted-media recovery now covers flash volumes as well as NTFS, FAT32 and exFAT. A recovered file is named the way a walk names a live one (<volume>/<folder>/<name>) and keeps its Unix modified time as an instant.
  • Staged names include the object id or inode number and a count, because YAFFS reuses object ids and one id and name can belong to several deleted files.
  • Files qnxprobe refuses (some pages erased) are not registered.
  • A YAFFS2 file, and a JFFS2 file on flash with no spare bytes, hands the carve its offset, so no nameless twin is added.
  • New tests/test_flash_deleted.py builds a JFFS2 volume (live picture, deleted picture with NOR-obsolete nodes, deleted text file, partly erased deleted picture). The old code fails 3 of its 7 tests, and four mutants (no count, no carve offset, no modified time, bare name) each fail one.
  • The manual, in-app help, carve tooltip and CLI message list the flash filesystems.

On the DFRWS 2011 Case 2 /data dump (a real Android YAFFS2 NAND dump), 34 deleted media files come back (25 images, 9 zips), each byte-identical to qnxprobe's reading of the same file.

🤖 Generated with Claude Code

recover_deleted() now reaches flash volumes as well as NTFS, FAT32 and
exFAT, through qnxprobe 1.36's recover_deleted(). A recovered flash file
is named the way a walk names a live one ("<volume>/<folder>/<name>"),
keeps its Unix modified time as an instant, and is staged under a name
keyed by its object id or inode number and a count, because YAFFS reuses
object ids and one id and name can belong to several deleted files. A
file qnxprobe refuses because some of its pages were erased is not
registered.

A YAFFS2 file, and a JFFS2 file on flash with no spare bytes, hands the
carve the offset of its first byte, so a carve alongside does not add a
nameless twin. UBIFS and JFFS2 on NAND place data through a mapped or
spare-stripped view, so their files add no offset.

tests/test_flash_deleted.py builds a JFFS2 volume with a live picture, a
deleted picture whose nodes are marked obsolete as NOR flash marks them,
a deleted text file and a deleted picture with part of its data gone.
The manual, the in-app help, the carve option's tooltip and the CLI
message list the flash filesystems.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@abrignoni
abrignoni merged commit 2c9321d into main Sep 26, 2026
8 checks passed
@abrignoni
abrignoni deleted the feat/flash-deleted-recovery branch September 26, 2026 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant