TS-509 Raid expansion

Questions about SNMP, Power, System, Logs, disk, & RAID.
Post Reply
saitou187
New here
Posts: 6
Joined: Sat Aug 30, 2008 12:50 am

TS-509 Raid expansion

Post by saitou187 »

Hi All,

I've got a TS-509 that I'm currently testing out and had some questions about the raid expansion and the time it takes. Here is the current drive configuration, test cases to follow:

Drive 1: WD2500JD-75HBB0 08.0 - 232.83 GB
Drive 2: WD2500JD-75HBB0 08.0 - 232.83 GB
Drive 3: Maxtor 7Y250M0 YAR5 - 232.83 GB
Drive 4: Maxtor 6Y160M0 YAR5 - 149.01 GB
Drive 5: Maxtor 6Y160M0 YAR5 - 149.01 GB

My first test was building raid1 array with drive 4&5, time it took was roughly 1hr.
The second test was to migrate the raid1 array to a raid5 using drive 3, time it took was roughly 1hr as well.
The third test was to expand the raid5 (which was migrated) using drive 2. That was estimated to take 30 hours by examining /proc/mdstat. It's been 10 hours since I've started that process and /proc/mdstat is saying I've got another 1308 minutes (~21hrs) at a speed of 1322K/sec.

Now, the question is why so long for the expansion on such small drives? If i were to build a raid5 array from scratch using those 4 drives it would have taken maybe 2 hours at most. Any insight would be greatly appreciated :)

update #1:
The raid5 expansion finally completed, total time was 28hrs. I have now started a second expansion using drive one, that is estimated at 37hrs. For another test, I decided to power down the unit during expansion (it was at 4%) and after the system fully booted, it continued the expansion automatically right where it left off.
Marl64
Starting out
Posts: 12
Joined: Thu Aug 21, 2008 12:54 am

Re: TS-509 Raid expansion

Post by Marl64 »

saitou187 wrote:Now, the question is why so long for the expansion on such small drives? If i were to build a raid5 array from scratch using those 4 drives it would have taken maybe 2 hours at most. Any insight would be greatly appreciated :)
As I don't know the inner workings for the RAID, I can only speculate, but I can add some timings of my own ;

Started with a Single Disk, same size - In fact all disks are the same (Seagate ST3250310AS 3.AA - 232.89 GB)

Performed basic installation on single disk, configured NAS and versious services, set up defaults shares etc.

Step 1 - Expanded to 3 disk RAID 5 - Total Time 2 Hours;

This was performed in 2 steps, preparing the new disks took about 30 minutes, expanding the raid about 90 minutes more. The interesting thing is that this was shown as one operation, so the %age advanced faster for the first 50% (30 minutes) than the second 50% (90 minutes).

Tip: Progress % seems to represent activity rather than time

Added data to the disk to to fill about half of the now available 450Gig - this was at the maximum network speed so only indicated the NAS can match my network.

Step 2 - Expanded 3 Disk RAID 5 to 5 Disk Raid 5 - Total Time 40 Hours;

Again the % was deceptive, for the first 24 hours or so it maintained 1% per hour and only three drives were running in sync.

Sometime after this - I do sleep you know - the fourth drive started to run in sync and the % started to advance faster than the hours. 36 hours in it was at 50%. The 40 hours total was based on the logs as it finished when I was at work.

So to summarise;

Single disk to 3 disk RAID 5 (minimum data) - 2 hours
3 Disk RAID 5 to 5 Disk RAID 5 (half capacity) - 40 hours

As to why? Safety!

RAID has one purpose - to protect your data in the event of drive problems - so any RAID operation has to follow this principal with the possibility that it could happen at any time, and at any point in the operations.

Migrating from single disk to 3 disk RAID 5
-------------------------------------------

Single disk has no protection so the emphasis of this operation is to protect the data quickly, the best way to do this would be to mirror it initially and calculate parity as a secondary step - Like I said this is an ideal scenario as I don't know the RAID system used here.

I'm not giving a lesson on RAID here so won't go into the fiddly about what's going on, but suffice to say for most of the operation it will be reading from 1 drive and writing to all three.

Every bit of the drive has to be processed irrespective of the amound of data, as even empty sectors need parity - though raid systems usually have shortcuts for this.

Migrating from 3 Disk to 5 Disk RAID 5
----------------------------------------

RAID operations don't get much more complex than this, this is probably the most time consuming operation as it involves a lot of work. The same is true for four, six or eight disks - redistribution of a Raid 5 set is Slooooow. But not as slow as RAID 6 ;)

Remember a drive failure at any time must be recoverable so before any data can be overwritten or erased from one drive, there must be a safe copy elsewhere.

Because we're adding drive, space is not the issue it's moving that space around that takes the time.

I would guess that the system maintains the 3 disk RAID until as late as possible in the process as the part built 5 DISK is not yet fully recoverable.

So all it has to do is read data from three disks, discard the old parity, recalculate the new parity and write it back to 5 disks right?

Well no, because it can't overwrite the source data so it has to put it somewhere else. The data will never be written back to the same part of the disks as it came from as a power failure during this operation would lose data. It can't put it on the new drives temporarily as this data would not offer the protection that RAID is supposed to guarantee.

So it can only put it on an empty part of the existing 3 disks.

The best way to picture this - though not the way it physically happens is think for the disks as cylinders (the typical RAID diagram), it squashes all the (3 Disk) data down to the bottom of the three disks and starts to build the 5 disk raid at the top.

Physically it's different matter as "squashing data down" really isn't feasible when it comes to hard disks.

In addition, the fact that my rebuild sync'd 4 disks first suggests a 2 step rebuild, but the speed of the 2nd step (10 hrs) compared to the first (30 hrs) suggests it didn't migrate via a 4 disk raid in the true sense but possibly some intemediate internal format.

And this is the reason for the time, it has to keep shuffling data around like a giant tetris game until everything is where it should be and at no time must there be unprotected data anywhere.

It's a bigger job than you might imagine.

But Wait, There's more
------------------------

The RAID migration is a big job to start with, but on a live NAS you have the added compication that the data is still in use.

The system isn't just having to migrate static data, it's migrating a live operational file system which could be changing.

So it has to calculate each read and write based on floating data.

That MP3 you're listening to could be migrating across raid sets as you listen :shock:

All in all it's doing a lot more work than most people realise.
saitou187
New here
Posts: 6
Joined: Sat Aug 30, 2008 12:50 am

Re: TS-509 Raid expansion

Post by saitou187 »

@Marl64

Thanks a lot for your input and the in depth explanation. Also, I never knew an expansion could be so involved as most of my experience was always with a fully populated array in raid5 with a hotspare (or two).

I'm about to swap out all of these 250/160BG drives with three 1TB seagate's. I wonder how long an expansion is going to take when I add one or two more 1TB drives :)

Marl64 wrote: But Wait, There's more
------------------------

The RAID migration is a big job to start with, but on a live NAS you have the added compication that the data is still in use.

The system isn't just having to migrate static data, it's migrating a live operational file system which could be changing.

So it has to calculate each read and write based on floating data.

That MP3 you're listening to could be migrating across raid sets as you listen :shock:

All in all it's doing a lot more work than most people realise.
Marl64
Starting out
Posts: 12
Joined: Thu Aug 21, 2008 12:54 am

Re: TS-509 Raid expansion

Post by Marl64 »

saitou187 wrote:I'm about to swap out all of these 250/160BG drives with three 1TB seagate's. I wonder how long an expansion is going to take when I add one or two more 1TB drives :)
It should be much quicker.

Replacement of a drive requires a rebuild, but rebuilds are faster as they do four reads for one write.

Each drive has to be rebuilt before you can do the next so allow a couple of hours per drive.

After that, expansion is "vertical", that is it uses additional capacity on the existing drives so (in theory at least), it should not have to recalculate parity for the existing data, it just needs to generate parity for the new empty portions.

In short (with RAID5), once those drive bays are full, the hardest bit is over with :D
Post Reply

Return to “System & Disk Volume Management”