From: "Alexander A. Klimov" Subject: Re: [patch] [ok?] bioctl: properly indicate key disk for RAID 1C in addition to crypto To: tech@openbsd.org Date: Thu, 10 Oct 2024 12:44:37 +0200 How to reproduce: dd bs=1024x1024 count=32 if=/dev/zero of=/tmp/vnd0 vnconfig vnd0 /tmp/vnd0 disklabel -E vnd0 a ENTER ENTER 4000 RAID a ENTER ENTER 4000 RAID a ENTER ENTER 4000 RAID q y cd /dev bioctl -c 1C -k vnd0a -l vnd0b,vnd0d softraid0 bioctl softraid0 On 28.04.24 19:31, Alexander Klimov wrote: > Hello everyone! > > Without the diff below bioctl displays a strange RAID member of 0 size: > > # bioctl softraid0 > Volume      Status               Size Device > softraid0 0 Online       500107558912 sd5     CRYPTO >           0 Online       500107558912 0:0.0   noencl > softraid0 1 Online      2999999705088 sd6     RAID1C >           0 Online      2999999705088 1:0.0   noencl >           1 Online      2999999705088 1:1.0   noencl >           2 Online                  0 1:2.0   noencl > > With the diff it identifies that as the key disk, just like in crypto: > > # bioctl softraid0 > Volume      Status               Size Device > softraid0 0 Online       500107558912 sd5     CRYPTO >           0 Online       500107558912 0:0.0   noencl > softraid0 1 Online      2999999705088 sd6     RAID1C >           0 Online      2999999705088 1:0.0   noencl >           1 Online      2999999705088 1:1.0   noencl >           2 Online           key disk 1:2.0   noencl 7.6/i386 ok. Ok? --- sbin/bioctl/bioctl.c +++ sbin/bioctl/bioctl.c @@ -562,7 +562,8 @@ snprintf(volname, sizeof volname, " %3u", bd.bd_diskid); - if (bv.bv_level == 'C' && bd.bd_size == 0) + if ((bv.bv_level == 'C' || bv.bv_level == 0x1C) + && bd.bd_size == 0) snprintf(size, sizeof size, "%14s", "key disk"); else if (human) fmt_scaled(bd.bd_size, size);