Technical article 105467

Get "WARNING: Floppy: Write error on dev X/XX, block XX, cmd X, status X" when mkdev fd is run to create a boot floppy.

OpenServer 5.0.0OpenServer 5.0.2

Written · Last revised

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-orig

3. Using your preferred text editor, carefully insert the lines:

sync
sleep 50
at 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 50

5. 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.Z

6. 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.

From the Xinuos technical article database, record 105467. Reproduced with permission. The original is at www.sco.com/ta/105467, which is reachable but blocked from search engines. Xinuos marks this article against a retired product line. That refers to the product’s lifecycle, not to whether the advice still works — plenty of it still applies to running systems.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.