Tuesday, September 11, 2007

Creating a filesystem on a RAID array

I have a linux software RAID5 array. I want to make sure I create an optimized filesystem on the array.

The array details are:

# mdadm --misc -D /dev/md3
/dev/md3:
Version : 00.90.03
Creation Time : Sat Oct 21 19:32:23 2006
Raid Level : raid5
Array Size : 735334848 (701.27 GiB 752.98 GB)
Used Dev Size : 245111616 (233.76 GiB 250.99 GB)
Raid Devices : 4
Total Devices : 4
Preferred Minor : 3
Persistence : Superblock is persistent

Update Time : Tue Sep 11 19:18:42 2007
State : clean
Active Devices : 4
Working Devices : 4
Failed Devices : 0
Spare Devices : 0

Layout : left-symmetric
Chunk Size : 64K

UUID : 6f6b9978:683a7ada:109f3c19:b8abb3ae
Events : 0.53048

Number Major Minor RaidDevice State
0 8 49 0 active sync /dev/sdd1
1 8 17 1 active sync /dev/sdb1
2 8 33 2 active sync /dev/sdc1
3 8 1 3 active sync /dev/sda1


Here we see a Chunk Size of 64K and 4 disks in the array.

Based on the information in this discussion thread, this means that the stride is 16 based on a Chunk Size of 64k accross 4 disks with a filesystem with a 4k block size.

So a good mkfs.ext3 command would be
mkfs.ext3 -b 4096 -E stride=16 /dev/vg/lvol01

No comments: