Solaris: Delete ZFS slices from a disk

You know ZFS, it is really cool, you can have tons of filesystems in a zpool, you can create raidz/mirror/stripes with just one command, it has compression, quotas and every other cool feature that you can thought about.
But what happens if you have to move a ZFS disk to a Solaris 8/9 system?

Long story short:
An old E450 that works a production server with solaris9 with a 9 gigs mirror with a failed disk, an E250 running solaris10 and zfs with a 9 gigs scsi disk that will suit perfectly in the 450.
We took the disk an plugged in to 450 and tried to recreate the mirror

It turned out that the disk was labeled with EFI type, and hasn’t a slice2, but has a slice8, and so the mirror won’t be recreated.

Format could not handle that disk, we could not delete slice 8 because ’8 is not expected’…
After a bit of googling we found the stuff about EFI Vs. VTOC labels. If you want to use a ZFS’ed disk on an older system you’ve to convert the labels using:

format -e

and then relabel the disk and choose “0″ at the Label prompt:

# format -e c0t8d0
selecting c0t8d0
[disk formatted]

disk - select a disk
type - select (define) a disk type
partition - select (define) a partition table
current - describe the current disk
format - format and analyze the disk
repair - repair a defective sector
label - write label to the disk
analyze - surface analysis
defect - defect list management
backup - search for backup labels
verify - read and display labels
save - save new disk/partition definitions
inquiry - show vendor, product and revision
scsi - independent SCSI mode selects
cache - enable, disable or query SCSI disk cache
volname - set 8-character volume name
! - execute , then return
format> l
format> l
[0] SMI Label
[1] EFI Label
Specify Label type[1]: 0
Warning: This disk has an EFI label. Changing to SMI label will erase all
current partitions.
Continue? y
Auto configuration via format.dat[no]? y

Now you can just partition your drive with format or use prtvtoc and fmthard.

The Conversation

Follow the reactions below and share your own thoughts.

  • Anonymous

    Accurate steps.
    Thanks for the solution.