Creating Fusion Drive incorrectly with HDD before SDD?

Discussion in 'OS X Mavericks (10.9)' started by gatortpk, Aug 23, 2014.

  1. gatortpk macrumors 6502

    Joined:
    Nov 25, 2003
    Location:
    Melbourne, FL
    #1
    I have created a fusion drive using a 128GB SSD and a 4TB HDD. Disk Utility originally formatted my 4TB HDD as a CoreStorage volume, I had to 'delete' the coreStorage, and then 'create' a Logical Volume Group (LVG). Once I did that, I 'createVolume' the whole CoreStorage volume (LVG). I thought it was pretty cool actually that everything worked as expected!

    I have read a few articles explaining how it works and some ideas, one such article said that CoreStorage automatically detects the SSD and uses that first as it should.

    However, when I ran 'iostat -d disk0 disk1' terminal command to see what physical drives were in use, only my 4TB HDD appeared to be in use.

    I then typed 'diskutil cs list' (output below). That command will list only the coreStorage (cs) information and I noticed that the two physical drives listed as "Index: 0" and Index: 1" starting with the HDD. I wanted to confirm that the first Index drive is supposed to be the SSD and that CoreStorage knows nothing about which physical volume is actually the SSD and which is the HDD.

    Is it true that for a fusion drive to work properly the SSD should be the first indexed physical drive in the CoreStorage logical volume group? (Otherwise, my iMac is treating my 4TB HDD as the fast SSD and vise versa)

    I can spend another half day and start from scratch by typing:
    diskutil cs create Fusion disk1s2 disk0s2
    instead of what I actually typed:
    diskutil cs create Fusion disk0s2 disk1s2

    Would I be wasting my time redoing my Fusion Drive, or would retyping the correct command fix the problem of my HDD doing all the work and my SSD unused (for the first 3.9TB)?

    I get the following output when I look at my coreStorage list:

    -bash-3.2# diskutil cs list
    CoreStorage logical volume groups (1 found)
    |
    +-- Logical Volume Group BECBAD0E-9381-4247-8528-C3B1703B5D1F
    =========================================================
    Name: Fusion
    Status: Online
    Size: 3995365670912 B (4.0 TB)
    Free Space: 114688 B (114.7 KB)
    |
    +-< Physical Volume 28F801EF-CD05-44E7-A2A3-6930322503CB
    | ----------------------------------------------------
    | Index: 0
    | Disk: disk0s2
    | Status: Online
    | Size: 3868189753344 B (3.9 TB)
    |
    +-< Physical Volume 33D6E16C-68D2-4206-915A-1B2E78650763
    | ----------------------------------------------------
    | Index: 1
    | Disk: disk1s2
    | Status: Online
    | Size: 127175917568 B (127.2 GB)
    |
    +-> Logical Volume Family 59D719DD-669F-460F-9179-1FEF0D3F8585
    ----------------------------------------------------------
    Encryption Status: Unlocked
    Encryption Type: None
    Conversion Status: NoConversion
    Conversion Direction: -none-
    Has Encrypted Extents: No
    Fully Secure: No
    Passphrase Required: No
    |
    +-> Logical Volume 2299FF7B-6E0D-429D-8114-F02AF1B098EE
    ---------------------------------------------------
    Disk: disk3
    Status: Online
    Size (Total): 3994744782848 B (4.0 TB)
    Conversion Progress: -none-
    Revertible: No
    LV Name: Fusion HD
    Volume Name: Fusion HD
    Content Hint: Apple_HFS

     
  2. marzer macrumors 65816

    marzer

    Joined:
    Nov 14, 2009
    Location:
    Colorado
    #2
    All my machines with Fusion drives have the SSD installed as disk0 and the HD as disk1. Likewise, the "cs list" shows the SSD as the first drive in the core storage logical volume. However, I'm not sure any of that is necessary to permit the SSD to be recognized in a Fusion drive as the initial operating device in the logical volume. Also, when I configure a logical volume for Fusion, I use:

    "diskutil cs create LVGroupName {SSD disk ID} {HD disk ID}"

    And when I'm using the entire disk, versus a partition, I use the top level disk Identifier (disk#) instead of specifying a partition name (disk#s#). Not that it matters in the big scheme of things, but for troubleshooting I prefer to keep it simple whenever possible. So in your case I would've used the following command to create the LV:

    "diskutil cs create Fusion disk1 disk0

    However...What I would suggest before you redo anything is to run a disk benchmark to see if you get SSD-like speeds or HD-like speeds.
     
  3. gatortpk thread starter macrumors 6502

    Joined:
    Nov 25, 2003
    Location:
    Melbourne, FL
    #3
    Thanks for the info! I have run a disk benchmark and that's what initially alerted me to this possible problem. I was only getting about 170 MB/s (pretty good for a HDD), but not 260 MB/s like I usually get on my SSD. It would be faster, but my old iMac only has SATA II ports (3 Gbps or 300MB/s with 8bit/10bit encoding).

    I did notice that the drive numbers have actually reversed! So my SSD is now disk0. This happened on the next startup of the newly installed Mavericks on the Fusion drive. However, the HDD is still the first indexed drive in the LVG.

    If I use the whole disk0 and disk1 in the command, wouldn't that erase the Recovery HD partition? I have read that the Apple spec for Fusion drives is to have the Recovery HD on the HDD, and I tried that by installing Mavericks on the HDD first, then creating the coreStorage fusion volume afterward, but that seemed to change the "Recovery HD" to "Boot OS X" at 134.6 MB instead of the usual 650 MB. I wonder how important this is. Right now my full Recovery HD is on the SSD instead (all the spaces to make this easy to read are compressed):

    /dev/disk0
    #: TYPE NAME SIZE IDENTIFIER
    0: GUID_partition_scheme *128.0 GB disk0
    1: EFI EFI 209.7 MB disk0s1
    2: Apple_CoreStorage 127.2 GB disk0s2
    3: Apple_Boot Recovery HD 650.0 MB disk0s3
    /dev/disk1
    #: TYPE NAME SIZE IDENTIFIER
    0: GUID_partition_scheme *4.0 TB disk1
    1: EFI EFI 209.7 MB disk1s1
    2: Apple_CoreStorage 3.9 TB disk1s2
    3: Apple_Boot Boot OS X 134.2 MB disk1s3
    4: Apple_HFS Yosemite 131.1 GB disk1s4
    5: Apple_Boot Recovery HD 650.0 MB disk1s5
    /dev/disk2
    #: TYPE NAME SIZE IDENTIFIER
    0: Apple_HFS Fusion HD *4.0 TB disk2
    /dev/disk3
    #: TYPE NAME SIZE IDENTIFIER
    0: GUID_partition_scheme *4.0 TB disk3
    1: EFI 209.7 MB disk3s1
    2: Apple_HFS Time Machine Backup 4.0 TB disk3s2
    3: Apple_Boot Recovery HD 650.0 MB disk3s3​


    Even though the drive numbers switched to the typical setup, the HDD is still first in the Logical Volume Group, and apparently that is what matters:

    CoreStorage logical volume groups (1 found)
    |
    +-- Logical Volume Group BECBAD0E-9381-4247-8528-C3B1703B5D1F
    =========================================================
    Name: Fusion
    Status: Online
    Size: 3995365670912 B (4.0 TB)
    Free Space: 114688 B (114.7 KB)
    |
    +-< Physical Volume 28F801EF-CD05-44E7-A2A3-6930322503CB
    | ----------------------------------------------------
    | Index: 0
    | Disk: disk1s2
    | Status: Online
    | Size: 3868189753344 B (3.9 TB)
    |
    +-< Physical Volume 33D6E16C-68D2-4206-915A-1B2E78650763
    | ----------------------------------------------------
    | Index: 1
    | Disk: disk0s2
    | Status: Online
    | Size: 127175917568 B (127.2 GB)
    |
    +-> Logical Volume Family 59D719DD-669F-460F-9179-1FEF0D3F8585
    ----------------------------------------------------------
    Encryption Status: Unlocked
    Encryption Type: None
    Conversion Status: NoConversion
    Conversion Direction: -none-
    Has Encrypted Extents: No
    Fully Secure: No
    Passphrase Required: No
    |
    +-> Logical Volume 2299FF7B-6E0D-429D-8114-F02AF1B098EE
    ---------------------------------------------------
    Disk: disk2
    Status: Online
    Size (Total): 3994744782848 B (4.0 TB)
    Conversion Progress: -none-
    Revertible: No
    LV Name: Fusion HD
    Volume Name: Fusion HD
    Content Hint: Apple_HFS​
     
  4. marzer macrumors 65816

    marzer

    Joined:
    Nov 14, 2009
    Location:
    Colorado
    #4
    A fresh install of OS X to a Fusion drive will create a working Recovery partition. So you don't need to do anything other than create the Fusion using full disk indicators and then do a standard install. And yes on a DIY fusion, at least, the recovery hd is labeled "boot OS X", but it's still accessible thru boot CMD R.

    And yes the disk indicators may have switched at boot but the only way to redefine the order in the logical volume is to recreate it. As the core storage volume involves specific formatting and meta-tagging of the disks. I'd suggest you recreate the Fusion drive from scratch, verify the SSD shows as the initial device in the logical volume and reinstall OS X.
     
  5. gatortpk thread starter macrumors 6502

    Joined:
    Nov 25, 2003
    Location:
    Melbourne, FL
    #5
    I see that you're right about Installing OS X on the Fusion drive and that it creates it's own separate supportive partitions such as Boot OS X or Recovery HD. It seems that formatting the drive creates the EFI partition, and the OS X installation removes and replaces any Recovery HD partition adjacent to it. The creation of my Fusion drive and OS X installation did leave my Yosemite partition and it's Recovery HD partition alone, as well as the Recovery HD on the SSD. I'm hoping that leaving the independent Recovery HD on the SSD will still be useful in the even if my HDD fails completely. I know that if either drive fails the whole fusion drive fails, but the Recovery HD left on the good physical drive should be fine, even if it wasn't created by the current installation on the fusion drive?

    The article I read said to create the recovery partition on the HDD first before fusing the drives. There are still undocumented commands and many ideas about the best way to DIY a fusion drive, I'm not surprised I didn't read the best way to do it. It appears that extra partitions (Yosemite; current OS X 10.x +1) on the HDD that is part of a fusion drive is OK. I did set the physical coreStorage partitions first in line (after EFI) for the Fusion drive.

    I will now recreate the fusion drive from scratch making sure the SSD is the first indexed drive in the Logical Volume Group. I'll look for, or start a new thread about the best way to migrate two different startup volumes from TimeMachine after a clean install. (Migration Assistant does not ask which volumes on the TimeMachine to use, it just migrates from the the most recent backup volume.)
     
  6. gatortpk thread starter macrumors 6502

    Joined:
    Nov 25, 2003
    Location:
    Melbourne, FL
    #6
    All Better Now!

    I restarted from scratch and my SSD is now the first indexed volume in the Logical Volume Group.

    The newly installed Mavericks is busy doing maintenance, so I didn't even have to read/write a test file to see that my Fusion Drive is working properly. Here are the results of "iostat -d disk0 disk1 1" with my SSD being disk0:

    Code:
         disk0                   disk1 
        KB/t tps  MB/s     KB/t tps  MB/s 
       33.60 611 20.06   158.40  21  3.28 
      145.93 116 16.52     0.00   0  0.00 
      184.82 573 103.38     0.00   0  0.00 
       95.83 470 44.03     0.00   0  0.00 
       94.17 234 21.51   497.17  24 11.65 
       52.92 829 42.85     0.00   0  0.00 
       54.20 595 31.50     0.00   0  0.00 
       38.17 280 10.42   501.50  32 15.65 
       94.12 809 74.41     0.00   0  0.00 
       48.74 546 25.97     0.00   0  0.00 
      106.20 1069 110.90   508.00   8  3.96 
        9.88 130  1.25   497.28  69 33.49 
      132.72 189 24.48   493.50  16  7.71 
       97.05  99  9.38   362.82  17  6.02 
       21.97 317  6.80   428.62  39 16.32 
      165.30 657 106.02     0.00   0  0.00 
      110.78 894 96.77     0.00   0  0.00 
       84.61 222 18.33   441.33  33 14.21 
       72.01 766 53.89     0.00   0  0.00 
       63.49 203 12.58    46.00   2  0.09
    The results before were all zeros in the disk0 (SSD) columns. I really like the tps (Transactions per second; IOPS) number in disk0 compared to disk1! It's interesting that the KB/t is also usually ~450 KB/t in disk1 meaning that CoreStorage is writing files in bulk for long term storage as it should? I also hope that the high tps;IOPS number on the SSD isn't coming from the disk cache either.

    I also recovered about 500MB on the SSD when it moved the 650MB Recovery HD to the HDD (and named it "Boot OS X" also) and just left a 134.2MB Boot OS X partition on the SSD (I do have a second major partition "Yosemite" with it's own Recovery HD partition on the HDD):

    Code:
    /dev/disk0
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      GUID_partition_scheme                        *128.0 GB   disk0
       1:                        EFI EFI                     209.7 MB   disk0s1
       2:          Apple_CoreStorage                         127.7 GB   disk0s2
       3:                 Apple_Boot Boot OS X               134.2 MB   disk0s3
    /dev/disk1
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      GUID_partition_scheme                        *4.0 TB     disk1
       1:                        EFI EFI                     209.7 MB   disk1s1
       2:          Apple_CoreStorage                         3.9 TB     disk1s2
       3:                 Apple_Boot Boot OS X               650.0 MB   disk1s3
       4:                  Apple_HFS Yosemite                131.1 GB   disk1s4
       5:                 Apple_Boot Recovery HD             650.0 MB   disk1s5
    /dev/disk2
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:                  Apple_HFS Fusion                 *4.0 TB     disk2

    My output of diskutil cs list:

    Code:
    CoreStorage logical volume groups (1 found)
    |
    +-- Logical Volume Group E66B2C06-41B3-4F88-9A7B-B97CB1C5F681
        =========================================================
        Name:         MyLVG
        Status:       Online
        Size:         3995881455616 B (4.0 TB)
        Free Space:   18350080 B (18.4 MB)
        |
        +-< Physical Volume 869D65B3-1EC9-4F37-8A0E-BB87A7FEA294
        |   ----------------------------------------------------
        |   Index:    0
        |   Disk:     disk0s2
        |   Status:   Online
        |   Size:     127691702272 B (127.7 GB)
        |
        +-< Physical Volume 0661025E-4E85-45C8-922D-C9A1FF4D4602
        |   ----------------------------------------------------
        |   Index:    1
        |   Disk:     disk1s2
        |   Status:   Online
        |   Size:     3868189753344 B (3.9 TB)
        |
        +-> Logical Volume Family BFE5B13A-52B4-4BBA-9B5B-B501D7BC0513
            ----------------------------------------------------------
            Encryption Status:       Unlocked
            Encryption Type:         None
            Conversion Status:       NoConversion
            Conversion Direction:    -none-
            Has Encrypted Extents:   No
            Fully Secure:            No
            Passphrase Required:     No
            |
            +-> Logical Volume 78D92CE3-388A-4210-B738-BE31A277D6A1
                ---------------------------------------------------
                Disk:                  disk2
                Status:                Online
                Size (Total):          3995242332160 B (4.0 TB)
                Conversion Progress:   -none-
                Revertible:            No
                LV Name:               Fusion
                Volume Name:           Fusion
                Content Hint:          Apple_HFS
    Having been through this exercise, I have learned that creating the Fusion Drive and it's JHFS+ Volume, the EFI and Boot OS X partitions are created. Then when OS X is installed on the Fusion Drive, it resizes the Boot OS X partition from 134.2MB to 650MB on the HDD (or what ever the second indexed physical drive/partition may be, as seen from my earlier mistake).
     

Share This Page