On Wed, Aug 17, 2022 at 07:03:50AM +0000, Miod Vallat wrote:
> > What is the result if root runs disklabel, and forces it to all zeros?
>
> If the root duid is all zeroes, then the only way to refer to the root
> disk is to use its /dev/{s,w}d* device name, as zero duids are ignored.
I like miod's second diff and it fixes the race for vnd(4).
I never ran into the issue with softraid(4), but that should not happen
anymore with it, either.
OK kn
>
> If you set a zero duid in disklabel(8), setdisklabel() in the kernel
> will compute a new, non-zero value.
Correct; same for real sd1 and fictitious vnd0.
# disklabel -E sd1
Label editor (enter '?' for help at any prompt)
sd1> i
The disklabel UID is currently: c766517084e5e5ce
duid: [] 0000000000000000
sd1*> l
# /dev/rsd1c:
type: SCSI
disk: SCSI disk
label: Block Device
duid: 0000000000000000
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 16
sectors/cylinder: 1008
cylinders: 203
total sectors: 204800
boundstart: 32832
boundend: 204767
drivedata: 0
sd1*> w
sd1> l
# /dev/rsd1c:
type: SCSI
disk: SCSI disk
label: Block Device
duid: 9ff85059e4960901
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 16
sectors/cylinder: 1008
cylinders: 203
total sectors: 204800
boundstart: 32832
boundend: 204767
drivedata: 0
sd1>