1 1.1 perseant #!/bin/sh 2 1.1 perseant 3 1.1 perseant # 4 1.1 perseant # Create a bunch of small files at once, then delete most of them. 5 1.1 perseant # This forces live blocks in nearly empty segments. 6 1.1 perseant # If the filesystem is small enough, the cleaner will have to run in 7 1.1 perseant # order for this to complete. 8 1.1 perseant # 9 1.1 perseant # Argument is directory in which to run. 10 1.1 perseant # 11 1.1 perseant for i in 0 1 2 3 4 5 12 1.1 perseant do 13 1.1 perseant for j in 0 1 14 1.1 perseant do 15 1.1 perseant # Quarter megabyte files, two at a time 16 1.1 perseant # for a maximum of six at once 17 1.1 perseant # (enough to force cleaning on a 2.88 disk) 18 1.1 perseant dd if=/dev/zero of=$1/f$i$j bs=512 count=512 & 19 1.1 perseant done 20 1.1 perseant wait 21 1.1 perseant sync 22 1.1 perseant rm -f $1/f*1 23 1.1 perseant df -k $1 24 1.1 perseant ls -l $1 25 1.1 perseant done 26 1.1 perseant 27 1.1 perseant echo "Sleeping for 10 seconds...." 28 1.1 perseant sleep 10 29 1.1 perseant 30 1.1 perseant echo "Trying with another half meg" 31 1.1 perseant dd if=/dev/zero of=$1/f61 bs=512 count=1024 32