Score:0

How to change size of RAID0 software array by resizing partition?

cn flag

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.

Score:0
cn flag

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.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.