Patrick Welche <prlw1@cam.ac.uk>
[netbsd-mini2440.git] / regress / sys / fs / lfs / newfs_fsck / smallfiles
blob1ca4c4acea90425c013eaf415d1d5415231783f7
1 #!/bin/sh
4 # Create a bunch of small files at once, then delete half of them.
5 # The file size is less than the segment size.
6 # This forces live blocks in half-empty segments.
7 # If the filesystem is small enough, the cleaner will have to run in
8 # order for this to complete.
10 # Argument is directory in which to run.
12 echo -n "making small files: "
13 for i in 0 1 2 3 4 5 6 7 8 9 a b c d e f
15 echo -n "$i "
16 for j in 0 1
18 dd if=/dev/zero of=$1/f$i$j bs=65536 count=1 >/dev/null 2>&1
19 done
20 sync
21 rm -f $1/f*1
22 done
23 echo "done."
25 echo "Sleeping for 10 seconds...."
26 sleep 10
28 echo "Trying with another half meg; expect 'no space on device'"
29 dd if=/dev/zero of=$1/f61 bs=512 count=1024 >/dev/null || true
30 sync
31 df -h $1