Technical article 105305

VDM reports the error "/dev/dsk/0sa is the active partition and cannot be used."

OpenServer 5.0.2OpenServer 5.0.4OpenServer 5.0.5

Written · Last revised

Problem

I am attempting to mirror the boot, root and swap divisions of
my SCO OpenServer Release 5.0.2 partition using the Virtual Disk
Manager (VDM).  However, it reports the errors:

cannot create vdisk1 cannot add vdisk 'vdisk1' dkconfig:/dev/dsk/vdisk1: /dev/dsk/0sa is the active partition and cannot be used

The root disk drive has multiple partitions. Using a variety of partition configurations on the second drive does not affect this problem.

Cause

VDM will fail in this way if the active partition is not the first partition as shown by the command "fdisk -p".

In the file /opt/K/SCO/Unix/5.0.2Dp/sa/vdisk/vdiskAPI.tlib, the function GetActivePartition() should return the active partition number, for example:

proc GetActivePartition {disk} {
        ...
        ...
        foreach partition $fdisk1 {
                set active...
                if {$active == "Active...
                        return...
                } else {
                        ErrorPush...
                }
        }
}

However, this function will fail if the active partition is not the first partition.

This failure is due to invalid error reporting. The format of the ErrorPush is incorrect, causing the foreach loop to break if the active partition is not the first partition.

Solution

To work around this, install the SCO partition to ensure that it will be the first partition listed by fdisk(ADM).

Another workaround would be to remove the ErrorPush call from the vdiskAPI.tlib file, for example:

proc GetActivePartition {disk} {
        ...
        ...
        foreach partition $fdisk1 {
                set active...
                if {$active == "Active...
                        return...
                }
        }
}
NOTE:     The vdiskAPI.tlib file is found in the path:
/opt/K/SCO/VDISK/1.1.1Eb/sa/vdisk/vdiskAPI.tlib
in SCO OpenServer 5.0.5.  To enable mirroring, it should be
edited in the same manner as described above, for the earlier
releases. The "else" loop containing ErrorPush must be removed.

From the Xinuos technical article database, record 105305. Reproduced with permission. The original is at www.sco.com/ta/105305, 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.