Sunday 21 April 2013

Create your own Fusion drive - Mac Pro - Error: 22: POSIX reports: Invalid argument - Fixed

I wanted to create a fusion drive because I had a 120GB disk that I had purchased and then realised it was too small for my home disk. I backed everything up by shuffling files from one drive to another using Carbon Copy Cloner - the best tool for doing these kind of things. This freed up a 1TB drive that I could use. I used the tutorial posted in MacTuts to do the work MacTuts Tutorial

Everything was ready and I ran the magic commands in the terminal on Mac and was stumped.

Check the disks on the system


unknown-00:25:00:f1:a7:2e:~ george$ diskutil list
/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *120.0 GB   disk0
   1:                        EFI                         209.7 MB   disk0s1
   2:                  Apple_HFS                         119.7 GB   disk0s2
/dev/disk1
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *1.0 TB     disk1
   1:                        EFI                         209.7 MB   disk1s1
   2:                  Apple_HFS MacOS 10.8              332.8 GB   disk1s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk1s3
   4:                  Apple_HFS MacOS 10.7              332.8 GB   disk1s4
   5:                 Apple_Boot Recovery HD             650.0 MB   disk1s5
   6:                  Apple_HFS MacOS 10.6              319.8 GB   disk1s6
   7:       Microsoft Basic Data TEMP                    12.3 GB    disk1s7
/dev/disk2
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *640.1 GB   disk2
   1:                        EFI                         209.7 MB   disk2s1
   2:                  Apple_HFS                         639.8 GB   disk2s2
/dev/disk3
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *2.0 TB     disk3
   1:                        EFI                         209.7 MB   disk3s1
   2:                  Apple_HFS Data                    1.0 TB     disk3s2
   3:                  Apple_HFS MacOS 10.8 - New        299.5 GB   disk3s3
   4:                 Apple_Boot Recovery HD             784.2 MB   disk3s4
   5:                  Apple_HFS MacOS 10.7 - New        299.5 GB   disk3s5
   6:                 Apple_Boot Recovery HD             784.2 MB   disk3s6
   7:                  Apple_HFS MacOS 10.6 - New        393.5 GB   disk3s7


Now run the command


unknown-00:25:00:f1:a7:2e:~ george$ diskutil corestorage create logvol /dev/disk0 /dev/disk1
Started CoreStorage operation
Unmounting disk0
Repartitioning disk0
Unmounting disk
Creating the partition map
Rediscovering disk0
Error: 22: POSIX reports: Invalid argument

No matter what I tried it kept failing. The secret to getting this to work was to specify the partition that should be used. This was hidden away in a post in the xclr8yourmac web site xlr8yourmac Fusion Drive Discussion.

The answer is to use the disk partition disk0s2 and disk1s2.

unknown-00:25:00:f1:a7:2e:~ george$ diskutil corestorage create logvol /dev/disk0s2 /dev/disk1s2
Started CoreStorage operation
Unmounting disk0s2
Touching partition type on disk0s2
Adding disk0s2 to Logical Volume Group
Unmounting disk1s2
Touching partition type on disk1s2
Adding disk1s2 to Logical Volume Group
Creating Core Storage Logical Volume Group
Switching disk0s2 to Core Storage
Switching disk1s2 to Core Storage
Waiting for Logical Volume Group to appear
Discovered new Logical Volume Group "1D2196F9-F64F-44C9-81EB-6E8EADEC7C9C"
Core Storage LVG UUID: 1D2196F9-F64F-44C9-81EB-6E8EADEC7C9C
Finished CoreStorage operation

It works! You can then follow the rest of the normal instructions.

unknown-00:25:00:f1:a7:2e:~ george$ diskutil corestorage createVolume 1D2196F9-F64F-44C9-81EB-6E8EADEC7C9C jhfs+ "MacOS 10.8" 100%
Started CoreStorage operation
Waiting for Logical Volume to appear
Formatting file system for Logical Volume
Initialized /dev/rdisk5 as a 1 TB HFS Plus volume with a 90112k journal
Mounting disk
Core Storage LV UUID: DB4C7761-25C1-4AA7-91DC-95BD19DD248D
Core Storage disk: disk5
Finished CoreStorage operation

In theory I now have one fusion drive as disk5. I just need to test it out and see if it improves things.

unknown-00:25:00:f1:a7:2e:~ george$ diskutil corestorage list
CoreStorage logical volume groups (1 found)
|
+-- Logical Volume Group 1D2196F9-F64F-44C9-81EB-6E8EADEC7C9C
    =========================================================
    Name:         logvol
    Status:       Online
    Size:         1118901059584 B (1.1 TB)
    Free Space:   73728 B (73.7 KB)
    |
    +-< Physical Volume 0E9BE62C-3A63-464A-9511-2B0C6952B4B6
    |   ----------------------------------------------------
    |   Index:    0
    |   Disk:     disk0s2
    |   Status:   Online
    |   Size:     119690149888 B (119.7 GB)
    |
    +-< Physical Volume 4713D499-C59A-452A-8996-4916C6D5D6E8
    |   ----------------------------------------------------
    |   Index:    1
    |   Disk:     disk1s2
    |   Status:   Online
    |   Size:     999210909696 B (999.2 GB)
    |
    +-> Logical Volume Family ABF926BE-F2ED-432F-99F4-542191127279
        ----------------------------------------------------------
        Encryption Status:       Unlocked
        Encryption Type:         None
        Conversion Status:       NoConversion
        Conversion Direction:    -none-
        Has Encrypted Extents:   No
        Fully Secure:            No
        Passphrase Required:     No
        |
        +-> Logical Volume DB4C7761-25C1-4AA7-91DC-95BD19DD248D
            ---------------------------------------------------
            Disk:               disk5
            Status:             Online
            Size (Total):       1110397812736 B (1.1 TB)
            Size (Converted):   -none-
            Revertible:         No
            LV Name:            MacOS 10.8
            Volume Name:        MacOS 10.8
            Content Hint:       Apple_HFS