zmatt icon

fatfs directory fragmentation

zmatt | PRO | 05/29/20 10:13:28 PM UTC | 0 ⭐ | 403 👁️ | Never ⏰ | []
text |

1.23 KB

|

None

|

0 👍

/

0 👎

# we're in an empty directory on a fat32 filesystem
root:.../tmp/foo# ls
 # create some bad fragmentation
root:.../tmp/foo# x234=$(perl -e 'print "x" x 234')
root:.../tmp/foo# for i in {0000..3119}; do touch $x234$i $i; done
root:.../tmp/foo# rm $x234*
 # only 3122 (including . and ..) out of 65536 entries used:
root:.../tmp/foo# ls
0000  0223  0446  0669  0892  1115  1338  1561  1784  2007  2230  2453  2676  2899
0001  0224  0447  0670  0893  1116  1339  1562  1785  2008  2231  2454  2677  2900
(...yada yada...)
0220  0443  0666  0889  1112  1335  1558  1781  2004  2227  2450  2673  2896  3119
0221  0444  0667  0890  1113  1336  1559  1782  2005  2228  2451  2674  2897
0222  0445  0668  0891  1114  1337  1560  1783  2006  2229  2452  2675  2898
 # hence plenty of space left in directory:
root:.../tmp/foo# touch tmp{000..999}
root:.../tmp/foo# rm tmp*
 # but not contiguous:
root:.../tmp/foo# touch $(perl -e 'print "x" x 250')
touch: cannot touch 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx': No space left on device

Comments