Setting up ext4 raid 5 fs on linux

Terr1

n00b
Joined
May 24, 2010
Messages
28
I have searched around on this side for some tips for creating my ext4 fs for my adaptec 5805 raid 5 (6x 2TB RE4 drives - 9TGB data), 128 kb stripes.

1: Creating the partitiontable

First I am having trouble with the partitiontable creation. msdos have the 2TB limit, and hence isent usable for me and I don't want to use an LVM2 solution. (I only need 1 non-bootable filesystem).

So as I see it I have two solutions from here.. using parted/Gparted (GPT) and create my partition, or write my filesystem directly on the raid device (/dev/sda instead of /dev/sdaX), which should be doable on hardware controller cards.

Whats the pro/cons using these two methods?

My problem with using GPT is the alignment of the partition table, I have zero idea how to do this correctly? Using Gparted you can see you want 1MiB before the partition table. But I have no idea if this will align it properly?

If I choose to put my filesystem directly on the device without a partitiontable, I guess I will have eliminated this problem?


2: Creating an optimal ext4 filesystem, that don't degrade performance too much.
I have searched on google and found my stride=32 and stripe-width=160, howeever im uncertain of what other options I should implement while creating my filesystem?

My linux dist uses the following default values I belive:
[defaults]
base_features = sparse_super,filetype,resize_inode,dir_index,ext_attr
blocksize = 4096
inode_size = 256
inode_ratio = 16384

ext4 = {
features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize
inode_size = 256
}
Is this sufficient or will I get into problems, ie. Inode reservations and such?
 
Last edited:
I always install the filesystem directly on the block device when dealing with large RAID devices. I've done that with an mdadm RAID device, and also with Areca hardware RAID devices.

But I never use ext4. I have had good luck with XFS on several RAIDs. To use XFS, the easiest way is to install an xfsprogs package if your distro has one (on Ubuntu, it is 'xfsprogs').

To install the XFS filesystem, you might use a command like:

# mkfs.xfs -f -d su=128k,sw=5 -l su=128k,lazy-count=1 -L yourlabel /dev/sd_

The su=128k should be whatever stripe width your RAID was initialized with. sw=5 is the number of data disks in the array (6 disk RAID 5 has 5 data disks, 1 parity disk)

Be careful, of course, since with the -f flag, whatever device you give that command will be overwritten, even if it has a valid partition table.
 
Ok.. I can online expand my raid 5 filesystem, no matter if I use a partitiontable (GPT) or put the filesystem directly on the block device?

This is important to me.
 
put it directly on the block device without any partitions, if you use partitions and expand your array you have to resize the partition system first then grow the file system. As john4200 said use xfs it works great directly on array and it's a snap to resize after array expansion.
 
Back
Top