Ticket #311 (investigate bug)
Disk space in JFFS filesystem not reclaimed until a reboot
| Reported by: | hans@… | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | fon-base-firmware | Version: | |
| Severity: | unknown | ||
| Cc: | Hardware: | unknown |
Description
I think there is a major bug in the FON OS (maybe in Linux)
When I overwrite a file with cp or mv there will be space taken for the new file, but the space of the old file is not released.
This space will never become available again until a reboot is done. See test underneath.
Start: /dev/mtdblock4 1472 948 524 64% /jffs
Copying test to test1 takes 16 blocks of 1K e.g. 16Kb
After: /dev/mtdblock4 1472 964 508 65% /jffs
Again copying test to test1 e.g. overwriting test1 takes another 16 blocks
After: /dev/mtdblock4 1472 980 492 67% /jffs
Renaming test1 to test e.g. overwriting test will not free the space of test1
After: /dev/mtdblock4 1472 980 492 67% /jffs
So ending with the same files I lost 32Kb disk space. You just have to wait until it will hang or crash.
complete log:
root@Fonera:/www/cam1# ls -l -rw-r--r-- 1 root root 23261 Jul 7 09:38 motion.jpg -rw-r--r-- 1 root root 16208 Jul 7 10:26 test root@Fonera:/www/cam1# df Filesystem 1k-blocks Used Available Use% Mounted on rootfs 4096 4096 0 100% / /dev/root 4096 4096 0 100% /rom tmpfs 14956 340 14616 2% /tmp tmpfs 512 0 512 0% /dev /dev/mtdblock4 1472 948 524 64% /jffs mini_fo:/jffs 4096 4096 0 100% / root@Fonera:/www/cam1# cp test test1 root@Fonera:/www/cam1# df Filesystem 1k-blocks Used Available Use% Mounted on rootfs 4096 4096 0 100% / /dev/root 4096 4096 0 100% /rom tmpfs 14956 340 14616 2% /tmp tmpfs 512 0 512 0% /dev /dev/mtdblock4 1472 964 508 65% /jffs mini_fo:/jffs 4096 4096 0 100% / root@Fonera:/www/cam1# ls motion.jpg test test1 root@Fonera:/www/cam1# cp test test1 root@Fonera:/www/cam1# df Filesystem 1k-blocks Used Available Use% Mounted on rootfs 4096 4096 0 100% / /dev/root 4096 4096 0 100% /rom tmpfs 14956 340 14616 2% /tmp tmpfs 512 0 512 0% /dev /dev/mtdblock4 1472 980 492 67% /jffs mini_fo:/jffs 4096 4096 0 100% / root@Fonera:/www/cam1# ls motion.jpg test test1 root@Fonera:/www/cam1# mv test1 test root@Fonera:/www/cam1# df Filesystem 1k-blocks Used Available Use% Mounted on rootfs 4096 4096 0 100% / /dev/root 4096 4096 0 100% /rom tmpfs 14956 340 14616 2% /tmp tmpfs 512 0 512 0% /dev /dev/mtdblock4 1472 980 492 67% /jffs mini_fo:/jffs 4096 4096 0 100% / root@Fonera:/www/cam1# ls motion.jpg test root@Fonera:/www/cam1#
