[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: waste space with jffs2 ?



JFFS2 (and JFFS) keep some amount (lets say N) of free erase blocks for
system space to handle the Wear Leveling (WL) and Garbage Collection
(GC). This should amount to like 5 erase blocks, but might be set higher
at present. This means that:

a) the free space reported is all ways N blocks less that the actual
free.

b) when a filesystem gets full so that there are only N free blocks, the
system reports 0 free.

c) if a jffs2 image in copied into the MTD device that fills some (or
all) of the required free blocks the filesystem with effectively be
read-only as the write routines will not have the free blocks to
manipulate.

We can see my deduction that you can build and install a .jffs2 image
that has more data than you can write to a given mounted jffs2 MTD
partition.

This is a required effect of maintaining reliability.

Now perhaps David would like to comment on current and expected future
size of N ?

dennis noermann wrote:
> 
> Hi all
> 
> is it normal that a jffs2 filsystem wastes so much space ?
> 
> I created a 1024 kb mtd partition on my 8 Mb Flash memmory
> then
> 
> /eraseall /dev/mtd/2
> Erased 1024 Kibyte @xxxxxxx.
> 
> mount -t jffs2 /dev/mtdblock/2 /mnt
> 
> then df shows
> 
> Filesystem           1k-blocks      Used Available Use% Mounted on
> /dev/mtdblock/2           1024       644       380  63% /mnt
> 
> this i can reproduse always
> i though that df is not working whell and tested so i tried to copy some
> files into
> 
> uncompressed they were 744 kb , so normal it shuld fixx in a 1024 kb
> but after ca 500 kb i got No space left on device
> so compression worked , the 644 kb wasted for nothing after cration are
> wasted realy :(
> 
> so then i tried to make a jffs2 immage of my 744kb with mkfs.jffs2
> mkfs.jffs2 --root=/LinuxPPC/test/ -e 0x20000 -o test2.jffs2 -b -p
> 
> the immage was 640k , ok
> 
> eraseall /dev/mtd/2
> Erased 1024 Kibyte @xxxxxxx.
> cp /test2.jffs2 /dev/mtd/2
> mount /dev/mtdblock/2 /mnt
> 
> then a df shows
> Filesystem           1k-blocks      Used Available Use% Mounted on
> /dev/mtdblock/2           1024      1024         0 100% /mnt
> 
> i copyed all files out there , and all files were ok
> 
> i tried to copy 1 file into it  ==> No space left on device
> i tried to delete 1 file in in  ==> No space left on device
> 
> so something is very wrong i thnik :(
> any ideas ?
> 
> i am using kernel 2.4.2 with mtdcvs from 23.08.2001
> the erasesize i am using is the same, that  the mtd driver reports
> 
> dennis
> 
> To unsubscribe from this list: send the line "unsubscribe jffs-dev" in
> the body of a message to majordomo@xxxxxxx.com

-- 
Tim Riker - http://rikers.org/ - short SIGs! <g>
All I need to know I could have learned in Kindergarten
... if I'd just been paying attention.

To unsubscribe from this list: send the line "unsubscribe jffs-dev" in
the body of a message to majordomo@xxxxxxx.com