/dev/ida - sfdisk: BAD INPUT - RESOLUTION

justin jtyme at kuhalabs.com
Fri Feb 8 07:58:52 CET 2002


Ok, here's a little information about how to fix the Bad Input error from
sfdisk that happens when setup_harddisks is trying to operate on /dev/ida
partitions.

The reason that sfdisk complains about BAD INPUT is because
setup_harddisks is not creating the necessary empty partitions(2) and is
erroring out.  The reason this is happening is due to a regular expression
not matching the correct information in:

function: PartitionPersfdisk

the following is what is used to create the Empty partitions:

---------------

        foreach $mountpoint(split(/\s/,$DiskMountpoints{$disk})) {
            $part = $MountpointPart{$mountpoint};
            $part =~ /.*\/.*p(\d+)/;
            print "Matched: $MountpointPart{$mountpoint} : $1\n";
            ($1 < 5) && ($PrimaryNo++);
            if ( ($1 == 5) && ($PrimaryNo < 5) ){
                for $number($PrimaryNo..4) {
                    $sfdiskTables{$disk} .= BuildsfdiskDumpLine(PartName($disk,$number),0,0,0)."\n";
                }
            }
            $line = BuildsfdiskDumpLine($MountpointPart{$mountpoint},$MPStart{$mountpoint},$MPSize{$mountpoint},$MPID{$mountpoint});
            ($part eq $BootPartition) && ($line .= ", bootable");
            $sfdiskTables{$disk} .= "$line\n";
        }

---------------

This is slightly different then the latest version of setup_harddisks.  I
changed the line:

$part =~ /.*\/.*p(\d+)/;  ( this now matches ida/c*d*p* )

previously it was:

$part =~ /(\d+)/;  ( in the case of ida/c0d0p*, this would incorrectly
                     match 0 always and not match the p value, which it
                     should be doing )

The Regex that I give as a replacement is a hacked up fix which is fine
for me as all my install clients are using cpqarray (/dev/ida convention)
however I'll leave it up to Thomas to integrate this into something
official.

-justin



More information about the linux-fai mailing list