Trying to format volume, but not succeeding (diskutil bug)

This forum is to find answers to problems you may be having with ZEVO Community Edition.

Moderators: jhartley, MSR734, nola

Re: Trying to format volume, but not succeeding

Post by satadru » Tue Sep 18, 2012 2:23 pm

Great!

To create a new internal volume from an existing partition I did this:
Code: Select all
sudo diskutil eraseVolume "ZFS Pool" ZFS rdisk0s#

I then did a
Code: Select all
zpool list
to determine what the UUID of the volume was, and then after a
Code: Select all
zpool export ZFS
I was able to create a new pool thus:
Code: Select all
sudo zpool create -f newpoolname GPTE_BLAHBLAHUUID
satadru Offline


 
Posts: 20
Joined: Fri Sep 14, 2012 10:07 pm

using gpt to add a ZFS partition/slice

Post by grahamperrin » Wed Sep 19, 2012 1:56 am

Using gpt to add a ZFS partition/slice

With the UUID 6A898CC3-1DD2-11B2-99A6-080020736631 that is associated with partition type ZFS, and with a disk where all volumes can be unmounted, we can use gpt to add a ZFS slice to free space.

An example, with Mountain Lion

Code: Select all
sh-3.2$ diskutil unmountDisk /dev/disk6
Unmount of all volumes on disk6 was successful
sh-3.2$ sudo gpt show -l /dev/disk6
     start      size  index  contents
         0         1         PMBR
         1         1         Pri GPT header
         2        32         Pri GPT table
        34         6         
        40    409600      1  GPT part - "EFI System Partition"
    409640   9765632      2  GPT part - "Untitled 1"
  10175272  26304088         
  36479360  25517656      3  GPT part - "UniBeast"
  61997016    262151         
  62259167        32         Sec GPT table
  62259199         1         Sec GPT header
sh-3.2$ diskutil unmountDisk /dev/disk6
Unmount of all volumes on disk6 was successful
sh-3.2$ sudo gpt add -b 10175272 -t 6A898CC3-1DD2-11B2-99A6-080020736631 /dev/disk6
/dev/disk6s4 added
sh-3.2$ diskutil list disk6
/dev/disk6
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *31.9 GB    disk6
   1:                        EFI                         209.7 MB   disk6s1
   2:                  Apple_HFS stuff                   5.0 GB     disk6s2
   3:                  Apple_HFS UniBeast                13.1 GB    disk6s3
   4:                        ZFS                         13.5 GB    disk6s4
sh-3.2$ sudo zpool create example /dev/disk6s4
sh-3.2$ zpool status example
  pool: example
 state: ONLINE
 scan: none requested
config:

   NAME                                         STATE     READ WRITE CKSUM
   example                                      ONLINE       0     0     0
     GPTE_A88A307C-B0A9-4705-8948-0F288BB6F68D  ONLINE       0     0     0  at disk6s4

errors: No known data errors
grahamperrin Offline

User avatar
 
Posts: 1596
Joined: Fri Sep 14, 2012 10:21 pm
Location: Brighton and Hove, United Kingdom

Re: Trying to format volume, but not succeeding

Post by witchbutter » Sun Nov 11, 2012 6:17 pm

I used the syntax similar to how it was done on MacZFS and this worked for me:
Code: Select all
nightside:~ witchbutter$ sudo diskutil partitiondisk /dev/disk2 GPTFormat "ZFS Pool" %noformat% 100%
Started partitioning on disk2
Unmounting disk
Creating the partition map
Waiting for the disks to reappear
Finished partitioning on disk2
/dev/disk2
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *1.5 TB     disk2
   1:                        EFI                         209.7 MB   disk2s1
   2:                        ZFS                         1.5 TB     disk2s2
nightside:~ witchbutter$
witchbutter Offline


 
Posts: 6
Joined: Mon Sep 17, 2012 1:31 am

Re: Trying to format volume, but not succeeding

Post by grahamperrin » Mon Nov 12, 2012 12:22 am

Thanks. Which OS?
grahamperrin Offline

User avatar
 
Posts: 1596
Joined: Fri Sep 14, 2012 10:21 pm
Location: Brighton and Hove, United Kingdom

Re: Trying to format volume, but not succeeding

Post by witchbutter » Mon Nov 12, 2012 2:04 am

10.8.2
witchbutter Offline


 
Posts: 6
Joined: Mon Sep 17, 2012 1:31 am

Re: Trying to format volume, but not succeeding

Post by d.jacobs » Mon Nov 12, 2012 10:34 pm

I thought 'zpool create' handles the reformatting step? If you take a blank drive and just do 'zpool create WhateverPoolName /dev/diskX' does it handle the diskutil step automatically, creating the GPT layout? I'm confident that's what I used the last time I set up a pool.
d.jacobs Offline


 
Posts: 5
Joined: Wed Oct 17, 2012 3:55 pm

harmony with diskutil

Post by grahamperrin » Tue Nov 13, 2012 1:13 am

For greatest compatibility with the OS – or with third party routines that use relevant parts of the OS – it's desirable for all things ZFS-related to have results that are sane, and user-friendly, in response to commands that are based on diskutil.

Running as root is required far less often by diskutil than by zpool, and so on.
grahamperrin Offline

User avatar
 
Posts: 1596
Joined: Fri Sep 14, 2012 10:21 pm
Location: Brighton and Hove, United Kingdom

Re: Trying to format volume, but not succeeding

Post by dbrady » Wed Nov 14, 2012 2:03 am

There is a bug in 10.8.2 diskutil command and "%noformat% no longer works in many cases. zpool create will do the right thing if it's passed a whole disk (diskN) or a slice (diskNsn) that resides in a GPT partition. So there is no real need to use the [broken] diskutil to preformat a disk for use with zfs.
dbrady Offline


 
Posts: 67
Joined: Wed Sep 12, 2012 12:43 am

OS X 10.8, 10.8.2, diskutil(8) and %noformat%

Post by grahamperrin » Wed Nov 14, 2012 2:51 am

Thanks, Don. I tried (and tried (and tried)) to find the similar answer 'cause I recall you giving it elsewhere, but gave up through frustration with phpBB ;-)

viewtopic.php?p=326#p326
describes 10.8 … please, is it known whether the bug is limited to 10.8.2?
grahamperrin Offline

User avatar
 
Posts: 1596
Joined: Fri Sep 14, 2012 10:21 pm
Location: Brighton and Hove, United Kingdom

Re: OS X 10.8, 10.8.2, diskutil(8) and %noformat%

Post by dbrady » Wed Nov 14, 2012 8:01 am

grahamperrin wrote:http://zevo.getgreenbytes.com/forum/viewtopic.php?p=326#p326
describes 10.8 … please, is it known whether the bug is limited to 10.8.2?


It was introduced in 10.8.0 and hasn't yet been fixed. I filed a bug with Apple and it was closed as a duplicate -- so Apple at least knows about the regression. The only work-around (that others have also observed) is to use an MSDOS 8.3 comformant name (such as "ZFS" or "DUFAIL") with eraseVolume since "%noformat%" now gets rejected as a bad name.
dbrady Offline


 
Posts: 67
Joined: Wed Sep 12, 2012 12:43 am

PreviousNext

Return to Troubleshooting

Who is online

Users browsing this forum: bileyqrkq, ilovezfs and 0 guests

cron