Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've decided on creating a NAS running FreeNAS using a software RAID 5 setup. I want to start the RAID with 2x2TB drives and slowly add more 2TB drives as I go. Is this possible? If I have a full RAID 5, can I add another drive to it without erasing the previous drives?

share|improve this question
4  
You need a minimum of 3 disks for raid 5 to start with. –  Matt H Mar 5 '12 at 18:25
2  
I haven't tried it recently, but Linux software RAID5 was able to create a 2-disk RAID5, and worked fine, including degraded operation and rebuild. Think of a two-disk RAID5 as a computationally expensive RAID1. But it does buy you the ability to add disks later. –  retracile Mar 5 '12 at 18:46
    
@retractile - interesting. Thought I'd look that up and sure enough it's true. With 2 disks it acts like a mirror. arkf.net/blog/?p=47 –  Matt H Mar 5 '12 at 22:13

2 Answers 2

up vote 5 down vote accepted

I have a server using md for a software RAID5, which I have grown multiple times in the past.

It's a pretty simple process.

First, we add our new device to the raid array. /dev/sdX is the device you want to add to the RAID group.

sudo mdadm /dev/md0 --add /dev/sdX

And now we resize the array. N should be the number of devices in the group (including the new one).

sudo mdadm /dev/md0 --grow --raid-devices=N

After that the lengthy rebuild process will start moving around data. Observe the process by using:

watch cat /proc/mdstat

When that is done, you'll have a larger RAID volume with all your data intact.

share|improve this answer
    
Looks good to me, thanks mate. –  maxmackie Mar 5 '12 at 18:31
  1. If you are using raidz or raidz2, you cannot add more drives to that particular set once you create it.

  2. You can, however, create another raidz or raidz2 and add it to that pool.

  3. Remember though, with two drives you can only mirror.

Take a look at this

share|improve this answer
    
I'm not setting up a RAIDZ, just a standard RAID5 array. –  maxmackie Mar 5 '12 at 18:17
1  
OK, you will still need more than two drives though. If you are using a RAID card supported by freeNAS, and it has the ability to access the controller card via a webGUI, you can theoretically access the card and expand the RAID. In my experience though, freeNAS plays better with standard HBA's. One of the great benefits of freeNAS though is the ability to implement zfs using raidz or raidz2. –  thomas Mar 5 '12 at 19:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.