The loader has a "map-vdisk" command. It creates virtual disk devices with names like "vdisk0:", "vdisk1:", "vdisk2:", etc. After creating a vdisk0: device which is visible in the output of "lsdev", the command "set currdev=vdisk0:" fails with the error "bad unit number". This is unexpected and seems to be caused by an assumption in disk_parsedev() that the text before the unit number will be 4 characters in length: np = devspec + 4; /* Skip the leading 'disk' */ Observed on FreeBSD 15.0-PRERELEASE, snapshot from 28 August 2025.
Yes, that's the assumption. and that needs to be fixed. This has been the case for years at this point (since before I rewrote the parse code a couple of years ago). I wonder what other problems this will expose (eg, there's no way they've ever been used in FreeBSD since this was committed, if I'm reading a quick blame correctly, but I'm not 100% sure). But since I wrote that code (or touched it most lately), I'll take this. It's likely easy to fix, but just fixing the parsing may not fix the feature.
https://reviews.freebsd.org/D52500 might fix this problem. I really don't know. It will get past the parsing issue.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=d18ed8e19c3cb264340987bdc191615108d8413a commit d18ed8e19c3cb264340987bdc191615108d8413a Author: Warner Losh <imp@FreeBSD.org> AuthorDate: 2025-11-11 00:41:52 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2025-11-11 00:56:11 +0000 stand: Try to parse vdisk correctly PR: 289306 Sponsored by: Netflix Reviewed by: dab MFC After: 5 days Differential Revision: https://reviews.freebsd.org/D52500 stand/common/disk.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)