[comp.sys.tandy] Faster Floppies

michael@stb.UUCP (Michael) (04/30/88)

I did some experimentation with the floppies, and found some very interesting
results.

All times are with verify off. This is on a model 16, 6000 results may vary.

Diskutil can read a disk in 77 seconds (1:15).
Diskutil can write a disk in 77 seconds (1:15).
The best I can get in unix is 2:30 for both (1/2 the speed)
The raw disk takes ***7 MINUTES***
Using a filesystem interleave of 2 16 (the recommended) gives 2 minutes to
read, 6 minutes to write (!!!)
Using a filesystem interleave of 4 16 gives 2:30 for both.

Aparently diskutil uses the worst case interleave--perfect for stand alone
programs like itself, but under xenix the sector has just passed the head.

This shell script takes it standard input, and writes it to the named file
on a floppy, or on several floppies (such as tar | floppydump). It
does its own verify (faster than xenix's), and handles all the details of
floppy formatting. It is a CSH script, not a sh script. One known bug:
it tries to umount an unmounted floppy at the beginning. This is harmless.

Question: Does anyone know how to change diskutil's floppy interleave?
Does anyone know why the 2 16 filesystem has such a big difference between
read speed and write speed? Has anyone checked to see what the best interleave
for the hard disks are?

			Michael

: shar time
# this is for some unshar's
cat > floppydump << \EOF_floppydump
# Use csh
#Program to dump a standard input to floppies.
#Assumptions: Being used interactively
#		Dump to floppy 1, (Dsdd, 2448 blocks)
#		/etc/verify is turned off for floppies (do our own verify)
#		floppies need to be mkfs'd
#		Have about 2500 blocks in /tmp for temp files
set TEMP=/usr/spool/news/Floppy # This is a seperate filesystem for me; your
				# milage may vary

set time=3	#time the disk copy commands
if ( $#argv == 0 ) then
	echo Using \"DiskDump\" as the file name.
	set argv=($argv DiskDump)
endif
@ i = 1;
loop:
echo > $TEMP.$$
echo Saving to temp
# ### XENIX BUG--Pipes don't read() correctly
# nice +40 dd bs=512x2 of=$TEMP.$$ count=1168  # Fill the disk (almost)
nice +40 dd bs=512 of=$TEMP.$$ count=2336  # Fill the disk (almost)
# Don't outrun the people feeding us data!

if ( -z $TEMP.$$) then
done:
	rm $TEMP.$$
	myumount /dev/fd1		#myumount = setuid (/etc/umount)
	exit $status
endif
retry:
myumount /dev/fd1		#myumount = setuid (/etc/umount)
echo "Press enter when disk mounted in drive 1" \\c
gets < /dev/tty > /dev/null
/etc/mkfs /dev/fd1 2448 4 16 < /dev/tty
if ( $status != 0) then
	echo "Mkfs failed, will try again."
	goto retry
endif
mymount /dev/fd1 /mnt		#mymount = setuid (/etc/mount)
echo Writting
if ( { dd if=$TEMP.$$ of=/mnt/$i.$1 bs=512x8 }  == 0) then
	echo Output failed. Remove old disk.
	goto retry
endif
echo Verifying
if ( { dd if=/mnt/$i.$1 of=/dev/null bs=512x16 } == 0) then
	echo Verify failed, will try again.
	goto retry
endif
@ i++
goto loop
EOF_floppydump
exit 0
-- 
: Michael Gersten          uunet.uu.net!ucla-an.ANES\ 
:				 ihnp4!hermix!ucla-an!denwa!stb!michael
:				sdcsvax!crash!gryphon!denwa!stb!michael
: "This signature is too tame; anyone got some gasoline? "