1

I have a sparse image partition on El Capitan. I am not using FileVault. I've looked at several dozen search results on how to remove the partition, all explaining how to erase the partition and then select it and click the "-" to remove it, but the "-" is grayed.

I've also considered using fdisk from the command line, but the version in OS X does not contain the -l (list) or -d (delete) switches.

How do I delete the sparse image partition?

You’ll note two sparse disk images in the list. The first of the two is the one that needs to go.

/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *500.1 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:          Apple_CoreStorage Macintosh HD            499.2 GB   disk0s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3
/dev/disk1 (internal, virtual):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:                  Apple_HFS Macintosh HD           +498.9 GB   disk1
                                 Logical Volume on disk0s2
                                 663D54A5-31D2-4605-ACC3-4525F5DF1D17
                                 Unencrypted
/dev/disk2 (disk image):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        +76.8 GB    disk2
   1:                        EFI EFI                     209.7 MB   disk2s1
   2:                  Apple_HFS Apple sparse disk im... 76.5 GB    disk2s2
/dev/disk5 (disk image):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        +76.8 GB    disk5
   1:                        EFI EFI                     209.7 MB   disk5s1
   2:                  Apple_HFS Untitled                76.5 GB    disk5s2

CoreStorage logical volume groups (1 found)
|
+-- Logical Volume Group 337F10C4-7BD3-48FE-9128-4D26970B9EE0
    =========================================================
    Name:         Macintosh HD
    Status:       Online
    Size:         499248103424 B (499.2 GB)
    Free Space:   18972672 B (19.0 MB)
    |
    +-< Physical Volume 716483A7-9980-4666-8E24-C83CB595DD7B
    |   ----------------------------------------------------
    |   Index:    0
    |   Disk:     disk0s2
    |   Status:   Online
    |   Size:     499248103424 B (499.2 GB)
    |
    +-> Logical Volume Family 9FACC4F4-789C-4B30-A2BE-F0EA984DB6F0
        ----------------------------------------------------------
        Encryption Type:         None
        |
        +-> Logical Volume 663D54A5-31D2-4605-ACC3-4525F5DF1D17
            ---------------------------------------------------
            Disk:                  disk1
            Status:                Online
            Size (Total):          498876809216 B (498.9 GB)
            Revertible:            Yes (no decryption required)
            LV Name:               Macintosh HD
            Volume Name:           Macintosh HD
            Content Hint:          Apple_HFS


      start       size  index  contents
          0          1         PMBR
          1          1         Pri GPT header
          2         32         Pri GPT table
         34          6         
         40     409600      1  GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
     409640  975093952      2  GPT part - 53746F72-6167-11AA-AA11-00306543ECAC
  975503592    1269536      3  GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC
  976773128          7         
  976773135         32         Sec GPT table
  976773167          1         Sec GPT header

There are two sparse disk images. I had created one, and then at one point restored from Time Machine, which didn't quite work the way I thought it would and I ended up having two.

framework       : 417.4
driver          : 10.11v417.4
images          : 2
================================================
image-path      : /Users/me/Pictures/ext.sparseimage
image-alias     : /Users/me/Pictures/ext.sparseimage
shadow-path     : <none>
icon-path       :     /System/Library/PrivateFrameworks/DiskImages.framework/Resources/CDiskImage.icns
image-type      : sparse disk image
system-image    : false
blockcount      : 150000040
blocksize       : 512
writeable       : TRUE
autodiskmount   : TRUE
removable       : TRUE
image-encrypted : TRUE
mounting user   : me
mounting mode   : -rwx------ 
process ID      : 10682
/dev/disk5  GUID_partition_scheme   
/dev/disk5s1    C12A7328-F81F-11D2-BA4B-00A0C93EC93B    
/dev/disk5s2    48465300-0000-11AA-AA11-00306543ECAC    /Volumes/Untitled
================================================
image-path      : /Users/me/Documents/ext.sparseimage
image-alias     : /Users/me/Documents/ext.sparseimage
shadow-path     : <none>
icon-path       : /System/Library/PrivateFrameworks/DiskImages.framework/Resources/CDiskImage.icns
image-type      : sparse disk image
system-image    : false
blockcount      : 150000040
blocksize       : 512
writeable       : TRUE
autodiskmount   : TRUE
removable       : TRUE
image-encrypted : TRUE
mounting user   : acme
mounting mode   : -rwx------ 
process ID      : 19322
/dev/disk2  GUID_partition_scheme   
/dev/disk2s1    C12A7328-F81F-11D2-BA4B-00A0C93EC93B    
/dev/disk2s2    48465300-0000-11AA-AA11-00306543ECAC    /Volumes/Apple     sparse disk image Media
4
  • These are one (or two?) disk images mounted to /Volumes/ or somewhere else. You have to enter hdiutil info to get the path(s) of the dmg(s). Report back please.
    – klanomath
    Oct 11 '16 at 15:24
  • Hi. Added the requested info.
    – JAyenGreen
    Oct 13 '16 at 22:06
  • Then unmount Apple sparse disk image Media and delete /Users/me/Documents/ext.sparseimage.
    – klanomath
    Oct 13 '16 at 22:15
  • That worked, surprisingly, thanks! Why does it require the disk utility to set up, but not the disk utility to remove the partition? Is it that the file system creates the file and the disk utility is only needed to make it mountable? A separate question, I know, but I thought a little explanation here would help the next person.
    – JAyenGreen
    Oct 15 '16 at 22:33
0

There is nothing like a real "sparse image partition" on your disk. Or with other words: a sparse image partition is no physical partition on your hard disk.

Disk images are in fact files which contain a file system which can be mounted, unmounted or even increased or decreased in size. Mounted images usually appear in the file system in /Volumes/. Then they are listed in the diskutil list output but as /dev/diskX (disk image).

Since they are virtual disks they can't be deleted with diskutil on a physical disk. Instead use the Finder. If you don't know where the image file resides but the image is mounted just enter hdiutil info. The image path is listed then:

...
image-path      : /Users/me/Pictures/ext.sparseimage

Now you can delete the image in the Finder or in the shell with rm ....


I think under the hood the app Disk Utility doesn't use diskutil but hdiutil to deal with disk image files. Therefore you can create them but you can't delete them.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .