When you create a RAID using Terminal, what are the default block size and rebuild options?

Discussion in 'OS X El Capitan (10.11)' started by madhatmac, Jan 10, 2016.

  1. madhatmac macrumors newbie

    Joined:
    Jun 25, 2013
    #1
    Hi folks,

    I may need to set up a RAID mirror using Terminal in El Capitan (never used Terminal before but it doesn't look too hard...). Anyway, in previous Disk Utilities, it let you select options for RAID Block Size (16K, 32K, 64K, 128K & 256K options) and to select "Automatically rebuild RAID mirror sets" if desired.

    So, what are the default settings when running a basic Terminal command like:
    diskutil appleRAID create mirror [RAIDname] JHFS+ disk2 disk3

    And, if one wanted to alter these settings, how do you go about it?

    Thank you
     
  2. KALLT macrumors 601

    Joined:
    Sep 23, 2008
    #2
    I do not know much about this topic, so you may have to do a bit more research yourself (or play around with the settings). If you have not done so, read the manual page first: here or in Terminal with man diskutil. Apparently, there is no option to choose the RAID block size and automatic rebuilding upon creation with diskutil. Disk Utility used 32K as the default and automatic rebuilding was not selected by default, so it is likely that diskutil will maintain the same defaults. I have no idea about the block size, however, you can enable automatic rebuilding with the command:
    Code:
    diskutil ar update autorebuild 1 [raid volume]
     
  3. Gav2k macrumors G3

    Gav2k

    Joined:
    Jul 24, 2009
    #3
    http://www.tekrevue.com/tip/create-raid-el-capitan/
     
  4. madhatmac thread starter macrumors newbie

    Joined:
    Jun 25, 2013
  5. madhatmac thread starter macrumors newbie

    Joined:
    Jun 25, 2013
    #5
    One more question...

    If a drive in the mirror set were to fail, how would you via Terminal:

    - Add a replacement drive to the set
    - Rebuild the set so the data is on the new drive

    Thank you
     
  6. KALLT, Jan 14, 2016
    Last edited: Jan 14, 2016

    KALLT macrumors 601

    Joined:
    Sep 23, 2008
    #6
    See the manual page I posted above. If you want to get comfortable with Terminal then you should get used to the built-in manuals of CLI programs, because they can be incredibly helpful.
    Code:
    diskutil ar remove [old device] [raid volume]
    diskutil ar add member [new device] [raid volume]

    This should take care of things automatically, including rebuilding. However, if this does not work then you need to enable auto-rebuilding as I posted above (this setting won't change when you add a new member), or manually invoke:
    Code:
    diskutil ar repairmirror [raid volume] [new device]

    You can always find the device identifiers with:
    Code:
    diskutil list          #to find the identifier of the device that you want to add, like disk5
    diskutil ar list       #to find the identifier of the raid volume and individual disks for removal
     
  7. madhatmac thread starter macrumors newbie

    Joined:
    Jun 25, 2013

Share This Page