Matthew Flanagan
2007-Dec-04 02:50 UTC
[zfs-discuss] /usr/sbin/install.d/chkprobe - awk: division by zero with zfs disks
Hi,
I have a system that had Solaris 10 8/07 previously installed with disks c0t0d0
and c0t1d0 mirrored using SVM and c0t2d0 and c0t3d0 added as whole disks to a
zpool.
When attempting to reinstall the OS via jumpstart the following error is output:
...
Using rules.ok from jumpstart:/js.
Checking rules.ok file...
awk: division by zero
record number 15
awk: division by zero
record number 15
awk: division by zero
record number 15
...
The rules file used is:
probe osname
probe memsize
probe hostaddress
probe hostname
probe disks
probe rootdisk
probe karch
any - Begin/begin = Drivers/driver
With a little investigation I''ve managed to track this problem down to
the get_diskinfo() function in /usr/sbin/install.d/chkprobe where it tries to
parse the output from prtvtoc. Lines 221 and 230 are where the problem lies.
The output from prtvtoc for a non-ZFS disk looks like:
* /dev/rdsk/c0t0d0s0 partition map
*
* Dimensions:
* 512 bytes/sector
* 848 sectors/track
* 24 tracks/cylinder
* 20352 sectors/cylinder
* 14089 cylinders
* 14087 accessible cylinders
*
* Flags:
* 1: unmountable
* 10: read-only
*
* First Sector Last
* Partition Tag Flags Sector Count Sector Mount Directory
0 2 00 16525824 12597888 29123711
1 3 01 0 16525824 16525823
2 5 00 0 286698624 286698623
3 7 00 29123712 8405376 37529087
6 0 00 37529088 249128832 286657919
7 0 00 286657920 40704 286698623
For a ZFS disk it looks like:
* /dev/rdsk/c0t2d0s0 partition map
*
* Dimensions:
* 512 bytes/sector
* 286739329 sectors
* 286739262 accessible sectors
*
* Flags:
* 1: unmountable
* 10: read-only
*
* First Sector Last
* Partition Tag Flags Sector Count Sector Mount Directory
0 4 00 34 286722878 286722911
8 11 00 286722912 16384 286739295
When you compare the ZFS VTOC to the non-ZFS VTOC you can see the ZFS disk is
missing the "cylinders" line in the "Dimensions" section.
This causes the "awk: division by zero" on line 230 of chkprobe.
While this is not causing the installation to fail in this case because the
installer chooses c0t0d0s0 as the new rootdisk, it would if the ZFS disk was
moved to HD slot 0 in the chassis.
I''ve looked at patch 124630-14 but it has the same problem. Is this a
known bug? is there a work-around or fix?
thanks
matthew
--
Matthew Flanagan
http://wadofstuff.blogspot.com
This message posted from opensolaris.org