Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm attempting to build an array using mdadm. The array has 512-byte (not kibibyte) sized stripes. Because mdadm accepts arguments to chunk in kibibytes, not in bytes, I have been unable to build this array correctly.

mdadm --build -n2 -c512 -lraid0 /dev/md0 /dev/sdb /dev/sdc

Builds the array with chunk size 512 KiB.

mdadm --build -n2 -c.5 -lraid0 /dev/md0 /dev/sdb /dev/sdc

Returns an error.

Any ideas? I would normally just manually rebuild the RAID. But this one is 4TB big. I could rebuild it to an LVM, but I was hoping to avoid this. Any ideas?

share|improve this question
Glancing through the mdadm source, it's hard to say. Internally, the size is represented as a int counting 512-byte sectors for a little while, but is checked to make sure it's at least 4KiB, then divided by 2 to convert to # KiB. On the actual ioctl side, there's apparently two versions, before md 0.90.0, it used a "chunk size factor" where 0=4KiB, 1=8KiB (2^x*4096) so it cannot be done on older kernels at all. Newer md uses # of bytes, but you'd have to look at the kernel to see if it supports 512 byte chunks, then patch mdadm to remove the checks and conversions that would stop it. – DerfK Jul 15 '11 at 23:19
Thank you so much for taking the time to sleuth this out. I checked the kernel source in the md driver and it would indeed be possible, because everything is referenced by number of sectors as far as I can tell. Thank you very much, I'll play with it and see what I come up with. If you copy this response as an answer I'll gladly accept. – OmnipotentEntity Jul 16 '11 at 1:42
@DerfK, b (thumb up) – poige Jul 16 '11 at 5:06
up vote 1 down vote accepted

I had the same problem and I solved it by means of a little Linux FUSE program I wrote. It's named xraid and I put it on Sourceforge.

For assembling your RAID:

  • Download and compile xraid
  • Run it:

    mkdir mnt ./xraid mnt 512 /dev/sdb /dev/sdc

  • You now should be able to access your RAID under mnt/xraid.
share|improve this answer
Thanks for this. I eventually broke down and used a handmade python script to access the data and copied it to another RAID with a sane block size, but if I have this issue in the future I'll be sure to take a look at it. – OmnipotentEntity Aug 21 '14 at 14:29

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.