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.

So right now I have a HTPC with (3) 1TB harddrives Software-Raid5'ed giving me something like 1.9TB of storage available for recording TV shows / media / backing up my DVD's.

As I'm about 50GB off from this cap, so I've been doing research.

My HTPC case supports 4 drives, and i'm looking for a somewhat long-term solution for upgrading over time.

What I figure I'll do is this:

Since 2TB Hd's are like 15$ more, I'll buy a 2TB Harddrive, and add it to my RAID5 array. This (theoretically) should give me an additional 1TB of storage (Since it should use the lowest drive size as the amount of data to replicate.)

When I need more space, buy (3) 2TB harddrives, and replace them one by one, until I have 4 Physical 2TB harddrives, with that are 50% used. My question is this.

Once I hit that point, can i expand the amount of storage each drive is using for raid5?

I'll have 8 Terabytes physically available, but only ~3 terabytes partitioned. Can I then expand the space used on each drive to give me the full n-1 (~6TB)?

I'm using Ubuntu 11 Desktop, running XBMC.

share|improve this question

1 Answer 1

up vote 3 down vote accepted

Yes, you can. I have successfully done this with my own fileserver, though I probably would not recommend it and will not being doing it again due to the strain on the harddisks (rebuilding the array is time-consuming and stresses the harddrives, and if one of the harddrives legitimately fails while you're rebuilding onto the new drive, your data is gone). If you're like me and are alright with the potential that you'd have to replace the data (it was just media after all, so I could always reacquire it from the source) and are interested in learning more about the capabilities of mdadm, then this can be a fun project.

That being said:

  1. Buy 2TB harddrive
  2. Put in system, tell mdadm to reshape the array to 4 disks. This may take a day or two, depending on drive speed.
  3. Assuming your filesystem supports growing, tell the filesystem to grow to fit the new space available on the raid device. Otherwise, create a new partition and filesystem on the newly allocated space, and use that in addition to the first partition.

Then, later on down the road:

  1. For each 1TB disk, fail the disk from the array and remove it, replacing it with a 2Tb disk and then wait for the entire array to resync before continuing on to the next disk. Don't be surprised if it takes somewhere in the neighborhood of 24 hours per disk.
  2. Tell mdadm to grow the array to fill the entire disk
  3. Same as #3 from above.
share|improve this answer
    
Thanks a ton; I didn't think of failing the disks and regrowing them. –  GruffTech Jul 16 '11 at 16:26
    
Out of curiousity, What happens when the lowest common denominator is no longer 1 terabyte? So when I take that final step from (3)2TB drives & (1)1TB drive, to a full (4)2TB harddrives? Does ubuntu / mdadm just "see" that the lowest common denominator is no longer 1TB and allows you to scale the file system higher? Just kinda preparing before i end up getting stuck having to backup this data some how. –  GruffTech Jul 16 '11 at 16:33
1  
@GruffTech It's not so much that it "updates" as it is that it just does what you tell it to do, and will reject the operation if it can't. You could tell it to grow the array to 2TB per disk now, and it'd just say that it can't do that. However, once all the drives are replaced, telling it to grow the array will succeed, and you'll have a larger array to work with. You'll want to read the manpages for mdadm's --size option. –  Darth Android Jul 16 '11 at 16:42

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.