0

why jffs2 shows always 388KB as used space, through "df" command?

I am having two mtd partitions, one of 640KB and another 1024KB. After erasing total flash, it shows 388KB as used space for both the cases always.

Please help me, why it shows this type of behavior?

2 Answers2

1

My hunch is that JFFS2 requires 388KB for journalling. Just for comparison, I made a 640KB file and tried to build an ext3 filesystem on it:

$ dd if=/dev/zero of=testFS bs=1k count=640
640+0 records in
640+0 records out
655360 bytes (655 kB) copied, 0.00244463 s, 268 MB/s
$ mkfs.ext3 testFS
mke2fs 1.42 (29-Nov-2011)
testFS is not a block special device.
Proceed anyway? (y,n) y
...
Filesystem too small for a journal
Writing superblocks and filesystem accounting information: done

As no journal was added, the filesystem was effectively ext2.

$ sudo mount testFS /mnt
$ mount
/home/user/testFS on /mnt type ext2 (rw)
$ df --si
/dev/loop1      640k   17k  591k   3% /mnt

I will edit this when I find out how to create and mount a JFFS2 partition. Do you really need a journal for a 640KB filesystem?

icedwater
  • 4,701
  • 3
  • 35
  • 50
  • I am using a 16MB NOR flash device, where we have few partitions, out of which 2 partitions we made as JFFS2 filesystems, one is used for private(640KB, configuration) and other for user(1024KB, for uploading files). Actually I too not sure why we have selected JFFS2 filesystem,is there any other way to retrieve that 388KB used space? – user2114700 Jun 04 '13 at 07:04
  • I am not very familiar with JFFS2, in fact I had to Google it - I guess it is best used on larger partitions where the journal is not going to take up a large chunk of space. – icedwater Jun 04 '13 at 08:18
1

JFFS2 need at least 3 erase block (128kB typically) for journalling.

ChristiaN
  • 21
  • 4