Problem
When I run 'mkdev fd' in order to create an emergency boot floppy, the utility seems to create the boot floppy, but returns the error message:
WARNING: Floppy: Write error on dev X/X, block XX, cmd X, status XX
while copying files to the floppy and compressing the kernel.
The utility seems to verify the boot floppy, but if I attempt to boot the system with this floppy it is corrupt and does not boot.
The root filesystem floppy can be created without problems and the floppy drive is known to be working.
Cause
The problem has been seen to occur on systems where the root disk and the floppy drive are controlled by the same SCSI host adapter.
Solution
One way to work around this problem is to modify the /usr/lib/mkdev/fd script so that it eliminates any possible timing problems. Take these steps:
1. Log in to the system as root.
2. Copy the file /usr/lib/mkdev/fd to a backup file name, for example:
cp /usr/lib/mkdev/fd /usr/lib/mkdev/fd-orig3. Using your preferred text editor, carefully insert the lines:
sync
sleep 50at the four places in the /usr/lib/mkdev/fd script as shown below.
'>>' signs are used to indicate where the new lines should be
inserted. The '>>' signs should not be entered.4. Add the lines to the mkfilesys() routine, so that it becomes:
# mkfilesys creates a filesystem
mkfilesys() {
mkfs -y $fstype $rdev $1 > $tmp 2>&1 || {
mv $tmp /tmp/FD.log
echo "$0 $ERR1"
cleanup $FAIL>> sync
>> sleep 505. Add the lines at two places in the mkboot() routine, so that it becomes:
# install the boot block
instbb $fstype ${tpi}ds${spt} $rdev > $tmp 2>&1 || {
mv $tmp /tmp/FD.log
echo "$0 $ERR3"
return $FAIL>> sync
>> sleep 50
if [ "$boot_type" = "sys" ]
then
# check that we have enough space to copy /unix
# onto the boot floppy
if mount $fstype -o nolog $dev /mnt > $tmp 2>&1
then
cp $BOOTROOT/boot /mnt || cleanup $FAIL
>> sync
>> sleep 50
rm -f /tmp/unix.boot
rm -f /tmp/unix.boot.Z6. Finally, add the lines to the mkboot() routine, so that it becomes:
# build a generic kernel
if mount $fstype -o nolog $dev /mnt > $tmp 2>&1
then
nospace=0
cp $BOOTROOT/boot /mnt || cleanup $FAIL
cp $BOOTROOT/link /mnt # For btld
>> sync
>> sleep 50
echo "\n$MSG31"7. Now save the file.NOTES: This workaround will cause the mkdev fd script to run more slowly,
but it should solve the problem.An alternative workaround is to use a dedicated floppy drive controller.