Re: Unable to replace drive in raidz1

From: Alan Somers <asomers_at_freebsd.org>
Date: Mon, 09 Sep 2024 15:27:07 UTC
On Mon, Sep 9, 2024 at 8:56 AM Chris Ross <cross+freebsd@distal.com> wrote:
>
>
>
> > On Sep 6, 2024, at 18:53, Chris Ross <cross+freebsd@distal.com> wrote:
> >> On Sep 6, 2024, at 18:28, Alan Somers <asomers@freebsd.org> wrote:
> >>
> >> If it's a 4kn disk, then what you ask for is impossible.  If it's
> >> 512e, then it should've already worked.  With diskinfo, a 512e disk
> >> will have 512 sectorsize and 4096 stripesize.  A 4kn disk will show
> >> 4096 sectorsize.  If you cannot obtain a 512n or 512e disk, then I'm
> >> afraid that you'll have to recreate your whole pool.
> >
> > Happy to hear other thoughts.  I could move all of the data to
> > another system and rebuild it with a new vdev, but I’m not sure
> > if I care to grow the FS enough to do that.  :-)
>
> Okay, final question.  If I destroy and rebuild the pool, and have a RAIDz
> with 512-byte sector drives, can I replace those with larger 4k sector
> drives as long as I have created the vdev with “ashift=12”?

Absolutely.  Just set vfs.zfs.min_auto_ashift=12 before you create the pool.

>
> You said “if your pool has a 512B block size”.  Does that mean the ashift
> value, or is there something else that I’ll need to be mindful of if
> I want to be able to upgrade to 4k disks?

Correct.  That means the ashift value.