PDA

View Full Version : Advanced Core Storage




haravikk
Apr 5, 2013, 08:08 AM
Okay, so the improved Core Storage has now been in Mountain Lion for a while, and I have a few questions for anyone familiar with it, or that is able to experiment with it.

Fusion Drive and Apple RAID
Firstly, has anyone checked to see if an SSD and an Apple Raid can be combined into a Core Storage volume? I've managed to convert an Apple Raid to a single Core Storage volume before by following this guide (http://blog.kgbvax.net/2011/07/howto-create-encrypted-timemachine.html), but I'd be interested to know if I could then add an SSD to create a Fusion drive, as in most cases reading/writing to the SSD will still be faster, but with a striped set for the main capacity of the volume it should still be possible to load very large files fairly quickly.

Fusion Drive and Tiering
We know by now that what Fusion Drive does is essentially tiering, whereby more commonly accessed files are moved to the SSD for speed while everything else goes onto the slower drive(s) for capacity.

However, does anyone know if Core Storage supports more than two tiers? For example, if I had an SSD, a 15,000rpm drive and a 7200rpm drive, would Core Storage take advantage of the 15,000rpm drive's speed or does it simply treat all non-SSD disks as one big pool for dumping less frequently used stuff into?

Does anyone know also how Core Storage decides to use tiering in the first place? Guides for creating a Fusion drive yourself seem to simply involve add an SSD to a volume, at which point you've got a Fusion drive. Is there any flexibility in the behaviour, or any way to tweak it? How does it treat USB disks?

Expanding a Core Storage Pool
How well does Core Storage support adding extra drives to a pool after it's been created? For example, my current main set of drives has around 3tb of space, but with my use of video files that's not going to last forever. How easy is it to just add an extra disk and expand the volume to include the new disk? e.g - if I bought an extra 1tb disk and either added it to a spare SATA port or plugged it in externally, then I can just throw that capacity onto an existing volume?

My Proposed Setup
What I'm hoping to do is something like the following:
120gb SSD drive for Fusion Drive aided speed
4x 750gb hard disk drives as a RAID-0 set for large file speed
1tb+ hard disk drive as extra storage

6tb of NAS for Time Machine

Is such a setup possible, or will it fail miserably? Currently I have the SSD for OS and users and the RAID as a files volume for larger folders, managed using symbolic links, but the whole thing is a giant pain in the ass as while it doesn't break anything exactly, loads of applications don't follow symbolic links which leads to a bunch of annoyances. Plus when the SSD starts filling up finding stuff to move every so often isn't exactly my favourite task either ;)

I know that Apple RAID isn't the fastest, but it's mostly been for large files anyway which it's always been perfectly good for.



haravikk
Apr 9, 2013, 06:19 AM
Sorry to bump but does no-one know the answers to these? The main one I'm interested in is whether I can combine an Apple RAID with an SSD to create a Fusion Drive, and how easy it is to add extra drives to a Core Storage volume?

benwiggy
Apr 9, 2013, 11:50 AM
Check the Apple Developer documentation. That's the source of nearly all information about the internals of OS X.

haravikk
Apr 11, 2013, 03:15 PM
Check the Apple Developer documentation. That's the source of nearly all information about the internals of OS X.
Unless I've missed a document there is no developer documentation for Core Storage, as it's not really a feature aimed at developers, but rather is just the underpinning that makes FileVault 2 and Fusion Drive work.

Other than the man page for the diskutil corestorage verb there isn't much information, and I'd rather know ahead of time if I what I'm planning to do will work, rather than resorting to trial and error while clean installing! I've converted single drives, and an Apple RAID before, but I don't know whether combining an Apple RAID and an SSD will be an improvement, or if I can easily add space in future.

rlucia
Jul 11, 2013, 03:23 AM
Okay, so the improved Core Storage has now been in Mountain Lion for a while, and I have a few questions for anyone familiar with it, or that is able to experiment with it.

Fusion Drive and Apple RAID
Firstly, has anyone checked to see if an SSD and an Apple Raid can be combined into a Core Storage volume? I've managed to convert an Apple Raid to a single Core Storage volume before by following this guide (http://blog.kgbvax.net/2011/07/howto-create-encrypted-timemachine.html), but I'd be interested to know if I could then add an SSD to create a Fusion drive, as in most cases reading/writing to the SSD will still be faster, but with a striped set for the main capacity of the volume it should still be possible to load very large files fairly quickly.


Happiness = fusion(ssd,appleraid) ;-)

I just finished upgrading one of our mac pros with this formula.

It's quite straightforward as long as you prepare everything while booting your system off a full installed os (10.8.4 as for now) and not off the install disc.

The setup is quite simple:
- SSD drive as first Fusion volume.
- AppleRAID volume as second Fusion volume. The volume is a striped set of two HDDs.

On the hardware side I'm using one 500GB Samsung SSD 840 and two 300GB WD Velociraptors.

Procedure is quite easy to replicate.
disk0 is SSD
disk1 is HDD1
disk2 is HDD2

Spawn a shell:
# diskutil ar create stripe PachaRAID JHFS+ disk1 disk2
(the new volume got disk5)
# diskutil cs create PachaFusion disk0s2 disk5
(a new CS Logical Volume Group is created created)
# diskutil cs createVolume B201A2D0-8353-46F6-8F3F-AAC7C0CD8B86 jhfs+ "Pacha SSD" 100%

So we have a 1.1TB logical volume as result.

As I pointed out earlier, the only quirk is the boot volume to use to create the Fusion drive. I both tried to use Mac OS X Install Disk (InstallESD 10.8.4) and booting off the full OS: while booting off the DVD diskutil cd create couldn't actually create the volume bailing out with an error (didn't take note of it), while repeating the same procedure from the full OS everything worked.

Here it follows the result:
$ diskutil ar list
AppleRAID sets (1 found)
===============================================================================
Name: PachaRAID
Unique ID: 609EB22F-EB6E-4287-8DED-AC1184137432
Type: Stripe
Status: Online
Size: 599.5 GB (599450124288 Bytes)
Rebuild: manual
Device Node: disk5
-------------------------------------------------------------------------------
# DevNode UUID Status Size
-------------------------------------------------------------------------------
0 disk1s2 9AED737F-3430-4040-9101-5E711401A7CF Online 299725062144
1 disk3s2 F1865BB7-552E-4B4C-9E8B-144BD40C9EF5 Online 299725062144
===============================================================================
$ diskutil cs list
CoreStorage logical volume groups (1 found)
|
+-- Logical Volume Group B201A2D0-8353-46F6-8F3F-AAC7C0CD8B86
=========================================================
Name: PachaFusion
Status: Online
Size: 1099214012416 B (1.1 TB)
Free Space: 32768 B (32.8 KB)
|
+-< Physical Volume D66A9AC9-36AD-48DA-9717-EAFD656A7539
| ----------------------------------------------------
| Index: 0
| Disk: disk0s2
| Status: Online
| Size: 499763888128 B (499.8 GB)
|
+-< Physical Volume 609EB22F-EB6E-4287-8DED-AC1184137432
| ----------------------------------------------------
| Index: 1
| Disk: disk5
| Status: Online
| Size: 599450124288 B (599.5 GB)
|
+-> Logical Volume Family 3D89865C-D510-432B-8FE9-4984C11E7751
----------------------------------------------------------
Encryption Status: Unlocked
Encryption Type: None
Conversion Status: NoConversion
Conversion Direction: -none-
Has Encrypted Extents: No
Fully Secure: No
Passphrase Required: No
|
+-> Logical Volume 915BA59A-0E91-4F43-97A9-51B0864676CB
---------------------------------------------------
Disk: disk6
Status: Online
Size (Total): 1095333183488 B (1.1 TB)
Size (Converted): -none-
Revertible: No
LV Name: Pacha SSD
Volume Name: Pacha SSD
Content Hint: Apple_HFS

haravikk
Jul 11, 2013, 07:11 AM
while booting off the DVD diskutil cd create couldn't actually create the volume bailing out with an error (didn't take note of it), while repeating the same procedure from the full OS everything worked.
Thanks a ton for letting me know how it went, it's great to hear that it should work! Now I just need to get a move on an update my main machine with this kind of setup; at this rate Mavericks will be out first, heh ;)

Regarding your error, I wonder if it was to do with the block-size? I recently created a CoreStorage volume to encrypt an external drive, and I had a bunch of issues with it complaining about an invalid/unsupported block size (4k I think, or not 4k, I don't remember), but mysteriously restarting fixed the issue for me, while others found running the combo-updater worked, so it may have been a bug in a certain version of Lion, I dunno :)

But many thanks for reporting your findings, I'll have a rummage for a spare drive I can put a boot-partition onto, just in case!

haravikk
Jul 17, 2013, 02:49 PM
Okay, so I've managed to set this up as well!

I had a bit of a rocky start; not completely sure what I did but somehow I messed up the recovery partition that was already on my SSD, which is not good as the installer will fail if it can't create the recovery partition, and won't know how to create one for disks that are part of a core storage volume, so it just gives up instead. Especially annoying since the only spare disk I found for running OS X from during setup was a USB stick which, though it worked just fine, was unbearably slow!
For anyone that manages to do the same though; don't bother trying to recreate the partition yourself, I tried a bunch of guides and none worked. I found the best solution was to remove the core storage volume and just install OS X onto the SSD first, this way it will recreate the recovery partition without issues. Once it's done go back to the external OS X install and then create the core storage volume.

The other fun mistake I made was while having the trouble I decided to recreate the core storage and apple raid volumes from scratch, but deleted the apple raid volume first. This leaves you with a core storage volume that only a recovery partition seems to be capable of "fixing" (deleting), so always toss the core storage volume first! Obvious mistake once you realise what you've done, but if you've been trying to for some time to resolve an issue it's not hard to make a mistake :)

Now that it's all setup however it's running beautifully, here's the setup:
+-- Logical Volume Group 1AD2C384-A042-4FC7-98C0-1346DC7260E1
| =========================================================
| Name: Macintosh HD
| Status: Online
| Size: 3073249730560 B (3.1 TB)
| Free Space: 73728 B (73.7 KB)
| |
| +-< Physical Volume 01461F1E-B0DF-4F00-978B-7D175B2F89D8
| | ----------------------------------------------------
| | Index: 0
| | Disk: disk0s2
| | Status: Online
| | Size: 74000195584 B (74.0 GB)
| |
| +-< Physical Volume 2A9F3CE4-2745-4B1F-96DA-513D93575F84
| | ----------------------------------------------------
| | Index: 1
| | Disk: disk5
| | Status: Online
| | Size: 2999249534976 B (3.0 TB)
| |
| +-> Logical Volume Family FDBEC8B6-C493-49CB-BC70-5A9B884B18DA
| ----------------------------------------------------------
| Encryption Status: Unlocked
| Encryption Type: AES-XTS
| Conversion Status: Converting
| Conversion Direction: forward
| Has Encrypted Extents: Yes
| Fully Secure: No
| Passphrase Required: Yes
| |
| +-> Logical Volume 3204B401-7421-45E2-8C30-7AA62989A6A3
| ---------------------------------------------------
| Disk: disk6
| Status: Online
| Size (Total): 3063425531904 B (3.1 TB)
| Size (Converted): 4177526784 B (4.2 GB)
| Revertible: No
| LV Name: Macintosh HD
| Volume Name: Macintosh HD
| Content Hint: Apple_HFS
And yes, encrypting that 3.1tb is going to take ages! I'm hoping it'll speed up some once I'm no longer running installer after installer and copying files back into place, but it'll get there eventually :)


However, I haven't yet tried adding an additional disk to the pool. The addDisk core storage command is undocumented but seems obvious enough, but I'll probably let it finished encrypting first!

I did try it while fixing my recovery partition though; once OS X was installed on just the SSD I convert to core storage then tried using addDisk to add the Apple RAID volume, but it wouldn't have any of it, but that may just be because it is an Apple RAID. Has anyone else tried adding a disk?

chrisrosa
Oct 23, 2013, 11:15 AM
Did you ever find more info on the subject of how Fusion handles tiering, or any other advanced CS tidbits? I've poked around developer.apple.com and found nothing. Thanks

haravikk
Oct 23, 2013, 11:31 AM
Did you ever find more info on the subject of how Fusion handles tiering, or any other advanced CS tidbits? I've poked around developer.apple.com and found nothing. Thanks
As far as I know it only works if the first physical disk in the pool is an SSD at which point it is the top tier, and everything else is just a continuous disk of some kind. So no ability to designate drives as a 2nd tier or anything like that I can figure out.

Also it doesn't seem to be possible to add devices to a CoreStorage pool that contains an AppleRAID; I'm not sure how well the addDevice command works for regular pools, it's an undocumented command after all.

But yeah, really what we need from Apple are some more options for managing Fusion drives; the ability to specify which disks/partitions belong to each tier would be nice, and I'd love to have the ability to specify cache-only tiers for machines like the Mac Minis and new Mac Pro, so their internal drives would only be used for caching, while an external drive holds a fully working file-system for easy replacement/upgrade of machines.

haravikk
Nov 19, 2013, 12:35 PM
Okay, so I'm now interested to know if anyone's actually had a chance to try an Apple RAID as the first device in the set.

For example:
2x SSDs in Apple RAID-1
2x HDDs in Apple RAID-1

As this could potentially give Fusion Drive speeds but with significantly better safety for your data (can withstand 1 or potentially 2 drive failures).

I'm interested because I'll be moving my HDDs soon to a RAID-5, but keeping the SSD for an internal/external Fusion Drive, but of course that still leaves the SSD as the weak-link so I'm trying to think of how I can mitigate the risk of it failing and was thinking of an Apple RAID-1 with a second SSD, but I'm not able to test the idea.

So, anybody tried this? Does Core Storage recognise an SSD RAID as being a fast device to use, or does it just create a regular concatenated set?

donlab
Dec 22, 2013, 10:10 PM
Okay, so I'm now interested to know if anyone's actually had a chance to try an Apple RAID as the first device in the set.

For example:
2x SSDs in Apple RAID-1
2x HDDs in Apple RAID-1

As this could potentially give Fusion Drive speeds but with significantly better safety for your data (can withstand 1 or potentially 2 drive failures).

I'm interested because I'll be moving my HDDs soon to a RAID-5, but keeping the SSD for an internal/external Fusion Drive, but of course that still leaves the SSD as the weak-link so I'm trying to think of how I can mitigate the risk of it failing and was thinking of an Apple RAID-1 with a second SSD, but I'm not able to test the idea.

So, anybody tried this? Does Core Storage recognise an SSD RAID as being a fast device to use, or does it just create a regular concatenated set?

SSD raid 1 is a bit of an overkill IMHO. Just get a good SSD that is over provisioned and you're good to go. No need for the raid 1 setup. I like the raid 1 idea for the second tier however.

haravikk
Dec 23, 2013, 07:34 AM
SSD raid 1 is a bit of an overkill IMHO. Just get a good SSD that is over provisioned and you're good to go. No need for the raid 1 setup. I like the raid 1 idea for the second tier however.
You're probably right, but even so I'm curious to know if it works or not. I'm not sure how good AppleRAID-1 handles it, but I know that hardware RAID-1 can also potentially deliver better performance since data can be loaded from both drives simultaneously.

haravikk
Apr 9, 2014, 05:21 AM
Okay, so I was actually able to speak to an Apple engineer, and they said that Core Storage tests the actual speed of a physical volume when deciding which one to designate as the top-tier. This means that it may not matter which order you add your disks to a core storage volume, it will always try to create a Fusion Drive with the fastest one as the top-tier in the set; presumably there's still some minimum speed difference (so if two disks are the same speed then it won't bother). I couldn't get an answer as to whether Core Storage will set more than one tier, e.g - if you had an SSD, a fast HDD and a slow HDD, would it result in the SSD being tier 1, the fast HDD tier 2 and the slow one as the bottom tier?

This should mean that a RAID-1 of SSDs, acting as the top-tier for another, high capacity RAID volume should work as expected, with the SSDs functioning as a fast top-tier, but with the added benefit of redundancy.

Of course I still don't have a second SSD to test with myself, but it means that if I get one I may actually be able to have a RAID-1 of SSDs accelerating my RAID-5 of HDDs. I'd still be interested to know if anyone has, or can, give it a try to see if actually works though!