Re: How does one resize/expand a softraid RAID1?

Alexander Hall <[email protected]> Thu, 30 Jul 2026 21:02:28 +0200
Newsgroups gmane.os.openbsd.misc
Message-ID <[email protected]>
On July 14, 2026 11:21:45 AM GMT+02:00, Stuart Henderson <stu=2Elists@space=
hopper=2Eorg> wrote:
>On 2026-07-13, Chris Ross <cross+openbsd@distal=2Ecom> wrote:
>> So, I have a failed disk in a softraid mirror=2E  While looking to repl=
ace it,
>> I want to just replace both drives and get a larger fs=2E
>> Most of my experience in recent years has been using ZFS, so I know how=
 to
>> do exactly this with ZFS=2E  But, I can=E2=80=99t find a general guide =
or anything
>> specific in the docs/pages for bioctl, that describes how to do this wi=
th
>> OpenBSD=2E
>>
>> Is there a way to replace a failed drive with a larger one, rebuild the
>> mirror onto it, then replace the smaller remaining drive with one of eq=
ual
>> size and rebuild onto that?  Then, a step would need to be performed to=
 tell
>> the softraid device to fill the new available space, and then growfs=2E
>>
>> Thanks=2E  Sorry if it is already documented somewhere and I failed to =
find
>> it in my quick search=2E
>
>Not supported with softraid=2E You can't create a "1-disk RAID1" and add
>the second drive later either=2E Unless you want to get dirty with poking
>at low level data structures, you'll either need to have both new drives
>and the remaining working old drive connected at the same time and
>dump/restore, or dump to external media + swap drives + restore, etc=2E


I don't think the intention is to create a new single-disk RAID1=2E

It sounds more like replacing/rebuilding/"resilver" one underlying disk at=
 a time onto a larger RAID partition and then let the sr disk grow into the=
m, giving free space at the end of it=2E

I would guess it, at least, boils down to:

- location of the sr metadata within the underlying RAID partition(s)=2E

  If it is only at the beginning it's probably easier=2E

- presence of RAID1 disk size in metadata=2E

  This might be trickier, but one might be able to force bioctl to reiniti=
alize a larger RAID1 on top of the former=2E


Anyway, this probably shouldn't be attempted if you are not ready to accep=
t losing your data=2E Even if so, I would recommend trying it out on a smal=
ler scale with some spare drives first=2E

/Alexander