Error seen when attempting to encapsulate when a disk is "auto:ZFS"
# vxdiskadm (2)
Encapsulate one or more disks
Menu: VolumeManager/Disk/Encapsulate
Use this operation to convert one or more disks to use the Volume Manager.
This adds the disks to a disk group and replaces existing partitions
with volumes. Disk encapsulation requires a reboot for the changes
to take effect.
More than one disk or pattern may be entered at the prompt. Here are
some disk selection examples:
all: all disks
c3 c4t2: all disks on both controller 3 and controller 4, target 2
c3t4d2: a single disk (in the c#t#d# naming scheme)
xyz_0 : a single disk (in the enclosure based naming scheme)
xyz_ : all disks on the enclosure whose name is xyz
Select disk devices to encapsulate:
[
DEVICE DISK GROUP STATUS
c0t0d0 - - ZFS
c0t1d0 capszdg01 capszdg online
Select disk devices to encapsulate:
[
Here is the disk selected. Output format: [Device_Name]
c0t0d0
Continue operation? [y,n,q,?] (default: y)
You can choose to add this disk to an existing disk group or to
a new disk group. To create a new disk group, select a disk group
name that does not yet exist.
Which disk group [
Create a new group named rootdg? [y,n,q,?] (default: y)
Use a default disk name for the disk? [y,n,q,?] (default: y)
A new disk group will be created named rootdg and the selected
disks will be encapsulated and added to this disk group with
default disk names.
c0t0d0
Continue with operation? [y,n,q,?] (default: y)
This disk device is disabled (offline) and cannot be used.
Output format: [Device_Name]
c0t0d0
Hit RETURN to continue.
Error seen when attempting to vxdisksetup the disk, which is "auto:ZFS":
# /etc/vx/bin/vxdisksetup -if ams_wms0_125
VxVM vxdisksetup ERROR V-5-2-5716 Disk ams_wms0_125 is in use by ZFS. Slice(s) 0 are in use as ZFS zpool (or former) devices.
If you still want to initialize this device for VxVM use, please destroy the zpool by running 'zpool' command if it is still active, and then remove the ZFS signature from each of these slice(s) as follows:
dd if=/dev/zero of=/dev/vx/rdmp/ams_wms0_125s[n] oseek=31 bs=512 count=1
[n] is the slice number.
When a ZFS disk is created under Solaris ZFS, it will put a ZFS ID on the disk. The ZFS signature is unique to ZFS and will be maintained at offset 31 ( for Solaris 10 U8 and on) and various back up locations on the disk. Pre Solaris 10 U8, is maintained at offset 16.
Storage Foundation 5.1 is aware of Solaris SVM and ZFS type disks. In the case of ZFS, VxVM will search for the unique ZFS signature strings "0210da7a b10c7a11" at offset 31 (for VxVM 5.1RP1 and on) and will flag the disk as Format type ZFS to protect the disk from being inadvertently used by VxVM.
Example of how VxVM will display the disk.
# vxdisk -e list|grep ams_wms0_125
ams_wms0_125 auto:ZFS - - ZFS c0t50060E80104EF3F2d18 std fc
# vxdisk list |grep ZFS
ams_wms0_125 auto:ZFS - - ZFS
# vxdisk list ams_wms0_125
Device: ams_wms0_125
devicetag: ams_wms0_125
type: auto
info: format=ZFS
flags: ZFS error private autoconfig
pubpaths: block=/dev/vx/dmp/ams_wms0_125 char=/dev/vx/rdmp/ams_wms0_125
guid: -
udid: HITACHI%5FDF600F%5F73061247%5F007D
site: -
errno: Disk is not useable, bad format
Multipathing information:
numpaths: 2
c0t50060E80104EF3F2d18 state=enabled type=secondary
c0t50060E80104EF3F3d18 state=enabled type=secondary
The issue presents itself when the disk is no longer used by ZFS. When the disk is removed from the zpool configuration, it does not clear all ZFS ID's from the disk. Which means that when VxVM scans the disks and checks for possible ZFS disks on the system, it searches at offset 31 for signature strings "0210da7a b10c7a11" and because it's still present, it will flag it as "auto:ZFS" accordingly.
Example,
# zpool status
pool: proj
state: ONLINE
scrub: none requested
config:
NAME STATE READ WRITE CKSUM
proj ONLINE 0 0 0
c0t50060E80104EF3F2d18 ONLINE 0 0 0
# zpool destroy proj
# zpool status
no pools available
Now that we have removed the disk from the ZFS configuration, let's see if the ZFS signature is still visible on the disk.
# od -Ad -X /dev/rdsk/c0t50060E80104EF3F2d18s2 | grep "210da7a b10c7a11"|more
0016336 00000000 00000000 0210da7a b10c7a11
0131024 00000000 00000000 0210da7a b10c7a11
0132048 00000000 00000000 0210da7a b10c7a11
You can calculate the offset location of the signature block as follows.
# bc
0016336/512
31
So from the above we can see that even after removing the disk from the ZFS configuration the ZFS ID's were still maintained at, a predefined location.
To clear the ZFS label, simply do the following.
# vxdisk rm ams_wms0_125
# dd if=/dev/zero of=/dev/rdsk/c0t50060E80104EF3F2d18s2 oseek=31 bs=512 count=1
# vxdctl enable
# od -Ad -X /dev/rdsk/c0t50060E80104EF3F3d18s2 | grep "210da7a b10c7a11"|more
0131024 00000000 00000000 0210da7a b10c7a11 <<< Note signature block is now at offset 255. Offset 31 has been cleared.
0132048 00000000 00000000 0210da7a b10c7a11
# vxdisk -e list |grep ams_wms0_125
ams_wms0_125 auto:none - - online invalid c0t50060E80104EF3F2d18 std fc
In the case of a VxVM disk initialization attempt, VxVM will provide instructions on how to remove the ZFS ID.
Applies To
Storage Foundation 5.1 and on
Solaris 10 U6
Solaris 10 U8 and on ( Note for Solaris 10 u8 and on VxVM 5.1RP1 and on is required in order to recognize disks as ZFS as the offset for the signature block was changed to offset 31).