LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Need some MDADM things explained to me, as if I were a newbie. A child-like newbie. (https://www.linuxquestions.org/questions/linux-newbie-8/need-some-mdadm-things-explained-to-me-as-if-i-were-a-newbie-a-child-like-newbie-4175618439/)

road hazard 11-26-2017 11:16 PM

Need some MDADM things explained to me, as if I were a newbie. A child-like newbie.
 
I wiped out my mdadm array (not due to user error, was just playing around with adding drives, failing them, different settings.... play time is over now and want to do things right when setting it back up.)

Server is running an i7 7700K, 16 gigs of RAM. Mint 18.2. Storage is 12, 4TB drives in RAID 6. File system will be XFS (maybe ext4 but I keep reading conflicting data about how ext4 is limited to a 16TB partition. If it's not, which would be the better FS and why? My server is running Plex and doubling as a backup server to PCs in the house.

1) I heard that you can speed up mdadm operations by using an external bitmap (only if your raid is ext2/3). Still true today? If not, is it REALLY worth using an external bitmap?

2) Block size, chunk size, stripe_cache_size, stride, stripe?!?!? Do I have all the following right?:

Block size = sector size of the HDD. (512 bytes for older, smaller
drives and 4k (4096) for newer, bigger drives. (Like my 4TB HGST's). As far as this goes, there is nothing to be changed in mdadm, right?

Chunk size = A setting that should be set when the array is created. Can range in size from 4K, 8K, 16K, 32K, 64K, 128K, 256K, etc. BUT, knowing the average file size you're going to be dealing with will help determine the chunk size. Since this will be for a Plex server, I'll have LOADS of files that are over 1 gig but also, metadata type files that are anywhere from 10K to a few megabytes (cover art) per movie/TV show. There a good rule of thumb on selecting the right chunk size? I think I read that mdadm can now adjust this after the array is created but it should ideally be right the 'first time around'. If any of you run a Plex server and use mdadm, what chunk size did you go with?

Stripe_cache_size = the amount of RAM to set aside to store data before it's written to disk. I think I read that 8K is a really good value that works well for all general purposes. Correct? I know this value can be easily adjusted later and 'on-the-fly' to see the results. Go with 8K and adjust later to suit my needs?

Stride, stripe width = Totally clueless here. But, maybe this is automagically handled for me? Reading here: (down in the XFS section) https://raid.wiki.kernel.org/index.p...vanced_Options

XFS

xfsprogs and the mkfs.xfs utility automatically select the best stripe size and stripe width for underlying devices that support it, such as Linux software RAID devices. Earlier versions of xfs used a built-in libdisk and the GET_ARRAY_INFO ioctl to gather the information; newer versions make use of enhanced geometry detection in libblkid. When using libblkid, accurate geometry may also be obtained from hardware RAID devices which properly export this information.

To create XFS filesystems optimized for RAID arrays manually, you'll need two parameters:

chunk size: same as used with mdadm
number of "data" disks: number of disks that store data, not disks used for parity or spares. For example:
RAID 0 with 2 disks: 2 data disks (n)
RAID 1 with 2 disks: 1 data disk (n/2)
RAID 10 with 10 disks: 5 data disks (n/2)
RAID 5 with 6 disks (no spares): 5 data disks (n-1)
RAID 6 with 6 disks (no spares): 4 data disks (n-2)

So if I go with the XFS file system and call 'mkfs.xfs' when formatting my RAID array, it will take care of setting the stride and stripe width with no need for me to do anything, right? (And if stride does indeed equal chunk size, I can change that later as I mentioned above.)

Whew, all done! Thanks for reading and looking forward to your responses!

AwesomeMachine 11-27-2017 05:33 PM

I would use XFS. It's very mature, very scalable, and reasonably intelligent. It works well with small block size. It's easy to recover.

But you yourself should understand what the various options mean. I believe the kernel wiki is correct. Determine which raid you will use, and figure out how many data disks you will have.

road hazard 11-27-2017 10:51 PM

Quote:

Originally Posted by AwesomeMachine (Post 5785958)
I would use XFS. It's very mature, very scalable, and reasonably intelligent. It works well with small block size. It's easy to recover.

But you yourself should understand what the various options mean. I believe the kernel wiki is correct. Determine which raid you will use, and figure out how many data disks you will have.

The more I read about XFS (especially in conjunction with MDADM), yeah, I think that will be my file system of choice.

I'll be using RAID 6 (no doubt there) over 12, 4TB drives. Know of a good way I could look at ALL the files on my Plex server and get an idea of the average file size?


All times are GMT -5. The time now is 04:40 PM.