Re: How does one resize/expand a softraid RAID1?
Chris Ross <[email protected]> Thu, 30 Jul 2026 16:46:29 -0400
| Newsgroups | gmane.os.openbsd.misc |
|---|---|
| Message-ID | <[email protected]> |
> On 30 Jul 2026, at 15:02, Alexander Hall <[email protected]> wrote: >>=20 >>=20 >> Not supported with softraid. You can't create a "1-disk RAID1" and = add >> the second drive later either. 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. >=20 >=20 > I don't think the intention is to create a new single-disk RAID1. I was happy he provided that note, though, because that was the = =E2=80=9Cother=E2=80=9D option I=E2=80=99d thought of. > 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 them, giving free space at the end of it. That was my original ask, yes. Something like that. The other thought = I=E2=80=99d had was maybe trying to make a second one-disk RAID1, then copy the = data, then fix the =E2=80=9Cnew=E2=80=9D RAID1 with a matching larger disk. = But that was the less-preferred option. >=20 > This might be trickier, but one might be able to force bioctl to = reinitialize a larger RAID1 on top of the former. >=20 > Anyway, this probably shouldn't be attempted if you are not ready to = accept losing your data. Even if so, I would recommend trying it out on = a smaller scale with some spare drives first. Yeah, I sent a more recent note asking how plausable these changes would = be. But are you saying that I might be able to use bioctl without any = changes to kernel or application to =E2=80=9Cforce=E2=80=9D the size to be = right? Hmm. Yeah, that definitely sounds dangerous to the enclosed file system. But I think if = that is even possible, it makes it clear that it shouldn=E2=80=99t be hard to = modify the underlying system to be able to figure that out itself then bioctl could=20= just have a =E2=80=9Cexpand=E2=80=9D to tell the soft device to grow. I = suppose that is most easily done after both drives are replaced with larger ones, but if = I performed the =E2=80=9Ctrick=E2=80=9D of one then the other, which on a = ZFS mirror allows it to do this same thing if you=E2=80=99ve turned on =E2=80=9Cautoexpand=E2= =80=9D; then it seems like the sr would be the original size on two larger disks and we could = have a manual operation triggered with bioctl that will cause the = =E2=80=9Cexpand=E2=80=9D operation. I=E2=80=99m okay with there not being an =E2=80=9Cautoexpand=E2= =80=9D, as long as there is a way to cause the expansion by just pushing a [effective] = button. But either way, it=E2=80=99s not something that can be done right now in = 7.9. I=E2=80=99ll proceed with copying the data off, building a new array, = then copying the data back. Luckily, it=E2=80=99s a home server and it being in = single user for a couple hours isn=E2=80=99t a big deal. Thanks all. -Chris