0

I've RAID 0 built with mdadm on two disk partition on two separate disks. Is it possible to resize (enlarge) this array by resizing the underlying partition, i.e. do something like stop array->enlarge partition->start-array->mdadm -G -z max and then resize filesystem without data loss?

If not, is there a way to convert RAID 0 to something more flexible and resize it then?

So, I need a solution to enlarge the RAID 0 array without copying entire partition, downtime is possible. I'm aware that I could add 2 more partitions but it would not be nice.

Nick
  • 126
  • 5

1 Answers1

0

If you're lucky (appropriate metadata superblock format, superblock v1.2 worked for me) then first stop the array via mdadm -S /dev/mdX and then reassemble it:

mdadm -A --update=devicesize /dev/mdX

This will update the component devices to use the minimum size of the components. I just used this to increase the size of a raid0 array which was on 2x2TB ssds and I dd'ed (sda1/sdb1) on to 2x4TB ssds (sdc1/sdd1) [had to gdisk partition them to fd00 Linux RAID first]. Except I only have room to plug in 2 disks, so it was done 1 disk at a time, obviously with the arrays fully stopped, so nothing was in /proc/mdstat.

Not for the faint-hearted though. Easy to screw something up.

Davidw
  • 1,222
  • 3
  • 14
  • 25