Tuesday, November 30, 2021

Re: dd: /dev/rsd1c: device not configured

On 11/30/21 8:36 AM, Luca Ferrari wrote:
> Hi,
> I'm trying to install 7.0 in a virtual box machine using full disk
> encryption, following
> <https://www.openbsd.org/faq/faq14.html#softraid>. I've done it on
> real hardware without a problem, but I'm not understanding the error
> in the virtual box machine. In particular, I cannot copy random data
> on the disk before doing the effective encryption.
> This is what I do, after entering the shell at the very first prompt:
>
>
> # sysctl hw.disknames
> hw.disknames=wd0:,cd0:,rd0:7c72fe60b4e2338d
>
> # ls /dev/rsd*c
> /dev/rsd0c

I wonder if that is what you think it is.

> Uhm, why is sd0 there and does not appear in the hw.disknames?
> However, I tried to configure the sd1 device:

the devices in /dev are not dynamically created...they are whatever is
in the /dev directory when it was created, you can add and remove drives,
the entries in /dev/ will not change on their own -- but you might have
to change 'em.

Install kernels have a very deficient set of drives in /dev

> # cd /dev
> # sh MAKEDEV sd1
> # dd if=/dev/urandom of=/dev/rsd1c bs=1m
> dd: /dev/rsd1c: device not configured

There was no sd0, or sd1 in your hw.disknames output. So why do you
think you can write to something that doesn't exist?

> # ls /dev/rsd1c
> /dev/rsd1c
>
> What am I missing here?

A lot.
For one, the guy who wrote that is a bit of a jerk. Rather than taking
you by the nose and telling you what keys to hit, he kinda expects you
to read and understand the whole article...and in fact, the whole page.
And yeah, he really wants you to UNDERSTAND what you are doing.
Total jerk, I know.
Humor him, start at the top, work all the way to the bottom. Part of
the reason it's in the order it's in is because that's how he wrote
parts of it, but some of it is because the later stuff builds on the
earlier stuff.

But... Your machine has only a "wd" device. In that, you will create
a new encrypted "disk", which will be of type sd, sd0 in this case,
since you don't have an sd0 already. Then you will install to that.

The obvious errors you have are you are trying to use devices you don't
actually have on your machine, even though you have a dev file by a
suggestive name. My machine here has /dev entries for sd0 to sd9, and
wd0 to wd3, and there are no wd devices and only three sd devices.

I'm a little suspicious of that sd0 in your /dev directory -- was it
there all along, or did it just pop up when you dd'd to /dev/rsd0c and
created a file with a name that annoyingly matches a drive device name?
The recent installs I've done, the boot kernel had NO sd devices at all
until I MAKEDEV'd 'em...but you might be using a different install
kernel than I was using. Good news, a reboot will clear and recreate
the /dev directory on install kernels (not on an installed machine, of
course).

Nick.

No comments:

Post a Comment