RAID 0 and defrag.

marmotjr

Distinguished
May 8, 2007
8
0
18,510
I Just Built a Raid 0 system, and I was wondering if defragging the drive is a good idea? I mean, considering the point of a RAID system is to have fragmented files to speed up access time, would defragging the drive kill the whole purpose of a RAID drive?
 
No! Two different things. The data is 'striped' across the drives in a defined pattern. Fragmentation is files bein spread across the drives in a random pattern. Just defrag the array on a regular basis.

Mike.
 
What mike99 said is right!

A file having blocks alternating on 2 drives but all in 1 contiguous segment is good, fragmentation is when the file is in many segments all over the drive(s), making the head need to move a lot and seek the next part of the file.

Jo
 
Does anyone have a link to a reputable website that confirms this? Or perhaps a performance analysis of RAID 0 before and after a Defrag?

It's not that I don't believe you are right. common sense says that you are since the drives are viewed as one logical drive. The only problem is that When I analyze my RAID 0 drives, they are horribly fragmented. I never had this problem using a single HD. On my last computer I never had to run disk defragmenter. My drive never needed it. Now when I use Raid 0 I thinks it needs to be defragged after every time I install something. It's like having them in RAID 0 causes the files to be fragmented. The whole point of using RAID 0 was to increase my transfer rates. I don't want to defrag them and find out it moved all the data onto one HD and the other is not being used at all.
 
Yep exactly the drive segments are split across the 2 drives if all the data was located on one physical drive the logical drive would terribly fragmented.
 
I have a raid 0 setup my self. Just defrag the sucker....I've done it many times and it helps. Overall it just speeds up the read time so it doesn't have to travel all over the drive.

Raid 0 is basically striping the data to two drives. When you read files off a raid 0 it pulls the data blocks from each drive and puts it together. That's the purpose of raid 0. To lessen the bottleneck that hard drives give us. If your files are fragmented and you defrag a raid 0 it doesn't mean it puts all the data on one drive...if it did that it wouldn't be raid 0..It basically moves all the files around so they aren't fragmented.

Think of it this way. You download a few movies or whatever with a bitorrent application. Let's say 5 at a time. All that data was written randomly onto the drive...All the 5 movies are fragmented. When you defrag it basically just moves the files around so that all the files are contiguous...In one giant block for each movie instead of them all being scattered through out each other since you downloaded 5 movies at once....Thus by increasing performance....

So don't worry...it's not bad to defrag a raid 0..it's a good thing..
 
Not sure what utility you're using to analyze your array, but I highly recommend getting Diskeeper. Not only is a better defragger than Norton and whatever is built into windows, it also allows you to set the (Master File Table) MFT size. It will also be difficult to keep any drive, whether a physical drive or logical array, defragmented if you have 90% or more used disk space. So, you may have large defragmentation due to an undersized MFT or because there is less than 10% free disk space.
 
I think the OP has an incorrect perception of the processing order for Raid Controller to the rest of the computer.

Raid 0 controller specifies how data is written to and taken from multiple HDs. Information coming into the Raid Controller and leaving it is exactly as any other system. Defragging like any other process of HD I/O will be handled correctly by the RAID controller. The defrag process cannot circumvent the RAID controller and occur after the step of the controller. As an example:

We have two Hard drives with 3 bits. 1-1, 1-2, 1-3 for HD1, and 2-1, 2-2, 2-3 for HD2. Say we have a 2x3 bits, I0U and ABC, and they are fragmented like below:

1-1:I 2-1:A
1-2:B 2-2:0
1-3:U 2-3:C

Defragging will make it look like below:
1-1:I 2-1:0
1-2:U 2-2:A
1-3:B 2-3:C

The Raid controller will make sure to send the defragger the correct information of how the bits of a file are ordered, then when the defragger tells the Raid controller how things "should" be ordered, the Raid controller will properly write the files in the correct sequence.

The system will not defrag each HD seperately making for something that looks like:
1-1:B 2-1:A
1-2:I 2-2:C
1-3:U 2-3:0
It is just technically not feasible for the I/O to work like that.
 
RAID controllers stripe the data at the block level. In other words, the RAID controller translates a logical block address (LBA) from the computer into a sector such that sequential LBA requests are interleaved between the drives comprising the aray.

Defragmenters defragment files at the file system level, which is above and more abstracted from the physical drives and RAID controller. Defragmenters ensure that a single file is present in a continuous string of adjacent LBAs. Those same LBAs are the ones that the RAID controller makes sure are interleaved among the drives in the array.

Thus, if a file shows as perfectly defragmented to a defragmenter program, the file is in a continuous LBA chunk. By definition, this file is interleaved perfectly amongst all drives in the array and will have maximum performance benefit.

It is always a good idea to keep a drive defragmented, including a RAID array.
 
Wow! thanks for all the quick responses. I figured I was right to defrag the drive but just wanted to make sure. I am using the bundled defrag software to analyze the drive. I will try the above mentioned program when I get home.

the reason I was suspicious is I have defragged my RAID already. Last night I installed MOH airborne demo. This is the only thing I have installed since the defrag. After I installed it, The HD required Defragmenting again. I didn't think installilng a single program would cause such fragmentation to occur that I would have to defrag the HD again. Any speculation as to why this is the case would be interesting to read.

I am comparing my current system (see sig) to my previous one:
Abit NF7
XP2800
x800 GTO
1GB RAM
WD 80 GB HDD

Both systems running XP Pro SP2

I hardly ever had to defrag this harddrive and I was installing and uninstalling programs all the time. I just thought it was strange.
 
Surprised that your previous system never seemed to need defragging, tho' if you used windows' own analyzer, I've always found that it doesn't report the true status very well,(tho' I believe that it is actually licensed from Diskeeper)!

Windows has more space to play with, so it may appear that your files are more fragmented!

Personally, I always defrag after installing a large program,say 250Mb+, and after a fresh install of windows I always defrag before I install anything else!

I use Diskeeper,and let it do it's thing automatically, unless I've been moving a lot of big files around, but I've heard good things about this one too http://www.oo-software.com/home/en/products/oodefrag/

As a way of thinking about this, or at least how I explain the principal of defragging to people whose computers I attend to, is that Windows is the boss :pt1cable: that chucks all the files etc. into the filing cabinet (HDD) willy nilly, and your defrag program is the secretary, who sorts and tidies it all up!

 
I have my 2 Raptors in raid 0 and treat them like 1. So you do the same, treat it like its one hard drive that needs the usual clean up/defrag routine.

I have the same but O use a 3rd drive which is not a 10,000 rpm raptor but a mere WD 500gig 7200rpm for a Ghost backup. It all works great