diskutil coreStorage deleteLVG fails where there's ZFS

Moderators: jhartley, MSR734, nola

diskutil coreStorage deleteLVG fails where there's ZFS

Post by grahamperrin » Fri Nov 02, 2012 2:11 pm

Spun off from viewtopic.php?p=1335#p1335 under FYI: ZFS on Fusion Drive actually works.

From within a CoreStorage pool (LVG) I gave a CoreStorage logical volume
CoreStorage LV on bla
to ZEVO.

After destroying the ZFS pool,

Code: Select all
macbookpro08-centrim:~ gjp22$ diskutil cs list
CoreStorage logical volume groups (3 found)
|
+-- Logical Volume Group 039C0D47-F3CF-44D3-A825-B48F01FCF334
|   =========================================================
|   Name:         OS
|   Size:         99484213248 B (99.5 GB)
|   Free Space:   0 B (0 B)
|   |
|   +-< Physical Volume 86D2FA98-8C69-4828-B909-8312AE4A75E2
|   |   ----------------------------------------------------
|   |   Index:    0
|   |   Disk:     disk0s5
|   |   Status:   Online
|   |   Size:     99484213248 B (99.5 GB)
|   |
|   +-> Logical Volume Family 7AA96B8E-0E41-4C3F-9589-5FAE0C956372
|       ----------------------------------------------------------
|       Encryption Status:       Unlocked
|       Encryption Type:         AES-XTS
|       Conversion Status:       Complete
|       Conversion Direction:    -none-
|       Has Encrypted Extents:   Yes
|       Fully Secure:            Yes
|       Passphrase Required:     Yes
|       |
|       +-> Logical Volume B13EE5BF-5D08-49D3-94C2-DF58AFEA1D08
|           ---------------------------------------------------
|           Disk:               disk1
|           Status:             Online
|           Size (Total):       99165437952 B (99.2 GB)
|           Size (Converted):   -none-
|           Revertible:         No
|           LV Name:            OS
|           Volume Name:        OS
|           Content Hint:       Apple_HFS
|
+-- Logical Volume Group 902434C9-0131-4E3A-AE15-2B8B938087AD
|   =========================================================
|   Name:         gjp22-cs
|   Size:         616336003072 B (616.3 GB)
|   Free Space:   0 B (0 B)
|   |
|   +-< Physical Volume 179AADE6-34F1-404C-A994-9FD99C881BA6
|   |   ----------------------------------------------------
|   |   Index:    0
|   |   Disk:     disk0s7
|   |   Status:   Online
|   |   Size:     616336003072 B (616.3 GB)
|   |
|   +-> Logical Volume Family FFCE2FAF-BE8E-4FEF-9F3E-E221C6CBCA11
|       ----------------------------------------------------------
|       Encryption Status:       Unlocked
|       Encryption Type:         AES-XTS
|       Conversion Status:       Complete
|       Conversion Direction:    -none-
|       Has Encrypted Extents:   Yes
|       Fully Secure:            Yes
|       Passphrase Required:     Yes
|       |
|       +-> Logical Volume 0CFAFD38-E79B-40AC-A4BE-63296E6B4331
|           ---------------------------------------------------
|           Disk:               disk2
|           Status:             Online
|           Size (Total):       616017227776 B (616.0 GB)
|           Size (Converted):   -none-
|           Revertible:         No
|           LV Name:            gjp22-cs
|           Content Hint:       Apple_HFS
|
+-- Logical Volume Group 8E49E613-E2ED-48E4-BF7C-52689406EB2C
    =========================================================
    Name:         bla
    Size:         3679412224 B (3.7 GB)
    Free Space:   1360633856 B (1.4 GB)
    |
    +-< Physical Volume 36F93DBD-C3F4-42E3-A85C-E955D0C45757
    |   ----------------------------------------------------
    |   Index:    0
    |   Disk:     disk5s2
    |   Status:   Online
    |   Size:     3679412224 B (3.7 GB)
    |
    +-> Logical Volume Family 39954635-A709-480A-91C4-C7C0BF812D4F
        ----------------------------------------------------------
        Encryption Status:       Unlocked
        Encryption Type:         None
        Conversion Status:       NoConversion
        Conversion Direction:    -none-
        Has Encrypted Extents:   No
        Fully Secure:            No
        Passphrase Required:     No
        |
        +-> Logical Volume 79A6BA9D-2766-4900-86DC-E36F09220C2C
            ---------------------------------------------------
            Disk:               disk6
            Status:             Online
            Size (Total):       2000003072 B (2.0 GB)
            Size (Converted):   -none-
            Revertible:         No
            LV Name:            CoreStorage LV on bla
            Content Hint:       Apple_HFS


The problem

Code: Select all
macbookpro08-centrim:~ gjp22$ diskutil cs deleteLVG 8E49E613-E2ED-48E4-BF7C-52689406EB2C
Started CoreStorage operation
Ejecting Logical Volumes
The volume "(null)" on disk6 couldn't be unmounted
Error: -69886: Invalid request


Disk Utility can not partition the disk, can not remove any partition.

Additional information

Code: Select all
macbookpro08-centrim:~ gjp22$ mount
/dev/disk1 on / (hfs, local, journaled)
devfs on /dev (devfs, local, nobrowse)
/dev/disk0s2 on /Volumes/swap (hfs, local, journaled)
/dev/disk0s4 on /Volumes/spare (hfs, local, journaled)
map -hosts on /net (autofs, nosuid, automounted, nobrowse)
map auto_home on /home (autofs, automounted, nobrowse)
AFS on /afs (afs)
/dev/disk3 on /Volumes/gjp22 (zfs, local, journaled, noatime)
/dev/disk4s1 on /Volumes/THICKO (msdos, local, nodev, nosuid, noowners)


Code: Select all
macbookpro08-centrim:~ gjp22$ diskutil info disk6
   Device Identifier:        disk6
   Device Node:              /dev/disk6
   Part of Whole:            disk6
   Device / Media Name:      bla

   Volume Name:              Not applicable (no file system)

   Mounted:                  Not applicable (no file system)

   File System:              None

   Content (IOContent):      GUID_partition_scheme
   OS Can Be Installed:      No
   Media Type:               Generic
   Protocol:                 USB
   SMART Status:             Not Supported

   Total Size:               2.0 GB (2000003072 Bytes) (exactly 3906256 512-Byte-Blocks)
   Volume Free Space:        Not applicable (no file system)
   Device Block Size:        512 Bytes

   Read-Only Media:          No
   Read-Only Volume:         Not applicable (no file system)
   Ejectable:                Yes

   Whole:                    Yes
   Internal:                 No
   OS 9 Drivers:             No
   Low Level Format:         Not supported


Code: Select all
macbookpro08-centrim:~ gjp22$ diskutil list
/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *750.2 GB   disk0
   1:                        EFI                         209.7 MB   disk0s1
   2:                  Apple_HFS swap                    32.0 GB    disk0s2
   3: FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF               536.9 MB   disk0s3
   4:                  Apple_HFS spare                   671.1 MB   disk0s4
   5:          Apple_CoreStorage                         99.5 GB    disk0s5
   6:                 Apple_Boot Boot OS X               650.0 MB   disk0s6
   7:          Apple_CoreStorage                         616.3 GB   disk0s7
   8:                 Apple_Boot Boot OS X               134.2 MB   disk0s8
/dev/disk1
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:                  Apple_HFS OS                     *99.2 GB    disk1
/dev/disk2
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *616.0 GB   disk2
   1:                        EFI                         209.7 MB   disk2s1
   2:                        ZFS                         615.7 GB   disk2s2
/dev/disk3
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:             zfs_pool_proxy gjp22                  *614.2 GB   disk3
/dev/disk4
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *4.0 GB     disk4
   1:             Windows_FAT_32 THICKO                  4.0 GB     disk4s1
/dev/disk5
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *4.0 GB     disk5
   1:                        EFI                         209.7 MB   disk5s1
   2:          Apple_CoreStorage                         3.7 GB     disk5s2
   3:                 Apple_Boot Boot OS X               134.2 MB   disk5s3
/dev/disk6
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *2.0 GB     disk6
   1:                        ZFS                         1.9 GB     disk6s1


Code: Select all
macbookpro08-centrim:~ gjp22$ zpool list
NAME     SIZE   ALLOC    FREE     CAP  HEALTH  ALTROOT
gjp22   572Gi   380Gi   192Gi     66%  ONLINE  -
macbookpro08-centrim:~ gjp22$ sudo zpool showdisks
Password:

DISK DEVICE      SIZE  CONNECTION    DESCRIPTION
/dev/disk4    3.73GiB  USB           Verbatim STORE N GO Media
/dev/disk6    1.86GiB  USB           bla       


Workaround

Use Disk Utility to erase just the volume.

Erasure unexpectedly affects more than the volume; it destroys the CoreStorage logical volume group.

Result:

Code: Select all
macbookpro08-centrim:~ gjp22$ diskutil list
/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *750.2 GB   disk0
   1:                        EFI                         209.7 MB   disk0s1
   2:                  Apple_HFS swap                    32.0 GB    disk0s2
   3: FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF               536.9 MB   disk0s3
   4:                  Apple_HFS spare                   671.1 MB   disk0s4
   5:          Apple_CoreStorage                         99.5 GB    disk0s5
   6:                 Apple_Boot Boot OS X               650.0 MB   disk0s6
   7:          Apple_CoreStorage                         616.3 GB   disk0s7
   8:                 Apple_Boot Boot OS X               134.2 MB   disk0s8
/dev/disk1
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:                  Apple_HFS OS                     *99.2 GB    disk1
/dev/disk2
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *616.0 GB   disk2
   1:                        EFI                         209.7 MB   disk2s1
   2:                        ZFS                         615.7 GB   disk2s2
/dev/disk3
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:             zfs_pool_proxy gjp22                  *614.2 GB   disk3
/dev/disk4
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *4.0 GB     disk4
   1:             Windows_FAT_32 THICKO                  4.0 GB     disk4s1
/dev/disk5
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *4.0 GB     disk5
   1:                        EFI                         209.7 MB   disk5s1
   2:                  Apple_HFS CoreStorage LV on bla   3.7 GB     disk5s2
grahamperrin Offline

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

Re: diskutil coreStorage deleteLVG fails where there's ZFS

Post by airecken » Tue Dec 25, 2012 3:41 am

Can you provide a little more info on how you were able to use Disk Utility to erase the LVG? When I try that using Disk Utility (application) it simply creates a new volume in whatever format I choose. It does not actually destroy the LVG.
airecken Offline


 
Posts: 1
Joined: Wed Nov 28, 2012 12:13 am

Details please

Post by grahamperrin » Wed Dec 26, 2012 3:53 am

Which OS?
grahamperrin Offline

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

Re: diskutil coreStorage deleteLVG fails where there's ZFS

Post by raattgift » Mon Mar 04, 2013 2:41 am

10.8.2 "diskutil cs deletelv LVUUID" will fail unless the LV hosts an unlabelled JHFS+ filesystem.

Once you have zpool removed or zpool detached or diskutil unmoundisk the *labelled* contents of a CS LV (zevo always creates GPT labels, including inside LVs) then you can "newfs_hfs /dev/rdisk" (no slice, and the raw "r" device is necessary), at which point you should be able to delete the LV. (You can also resize it with the "diskutil cs resizelv" command, assuming there is space left within the LVG).

As you have discovered, diskutil does not play nicely with labelled LVs, and the Disk Utility application barely plays nicely with CoreStorage at all.

The newfs_hfs appears to trigger a TRIM, but does not reset the bloomclock scores for hot/cold blocks where the LVG is on a composite disk. (Each of these requires appropriate support in the kernel, which in turn only exists in some builds of 10.8.2 (notably those that run on 2012 Mac Minis) and certain SSDs (although third parties like softraid have software that can override that)).
raattgift Offline


 
Posts: 98
Joined: Mon Sep 24, 2012 11:18 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron