LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Format RAID 10 Partition (https://www.linuxquestions.org/questions/linux-newbie-8/format-raid-10-partition-4175503216/)

jjstinger72 04-28-2014 07:00 AM

Format RAID 10 Partition
 
My google-fu must be off this morning, but i'm having a rough time wrapping my head around formatting this RAID 10 partition ext4. Specifically the math for figuring stride. Also, fdisk gumbled about my logical sectors being smaller than the physical. This is a (4) 500 GB Array... block size on one of the devices is 4096...


fdisk -l /dev/md0

Code:

Disk /dev/md0: 999.9 GB, 999944093696 bytes
2 heads, 4 sectors/track, 244126976 cylinders, total 1953015808 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 524288 bytes / 1048576 bytes
Disk identifier: 0x4a20bb7b

    Device Boot      Start        End      Blocks  Id  System
/dev/md0p1            2048  1953015807  976506880  83  Linux

i think i'm on the right track, but anyone point me in the right direction?

smallpond 04-28-2014 09:53 AM

To get the chunk size do: mdadm --detail /dev/md0p1

The mkfs.ext4 stride parameter will be: N * chunk / b

where N=2 for 4 raid10 disks, and b is the filesystem block size.

jjstinger72 04-28-2014 09:09 PM

So if i understand correctly



Code:

# mdadm --detail /dev/md0p1
/dev/md0p1:
        Version : 1.2
  Creation Time : Mon Apr 28 00:27:57 2014
    Raid Level : raid10
    Array Size : 976506880 (931.27 GiB 999.94 GB)
  Used Dev Size : 488253952 (465.64 GiB 499.97 GB)
  Raid Devices : 4
  Total Devices : 4
    Persistence : Superblock is persistent

    Update Time : Mon Apr 28 02:25:30 2014
          State : active
 Active Devices : 4
Working Devices : 4
 Failed Devices : 0
  Spare Devices : 0

        Layout : near=2
    Chunk Size : 512K

          Name : VOAFS001:0  (local to host VOAFS001)
          UUID : 78b92969:2c0eff0a:a45d3b70:62538fb5
        Events : 18

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

i take my 512k, turn it into bytes, and wind up with
N * chunk / b

2 * (512 *1024) / 4098 = ... 256
and then the stripe width is twice that (2 data disks, and not 2 parity disks)

and a format command that looks something like...

Code:

# mkfs.ext4 -v -m .1 -b 4096 -E stride=256,stripe-width=512 /dev/md0p1
thanks!! now to do some testing, before i turn my monstrosity loose on the world!!! or at least the office :)


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