3

I'm running an Ubuntu Linux NAS server with 4 2TB drives in software RAID 10.

I created the array during installation (with Ubuntu Server disc), but the layout is near and the chunk size is 64.

I want to change the chunk size to 256 and the layout to far. How do I do this?

Here's the output of mdstat:

root@server:~# cat /proc/mdstat

Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md0 : active raid10 sde1[3] sdd1[2] sdc1[1] sdb1[0]
      3907026816 blocks 64K chunks 2 near-copies [4/4] [UUUU]

I would prefer to make the change non-destructively to save time copying the data over again, but the data is backed up, so destructive changes would be ok too.

Thank you for any help.

  • 1
    Last time I looked there was no way to change this other then the obvious backup->re-create->restore method. – Zoredache Mar 1 '11 at 0:48
  • @Zoredache: Yeah, that's what I ended up doing. Thanks. – Andrew Ensley Mar 1 '11 at 17:29
4

The only method is to destroy and re-create the array with new parameters. Neil Brown have written in his recently published road map for md:

Support reshape of RAID10 arrays.

RAID10 arrays currently cannot be reshaped at all. It is possible to convert a 'near' mode RAID10 to RAID0, but that is about all. Some real reshape is possible and should be implemented.

Whole road map is here: http://lwn.net/Articles/428206/

0

I too wanted to try this, now a few caveats about doing this. As Pawel said, it cannot be done without recreating. There is no shortcut, what I did was simply disable the array, recreate with the same partitions and then tried to mount hoping by some miracle things would magically work (they did not). If you do try, you will get a kernel panic (yes I tried and this is what happened). So very bad idea if you have a remote server and no KVM remote/reboot (fortunately I do have it but many do not).

One other caveat is that I was shocked to see that the same partitions in --layout=f2 are slightly smaller by hundreds of blocks. Why is this a problem? If you are using something like DRBD where the size MUST be exactly the same it is a predicament.

To give an example about the DRBD issue with mdadm see here (difference of 512 blocks smaller in f2 layout): RAID10 --layout=n2 size: Array Size : 897500160 (855.92 GiB 919.04 GB) RAID10 --layout=f2 size: Array Size : 897500672 (855.92 GiB 919.04 GB)

I actually wish mdadm would default to --layout=f2 in RAID10. Essentially to get real RAID1 performance, you need to do a two-disk RAID10 in f2 layout (very silly) but at least it is an option.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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