smallfiles revision 1.1
11.1Sperseant#!/bin/sh
21.1Sperseant
31.1Sperseant#
41.1Sperseant# Create a bunch of small files at once, then delete most of them.
51.1Sperseant# This forces live blocks in nearly empty segments.
61.1Sperseant# If the filesystem is small enough, the cleaner will have to run in
71.1Sperseant# order for this to complete.
81.1Sperseant#
91.1Sperseant# Argument is directory in which to run.
101.1Sperseant#
111.1Sperseantfor i in 0 1 2 3 4 5
121.1Sperseantdo
131.1Sperseant	for j in 0 1
141.1Sperseant	do
151.1Sperseant			# Quarter megabyte files, two at a time
161.1Sperseant			# for a maximum of six at once
171.1Sperseant			# (enough to force cleaning on a 2.88 disk)
181.1Sperseant			dd if=/dev/zero of=$1/f$i$j bs=512 count=512 &
191.1Sperseant	done
201.1Sperseant	wait
211.1Sperseant	sync
221.1Sperseant	rm -f $1/f*1
231.1Sperseant	df -k $1
241.1Sperseant	ls -l $1
251.1Sperseantdone
261.1Sperseant
271.1Sperseantecho "Sleeping for 10 seconds...."
281.1Sperseantsleep 10
291.1Sperseant
301.1Sperseantecho "Trying with another half meg"
311.1Sperseantdd if=/dev/zero of=$1/f61 bs=512 count=1024
32