#!/bin/bash # # Copyright 2008 Pavel Machek , GPLv2 # # vfat is broken with filesize=0 # # if [ .$MOUNTOPTS = . ]; then # ext3 is needed, or you need to disable caches using hdparm. # odirsync is needed, else modify fstest.worker to fsync the directory. MOUNTOPTS="-o dirsync" fi if [ .$BDEV = . ]; then # BDEV=/dev/sdb3 BDEV=/dev/nd0 fi export FILESIZE=4000 export NUMFILES=4000 waitforcard() { umount /mnt echo Waiting for card: while ! mount $BDEV $MOUNTOPTS /mnt 2> /dev/null; do echo -n . sleep 1 done # hdparm -W0 $BDEV echo } mkdir delme.fstest cd delme.fstest waitforcard rm tmp.* final.* /mnt/tmp.* /mnt/final.* while true; do ../fstest.work echo waitforcard echo Testing: fsck.... umount /mnt fsck -fy $BDEV echo Testing.... waitforcard for A in final.*; do echo -n $A " " cmp $A /mnt/$A || exit done echo done