Format:JFFS2
| Magic | 85 19 (little) or 19 85 (big) node magic |
|---|---|
| Extensions | .jffs2 |
| Endianness | either (target endianness) |
| License | GPL-2.0 (Linux) |
| On this wiki | Facts · Code · Notes · Topics |
Log-structured NOR/NAND flash filesystem of embedded Linux: a stream of nodes starting with magic 0x1985 (85 19 or 19 85 by endianness), types DIRENT/INODE/CLEANMARKER, compressed with zlib, LZO or rtime.
Node header (12 bytes)
magic u16 0x1985, nodetype u16, totlen u32, hdr_crc u32. There is no superblock: the flash is a sequence of nodes, each aligned to 4 bytes, and the erase blocks are filled with 0xFF when free. On a little-endian target the bytes are 85 19; a big-endian image shows 19 85. Scan for either to find and determine endianness.
Node types
| Value | Name |
|---|---|
| 0xE001 | DIRENT (name to inode link) |
| 0xE002 | INODE (data chunk with mode, uid, gid, offset, compression) |
| 0x2003 | CLEANMARKER (written to an erased block) |
| 0x2004 | PADDING |
| 0x2006 | SUMMARY |
| 0xE008 | XATTR |
| 0xE009 | XREF |
The top bits are feature flags: 0xC000 incompat, 0x8000 rocompat, 0x4000 rwcompat-copy, 0x2000 node accurate.
Compression ids (in the INODE node)
0 none, 1 zero, 2 rtime, 3 rubinmips, 4 copy, 5 dynrubin, 6 zlib, 7 lzo (see Library:LZO).
Analyst notes
Newer nodes supersede older ones (version number inside INODE/DIRENT), so extractors such as jefferson replay the log and keep the latest. Erase-block size (commonly 64 KiB or 128 KiB) matters for carving. Appears in OpenWrt and consumer router images as the writable overlay next to a Format:SquashFS root. See also Format:UBI and UBIFS for NAND.
Source: Linux include/uapi/linux/jffs2.h.