Jump to content
eep357

[How-to] Software RAID-0 in Mountain Lion on ICHx/JMicron/Marvell/ASMedia

26 posts in this topic

Recommended Posts

This guide is for setting up Apple software RAID-0 on any SATA controller or combination of controllers that support booting into OSX. A few things to keep in mind, first being that I am not responsible for any loss of data, loss of hair, or hardware damages if they were to occur. RAID-0 is built for speed and that's about it, so if you care about data parity this is not for you. RAID-0 will stripe your data across 2 or more drives, which means if any one of them fails, you will loose your data. Time Machine or other backup is highly recommended.

While in the past RAID-0 helped to speed up the physical limitations caused by older rotational hard disks, on SSD drives with their faster read/write speeds, It is usually the SATA port of the controller that becomes the bottle neck, and splitting that bandwidth up can have dramatic results for some people. Picking which controller or controllers to use is a major factor in what your final results will be, and any controller that is buggy, ejects drives randomly or causes any headaches now, don't use it or you'll probably regret it. Although I don't recommend swapping your configured RAID array drives around to different ports, one benefit of software RAID is you can with little chance of a problem, unlike HW RAID where it's bound to that controller. So...

 

pre-setup:

First we need something to put onto our array once we make it, and using the Mountain Lion Installer to do a clean install to your RAID, will result in an installation failure when the installer complains about not being able to make a recovery partition on a RAID. I've been able to instead restore from a Time Machine backup onto the new array by booting into the Mountain Lion Installer, but others have received the same Recovery Partition error when trying this as well. You also wan't to only make your Mountain Lion RAID while booted into Mountain Lion, as Lion or older versions will not know how to properly make the kernel caches and the array will not be bootable. So you'll need an extra drive with Mountain Lion installed. Boot into that drive.

 

Let's-Go:

Build array in disk utility. When prompted, choose whatever block size you want to use, default value recommended.

ST31500541AS Media-1.jpg

Here's how it should look, I enabled Disk Utility to show hidden partitions not normally visible.

Mikuru-1.jpg

Now use CarbonCopyCloner or similar to clone your working Mountain Lion install over to the RAID array.

Chameleon will need to be installed to each drives hidden "boot OSX" partition along with /Extra on each and kernel cache will be built on each. OSX cannot boot without kernel cache, i.e. -f, or will get error "mach_kernel not found". In /Extra folder of each "boot OSX" partition, in org.chameleon.boot.plist, you must include additional kernel flag

rd=uuid boot-uuid="UUID of your RAID array here, use Disk Utility and select array then Get Info"

Get UUID here:

Mikuru.jpgInformation_ Mikuru.jpg

Most the boot process takes place from the cache, then once the soft raid kexts are loaded, system can then find the array to finish booting, without this you will get "still waiting on root device"

 

Here is my entire org.chameleon.Boot.plist so you can get an idea of how it should look:

org.chameleon.Boot.plist.jpg

 

As mentioned, Chameleon, along with your Extra folder and updated org.chameleon.Boot.plist all need to be installed onto the boot helper partitions, which are hidden by default and called "Boot OS X", I have seen them without space too like "Boot OSX". They are not striped and are not part of the RAID array, making them readable by the BIOS and by Chameleon. To install Chameleon to the "Boot OS X" helper partitions, First find out the disk # for each one using Terminal and diskutil command and make note of the Disk #, the partition #'s will always follow the same layout where "Boot OS X" will be partition 3( s3 ):

diskutil list

Make note of the disk # for each drive that will make up your array ( rdiskX ) where X is the drive #

Rather than run the Chameleon installer, install the 3 needed Chameleon boot files manually. They are; boot, boot0 and boot1h. If you have Chameleon package installer, they can be extracted to the desktop with Pacifist, or if you grab the binary you can just copy them right over. Either way, put them on the desktop for now along with Extra folder and edited org.chameleon.Boot.plist inside of it along with usual contents like DSDT. The last bit will all be done in terminal. For demonstration purposes, I assume my first hard drive of the array is rdisk1 and the 2nd is rdisk2, substitute with your own BSD drive number obtained via diskutil above.

 

cd to desktop:

cd ~/Desktop

enter root

sudo -s

install boot0 to MBR, we don't need to worry about partition # here, just the disk #:

fdisk -f boot0 -u -y /dev/rdisk1

fdisk -f boot0 -u -y /dev/rdisk2

Then to install boot1h

dd if=boot1h of=/dev/rdisk1s3

dd if=boot1h of=/dev/rdisk2s3

then need to mount one of the helper partitions to copy our remaining files over, and once done, unmount it then repeat the process for the 2nd helper partition:

diskutil mount disk1s3

cp boot /Volumes/Boot\ OS\ X/

cp -R Extra /Volumes/Boot\ OS\ X/

diskutil unmount disk1s3

Be sure to unmount the Boot OS X partition before mounting the next one, because if 2 are mounted at the same time, the system will rename one of them to Boot OS X 1, possibly causing some problems for you. Repeat for other partition, will condense into short version cause this post is getting long:

diskutil mount disk2s3
cp boot /Volumes/Boot\ OS\ X/
cp -R Extra /Volumes/Boot\ OS\ X/
diskutil unmount disk2s3

Here's what mounted Boot OSX partition should look like:

Boot OS X.png

Now you can have either drive listed as your boot device in BIOS, and pick either Boot OSX partition from Chameleon's boot menu, and your RAID will boot either way. That's it, if done right you should have working, bootable RAID-0.

 

Optimizing:

Picking which controllers to put your drives on will largely depend on your hardware. Keep in mind, since they are both read and written to at the same time, your bandwidth will be limited to that of your slowest connection, but since they are both reading and writing at the same time, the combined load on that bus can also be a factor. So as an example, I have Intel SATA 2, Marvell SATA 3 on-board and PCIe 2.0 x1 ASMedia SATA 3 card. With a single SSD hooked up, the ASMedia is the faster of the three, but when using both drives of the array on that same ASMedia card, there is almost no increase in performance, because a single SATA 3 connection running full tilt is enough to use all the bandwidth available via the x1 PCIe 2.0 connection. The Marvell, which normally falls in between the ASMedia and the Intel, suffers from similar over saturation with both drives, so putting both on the Intel SATA 2 control is actually faster due to it's overall bandwidth. What ended up being the best for me, was to split that bandwidth by putting 1 drive on the ASMedia controller and the second on the Marvell Controller, allowing both to run at the full speed of the slowest link, so both are running at what would be the Marvell's max speed with just one drive. The difference in read speeds is pretty dramatic, where both drives together on any of the controller's would max at around 500mb/s, this combination will max out at 800mb/s and has added benefit of leaving Intel controller available for other uses like a possible Windows Hardware RAID.

Mac Pro.jpg

 

iCloud, iMessage or other Apple server login errors:

This should not be needed as it was fixed in Chameleon 2+ years ago, but I have seen a few instances in ML where it's been required and even a bit more common on a RAID-0 setup. Chances are if your having trouble logging into iCloud, the Appstore or any other apple run services, this is not the reason why and following the usual how-to for iCloud fix will be what is required, but if everything else has been set up perfectly and you are still having issues logging into iCloud, follow the pictures and see if it helps

 

Open IORegistryExplorer

IODeviceTree1 — platform.jpg

 

Copy to Text Edit then get your ethernet MAC address

Mac Pro en0.jpgUntitled 3.jpg

Changes will need to be applied to org.chameleon.Boot.plist in both your Boot OS X partitions

 

Now after rebooting, if done right you should now see this

IODeviceTree — platform.jpg

 

disclaimer #2: Everything in this guide, I read somewhere, sometime, someplace at some point and did not invent any of it myself. Most the words used can also be found in any English dictionary, with only a few exceptions patent pending such as the word "the", which I will be registering as trademarked once the paperwork arrives, until which time I will permit it's use as open source under the GNU general public license.

Share this post


Link to post
Share on other sites
Advertisement

Great tutorial. Love it. Since you are having an onboard SATA3 and my Asus P6T doesn't have one, I've bought a Asmedia ASM1061 PCIe card and you are right about no performance gain if 2 x SSD are put together into the card. So my question is, if I buy another ASM1061 card and split the SSD among them will I see any improvement in read speed. At the moment I'm getting 383MB/s read on my Intel 330 60GB RAID0 SSDs. I'm expecting to get around 600MB/s for these SSDs ( yeah I know Intel 330 is not the fastest ).

Share this post


Link to post
Share on other sites

that depends on your PCIe slots, to run the ASMedia card at full speed, required a PCIe 2.0 slot, while on most i7 boards, only the full size x16 slots for graphics cards are also 2.0 spec. Also since PCIe slots tend to share bandwidth, using any of the available PCIe slots can cause the speed on your GPU slot to drop. I'm able to run 2 graphics cards at full x16 speed on my board, and those are also the only 2.0 slots, since I only have one graphics card, the tiny sata card is in the second x16 slot. If I added another card, it would have to go in the 1.0 x1 slots and could not achieve full speed and iirc would also drop by 2nd x16 PCIe 2.0 down to x8 (which shouldn't matter because I'm only using x1 lane with the sata card anyway) or the primary slot which would cut into my GPU bandwidth. Take a look in the manual for your board at ASUS site and it will say which ones are 2.0 and what the speeds will be when filling different slots on the board. I'd check that now with the one you have as you should be able to get around 500mbs before reaching the limit of the 2.0 PCIe bus. Either way, you'd probably see the best speeds now with one on Intel sata 2 and the other on ASMedia, or maybe even both on Intel sata 2

Share this post


Link to post
Share on other sites

thanks epp for the reply. atm my asm1061 is on the first blue xlot which is pcie 2.0 x16 and myg gtx260 is on the second blue slot pcie 2.0 x16 too. my usb 3.0 pcie is on the white pcie 2.0 x1. oy left is the pcie 2.0 x4 slot. i'm thinking putting another asm1061 on that.remaining slot.

 

Edit : I just try using the ASM1061 PCIe card and Intel SATA2 and the result is really amazing. I got 506/512MB/s for read and write with AJA. Here is the screenshot. So if I get another ASM1061 card will I get to 600MB/s ? If not better I just save the money.

 

RAID0 with both SSD on Asmedia ASM1061 Card

SSDRAID0_1.png

 

RAID0 with one on Asmedia ASM1061 and another on Intel ICH10R SATS2

SSDRAID0_2.png

Share this post


Link to post
Share on other sites

Wow! Great improvement! As long as there's not a bottle neck on the PCIe bus overall, I don't see any reason why you wouldn't see something similar to what your expecting. If all else were equal, the overhead from software raid vs hardware raid is actually quite minimal. Since the ASMedia cards are in the $25 range, it probably wouldn't hurt to try. Gotta figure too, if being limited by the bus/ports, upgrading to faster SSD's won't help. Plus one on the AJA too, Blackmagic doesn't work right in ML and neither does the disk speed check in NovaBench. There's a bit of an older app called DiskTester that works really well too. For AJA to work right for me in Mountain Lion, due to sandboxing, have to run it as root, easiest way is to use an app by the same name "run as root"

Share this post


Link to post
Share on other sites

thanks for the info, really appreciate it. yeah i bought the ASM1061 for only $11 (free shipping) so it wouldn't hurt so much if I get another one.

 

BTW, here is my AJA score launched using LaunchAsRoot app.

 

SSDRAID0_2B.png

Share this post


Link to post
Share on other sites

hi tot318... i have see your very good performance with you RAID and change from PCIe x16 Slot 2 to Slot 1.

I have this tries, i have only 1 SSD Intel 330 Serie with 180GB Sata3 and see not performance change.

 

i have we you, on your Screen in Slot1, the same results.

 

Question:

 

How can change I increase the performance of Non-RAID volume to around 500 MB / s?

Share this post


Link to post
Share on other sites

hi tot318... i have see your very good performance with you RAID and change from PCIe x16 Slot 2 to Slot 1.

I have this tries, i have only 1 SSD Intel 330 Serie with 180GB Sata3 and see not performance change.

 

i have we you, on your Screen in Slot1, the same results.

 

Question:

 

How can change I increase the performance of Non-RAID volume to around 500 MB / s?

 

Intel 330 series are not the fastest SSD in the market. Although the specs says that you can achieve 500MB/s but that is only marketing gimmick that you shouls aware of. Furthermore when using a SATA 3/6Gbps PCIe card, you can't get the max performance rated as 6Gbps or 750MB/s. If you really want a fast SSD in benchmark you should opt for Samsung 830, there might be a chance to hit 500MB/s or around 450-480MB/s in non RAID setup.

 

If you ask me whether I can feel the difference in real world environment between 300MB/s and 500MB/s ? The answer is not really. Difference 1-2 secs faster in launching an application really can't feel the difference. Only on benchmarks you can see it. Just be happy with your Intel 330 180GB as it really make a big difference when compare to mechanical drives. For me Intel 330 is worth the price of it's performance.

Share this post


Link to post
Share on other sites

I can vouch for the speeds of the Sammy 830 as I have it in my current raid0 setup and it's quality does differ from that of my Sandisk SSD but is on par with my HyperX SSD. Honestly though, that 200mb/s difference he mentioned you won't see that much in real world usage unless you religiously move around large files because most of the time you do random IOs which don't happen at your SSDs true speeds but rather more slowly because it isn't sequential IOs.

 

If you're going to be raid0'ing 2 SSDs though, you'll certainly see a more than acceptable speed increase whether you're on SATA II or SATA III.

 

Another note, if you're trying to achieve 500mb/s speeds on an SSD it is highly advisable that you go for the 256gb+ sizes because they carry more onboard NAND cells than the 120gb and 60gb flavors. Those added NAND cells are needed to achieve the marketed advertised speeds on the box.

Share this post


Link to post
Share on other sites

thanks for the info, really appreciate it. yeah i bought the ASM1061 for only $11 (free shipping) so it wouldn't hurt so much if I get another one.

 

BTW, here is my AJA score launched using LaunchAsRoot app.

 

 

 

can you specify the model? tnx.... :D

Share this post


Link to post
Share on other sites

hi eep357

thank you for the post, i managed to do this and can boot RAID, a strange things happen after the boot...some time i see the mount/unmount

Boot OS X messages

appears ...is that normal?

 

 

 

AJA results 380 read/write cool..

Share this post


Link to post
Share on other sites

No I wouldn't call that normal. Make sure your caches are building properly and check console after seeing that for any more info. Also can try setting the other RAID drive as the primary boot drive for BIOS/Chameleon and see if it's any different. What controller's are each drive on?

Share this post


Link to post
Share on other sites

Just run the script, and this is written in Italian how to make the process

 

1)

 

Enter the number of the first Raid disk

2)

Enter the number of the second Raid disk

3)

Enter the File location: boot

4)

Enter the file location: boot0

5)

Enter the file location: boot1h

6)

Add folder address: Extra

7)

 

 

Now copy the boot files and the Extra folder in both volumes Boot OSX

 

 

 

If you have any problems do not hesitate to ask for information

BOOTOSX_Installer_RAID.zip

Share this post


Link to post
Share on other sites

Mind listing your specs? 1 gb/s read speeds aren't out of the norm on a well paired set of SSDs in a R0 array believe me. Dependent on the controller you use of course but those speeds (as sequential) are certainly possible.

Share this post


Link to post
Share on other sites

Allowing caching can have impact on benches too, should disable it for testing

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Taruga
      Problem solved 

      This is the way I did it

      Lets suppose that disk16 and disk17 are the disks to create the Raid 0 

      After the first command to create the raid, 2 extra disks (disk18 and disk19) will show up if you do a diskutil list
      diskutil appleRaid create stripe raid0 apfs disk16 disk17
 diskutil unmountDisk disk18 diskutil unmountDisk disk19 sudo gpt create disk18 sudo gpt add -b 40 -s 409600 -i 1 -t C12A7328-F81F-11D2-BA4B-00A0C93EC93B disk18 sudo gpt add -b 409640 -i 2 -t 7C3457EF-0000-11AA-AA11-00306543ECAC disk18 sudo newfs_apfs disk18s2
 diskutil mountDisk disk19  
      This is diskutil list output before the above commands
       
      dev/disk16 (external, physical): #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme *320.1 GB disk16 1: EFI EFI 209.7 MB disk16s1 2: Apple_HFS Sem nome 319.6 GB disk16s2 /dev/disk17 (external, physical): #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme *320.1 GB disk17 1: EFI EFI 209.7 MB disk17s1 2: Apple_HFS Sem nome 319.6 GB disk17s2  
       
      After diskutil appleRaid create stripe raid0 apfs disk16 disk17 , diskutil list displays:
       
      dev/disk16 (external, physical): #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme *320.1 GB disk16 1: EFI EFI 209.7 MB disk16s1 2: Apple_RAID 319.7 GB disk16s2 3: Apple_Boot Boot OS X 134.2 MB disk16s3 /dev/disk17 (external, physical): #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme *320.1 GB disk17 1: EFI EFI 209.7 MB disk17s1 2: Apple_RAID 319.7 GB disk17s2 3: Apple_Boot Boot OS X 134.2 MB disk17s3 /dev/disk18 (external, virtual): #: TYPE NAME SIZE IDENTIFIER 0: Apple_APFS +639.5 GB disk18 /dev/disk19 (synthesized): #: TYPE NAME SIZE IDENTIFIER 0: APFS Container Scheme - +639.5 GB disk19 Physical Store disk18 1: APFS Volume raid0 839.7 KB disk19s1  
      And after the rest of the commands, diskutil list displays:
       
      dev/disk16 (external, physical): #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme *320.1 GB disk16 1: EFI EFI 209.7 MB disk16s1 2: Apple_RAID 319.7 GB disk16s2 3: Apple_Boot Boot OS X 134.2 MB disk16s3 /dev/disk17 (external, physical): #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme *320.1 GB disk17 1: EFI EFI 209.7 MB disk17s1 2: Apple_RAID 319.7 GB disk17s2 3: Apple_Boot Boot OS X 134.2 MB disk17s3 /dev/disk18 (external, virtual): #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme +639.5 GB disk18 1: EFI 209.7 MB disk18s1 2: Apple_APFS Container disk19 639.2 GB disk18s2 /dev/disk19 (synthesized): #: TYPE NAME SIZE IDENTIFIER 0: APFS Container Scheme - +639.2 GB disk19 Physical Store disk18s2 1: APFS Volume untitled 897.0 KB disk19s1
      Now, disk18 has a GUID_partition_scheme  which it didn't had before.
      And disk19 it's the APFS formated volume ready to install the OS.
       
      ---------------------------

      Obs:
       
      sudo gpt add -b 40 -s 409600 -i 1 -t C12A7328-F81F-11D2-BA4B-00A0C93EC93B disk18 sudo gpt add -b 409640 -i 2 -t 7C3457EF-0000-11AA-AA11-00306543ECAC disk18
      The above GUID's used were taken from https://en.wikipedia.org/wiki/GUID_Partition_Table
       
      EFI System partition C12A7328-F81F-11D2-BA4B-00A0C93EC93B Apple APFS 7C3457EF-0000-11AA-AA11-00306543ECAC -------------- And for HFS+, if anyone needs: Hierarchical File System Plus (HFS+) partition 48465300-0000-11AA-AA11-00306543ECAC But with HFS+, then instead of: diskutil appleRaid create stripe raid0 apfs disk16 disk17 sudo newfs_apfs disk18s2 Should be used: diskutil appleRaid create stripe raid0 JHFS+ disk16 disk17 sudo newfs_hfs -v raid0 disk18s2

      Video demo link:

      Youtube



       
    • By dukzcry
      Here's my driver for LSI MegaRAID SAS family of controllers called SASMegaRAID.kext. This one was requested few times at InsanelyMac and other Mac-related communities.
      Download link https://github.com/dukzcry/osx-goodies/releases or https://www.insanelymac.com/forum/files/file/306-sasmegaraidkext/
      F.A.Q.:
      Q: I can't manage controller via supplied utility
      A: Only monitoring functional is supported, management is done via controller BIOS
      Q: Any chance to make cards based on SAS2208 chip work?
      A: Not currently, the chip belongs to the same family, but it requires a lot of handling different from common handling for supported cards.
      Q: The driver loads but my device doesn't show up anywhere in profiler. What should I do?
      A: Try inverting "PreferMSI" key value. It's under "Settings" dictionary in kext's plist. 
      Q: macOS doesn't see my volumes
      A: Set them as virtual (logical) disks in controller's BIOS. If no luck try "Uncontiguous enumeration.zip" version. See full issue report https://www.insanelymac.com/forum/forums/topic/285197-driver-for-lsi-megaraid-sas-family/?do=findComment&comment=1987665
      Q: Is it possible to push more from my setup?
      A: It may be.
      The plist from "Unsafe settings unlocked.zip" allows tweaking of dangerous options. Before playing with them you need to detach all HDDs with critical data and attach some spare HDD for doing the tweaks. The "MaxSGL" option is number of scatter gather list entries you controller can handle. The "MaxTransferSize" determines the maximum size of data transfer (in bytes) per request your controller can catch. If you set them to some enormously big value then they will be truncated to the max values your hardware can achieve (may still be not safe enough for successful data transfers). "MaxTransferSizePerSegment" does the same but for a single SGL entry (will never be larger than MaxTransferSize). For the tests you need to stick to the system.log and start a transfer of a >= 100gb data. If the settings you set are inappropriate, you'll see the I/O errors.
      Q: My Mac stopped to go sleep after i've loaded your kext.
      A: This is awaited. See https://www.insanelymac.com/forum/forums/topic/285197-driver-for-lsi-megaraid-sas-family/?do=findComment&comment=1986269 Use kext from "Unsafe settings unlocked.zip" and set "AllowSleep" key to true.
      Q: Your driver doesn't work for me. Are there any alternatives?
      A: Yes there is one https://www.insanelymac.com/forum/forums/topic/314799-guide-z820-el-capitan-the-great-guide-sucess/?do=findComment&comment=2556863
    • By dukzcry
      This is kext for LSI MegaRAID SAS family of controllers
      Topic: https://www.insanelymac.com/forum/topic/285197-driver-for-lsi-megaraid-sas-family/
       
    • By Dallastyle
      Hello Insanelymac,
      I've successfully installed Mac OS X Sierra on 2 32gb flash drives with them as a JBOD Raid. I can only get into the hackintosh if I use another USB flash drive with Clover installed on it. I've tried using a clover installer however that just installs on my Raid Disk. I've also noticed that when I open clover configurator, there are 2 EFI partitions but both of them were empty. I've tried moving the contents of the EFI on my Raid disk that clover installed but my BIOS does not detect it. Also when I use the other flash drive to boot into clover, there is another volume called "BOOT OS X" right next to my Raid Disk Volume that I use to boot from. I just want to install and boot off of my Raid usb flash drives. Really running out of options, Thanks guys.
×