Solaris: Delete ZFS slices from a disk

Home -> UNIX -> Solaris -> System administration

1871 views

From the computer of: mind (1 recipe)
Created: Feb 15, 2008     Updated: Feb 17, 2008


Add a comment

Add to:
Add to stumbleuponAdd to del.icio.usDigg itAdd to FURL

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]


FORMAT MENU:
        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
        !<cmd>     - execute <cmd>, then return
        quit
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
format>


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

Subscribe to the Tech-Recipes Newsletter

You can get tips like this delivered in your email every week!

Enter your Email

We will never, ever sell your email address or spam you.





Related recipes:

  Solaris: Copy disk labels to duplicate drive layout
  ZFS: Create a basic filesystem or pool using zpool
  Solaris software RAID
  Add swap space temporarily in Solaris
  Reconfiguration boot in Solaris
  Solaris/SPARC: create a devalias with nvalias
  Use BackSpace Key to Erase characters instead of Delete Key
  Solaris 10: uninstall and delete a zone
  Solaris 10: Create multi-terabyte UFS filesystem
  Enable/configure FC-AL/SAN devices with cfgadm in Solaris

 

Sponsored links

 

Login

Nickname

Password

Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.