◄ 
▲ 
► |
|
# Do a low-level disk check.
badblocks -n -s /dev/fd0
if [ $? != 0 ]; then
echo "Your floppy is bad!"
exit
fi
echo "Formatting floppy..."
mformat a:
# Delete old loopback file system if it exists
if [ -e fs ]; then
echo "Deleting old loopback file system"
rm -rf fs
fi
if [ -e filesys ]; then
echo "Deleting old compressed file system"
rm -f filesys
fi
# Create mount point
echo "Creating 'tempfs' temporary mount point folder"
rm -r tempfs 2> /dev/null
mkdir tempfs
I use "badblocks" to test the disk before I'm commited to using it. The "-n" option does a non-destructive read/write test. Use the "-w" option to do a destructive test. You could also use the "fdformat" command to format and test the disk. Once the disk is known good, I use the "mformat" command to put a FAT file system on the floppy. This is equivalent to a DOS "quick format". The "mformat" command is part of the "mtools" utilities which makes DOS commands that run on Linux. That's why you see the mformat command referring to drive "a:". For those who love DOS, it's just like home.