Configuring Ext4 Storage Pool with correct Disk Alignment

From Public PIC Wiki
Jump to navigation Jump to search

Calculating the Stride and Stripe-width

  • Ext4 Block Size = default 4KiB (not needed to change this value)
  • Stride = RAID Chunk Size / Ext4 Block Size (Chunk Size also known as Stripe Size)
  • Stripe-width = Number of physical data disks * Stride

Examples

RAID 0: 2 Disks & Stripe Size - 64 KiB

  • Ext4 BS = 4KiB
  • Stride = 64 KiB / 4KiB = 16
  • Stripe-width = 2 * 16 = 32
mkfs.ext4 -b 4096 -E stride=16,stripe-width=32 <dev>
# or simply:
mkfs.ext4 -E stride=16,stripe-width=32 <dev>

RAID 1: 2 Disks & Stripe Size - 128 KiB

  • Ext4 BS = 4KiB
  • Stride = 128 KiB / 4KiB = 32
  • Stripe-width = 1 * 32 = 32
mkfs.ext4 -b 4096 -E stride=32,stripe-width=32 <dev>
# or simply:
mkfs.ext4 -E stride=32,stripe-width=32 <dev>

RAID 5: 4 Disks & Stripe Size - 512 KiB

  • Ext4 BS = 4KiB
  • Stride = 512 KiB / 4KiB = 128
  • Stripe-width = 3 * 128 = 384
mkfs.ext4 -b 4096 -E stride=128,stripe-width=384 <dev>
# or simply:
mkfs.ext4 -E stride=128,stripe-width=384 <dev>

RAID 6: 10 Disks & Stripe Size - 1 MiB

  • Ext4 BS = 4KiB
  • Stride = 1024 KiB / 4KiB = 256
  • Stripe-width = 8 * 256 = 2048
mkfs.ext4 -b 4096 -E stride=256,stripe-width=2048 <dev>
# or simply:
mkfs.ext4 -E stride=256,stripe-width=2048 <dev>