From: Nick Holland <n...@holland-consulting.net>
To: misc@openbsd.org
Date: Mon, 20 Nov 2023 07:47:40 -0500
Subject: Re: a couple question about my fde setup
On 11/19/23 18:09, Shadrock Uhuru wrote:
hi all
a couple question about my fde
first, i have fde setup using a keydisk on my laptop, encryption and
decryption works fine
when i reboot with the key inserted it doesn't find the key,
i have to shut the machine down and restart it then the key is detected,
is this normally how a reboot works with fde and keydisk ?
second when i boot the laptop it tries to boot from the wrong disk,
it tries to boot off hd0 whereby at the boot prompt i then have to type
boot sd0a:/bsd which then proceeds to a normal boot,
do i just run
/usr/mdec/installboot -v /boot /usr/mdec/biosboot sd0
to fix this ?
You have provided a whole lot of no-information here. dmesg, disk
layout and boot mode would be nice starting points. "hd0"? What is
that in your machine?
Hi Nick
ok lets fix that
see below for dmesg, fdisk and disklabel output
and corrected boot messages.
Both issues sound like a firmware issue. Boot device is usually
controllable in BIOS/firmware setup -- once the OpenBSD boot loader
is running, it is too late to determine what you boot from. USB
storage not being found under some boot conditions and being seen
on others, sounds like a firmware bug. Almost certainly, in fact,
as OpenBSD itself isn't loaded and running, it's just the boot
code talking to the firmware or BIOS.
any modern-ish computers support both UEFI and BIOS booting. They
often have different bugs in different modes. I have a couple machines
here that were sold running embedded Linux with a warning "must use
BIOS mode" in the firmware for their original application...but OpenBSD
only can see storage in EFI mode.
Also look for firmware updates to your system. I'd suggest starting
with reloading in the opposite boot mode first, because if a new BIOS
will have to reinstall to switch boot modes
technically, no, but if you have to ask, yes).
Nick.
=================================================================================
Dmesg:
OpenBSD 7.3 (GENERIC.MP) #0: Wed Jul 12 05:09:49 MDT 2023
r...@syspatch-73-amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 8482910208 (8089MB)
avail mem = 8206409728 (7826MB)
random: good seed from bootblocks
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.6 @ 0xe0850 (63 entries)
bios0: vendor Phoenix Technologies Ltd. version "07QA" date 04/20/2012
bios0: SAMSUNG ELECTRONICS CO., LTD. 300E4A/300E5A/300E7A/3430EA/3530EA
efi0 at bios0: UEFI 2.0
acpi0 at bios0: ACPI 3.0
acpi0: sleep states S0 S1 S3 S4 S5
acpi0: tables DSDT FACP SLIC SSDT ASF! HPET APIC MCFG SSDT SSDT UEFI UEFI UEFI
acpi0: wakeup devices P0P1(S4) GLAN(S4) HDEF(S4) RP01(S4) PXSX(S4) RP02(S4)
PXSX(S4) RP03(S4) PXSX(S4) RP04(S4) PXSX(S4) RP05(S4) PXSX(S4) RP06(S4)
PXSX(S4) RP07(S4) [...]
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpihpet0 at acpi0: 14318179 Hz
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM) i3-2350M CPU @ 2.30GHz, 2294.83 MHz, 06-2a-07
cpu0:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,POPCNT,DEADLINE,XSAVE,AVX,NXE,RDTSCP,LONG,LAHF,PERF,ITSC,SENSOR,ARAT,XSAVEOPT,MELTDOWN
cpu0: 32KB 64b/line 8-way D-cache, 32KB 64b/line 8-way I-cache, 256KB 64b/line
8-way L2 cache, 3MB 64b/line 12-way L3 cache
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 10 var ranges, 88 fixed ranges
cpu0: apic clock running at 99MHz
cpu0: mwait min=64, max=64, C-substates=0.2.1.1.2, IBE
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Intel(R) Core(TM) i3-2350M CPU @ 2.30GHz, 2294.82 MHz, 06-2a-07
cpu1:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,POPCNT,DEADLINE,XSAVE,AVX,NXE,RDTSCP,LONG,LAHF,PERF,ITSC,SENSOR,ARAT,XSAVEOPT,MELTDOWN
cpu1: 32KB 64b/line 8-way D-cache, 32KB 64b/line 8-way I-cache, 256KB 64b/line
8-way L2 cache, 3MB 64b/line 12-way L3 cache
cpu1: smt 1, core 0, package 0
cpu2 at mainbus0: apid 2 (application processor)
cpu2: Intel(R) Core(TM) i3-2350M CPU @ 2.30GHz, 2294.83 MHz, 06-2a-07
cpu2:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,POPCNT,DEADLINE,XSAVE,AVX,NXE,RDTSCP,LONG,LAHF,PERF,ITSC,SENSOR,ARAT,XSAVEOPT,MELTDOWN
cpu2: 32KB 64b/line 8-way D-cache, 32KB 64b/line 8-way I-cache, 256KB 64b/line
8-way L2 cache, 3MB 64b/line 12-way L3 cache
cpu2: smt 0, core 1, package 0
cpu3 at mainbus0: apid 3 (application processor)
cpu3: Intel(R) Core(TM) i3-2350M CPU @ 2.30GHz, 2294.85 MHz, 06-2a-07
cpu3:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,POPCNT,DEADLINE,XSAVE,AVX,NXE,RDTSCP,LONG,LAHF,PERF,ITSC,SENSOR,ARAT,XSAVEOPT,MELTDOWN
cpu3: 32KB 64b/line 8-way D-cache, 32KB 64b/line 8-way I-cache, 256KB 64b/line
8-way L2 cache, 3MB 64b/line 12-way L3 cache
cpu3: smt 1, core 1, package 0
ioapic0 at mainbus0: apid 2 pa 0xfec00000, version 20, 24 pins
acpimcfg0 at acpi0
acpimcfg0: addr 0xf8000000, bus 0-63
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus -1 (P0P1)
acpiprt2 at acpi0: bus 1 (RP01)
acpiprt3 at acpi0: bus -1 (RP02)
acpiprt4 at acpi0: bus -1 (RP03)
acpiprt5 at acpi0: bus 2 (RP04)
acpiprt6 at acpi0: bus -1 (RP05)
acpiprt7 at acpi0: bus -1 (RP06)
acpiprt8 at acpi0: bus -1 (RP07)
acpiprt9 at acpi0: bus -1 (RP08)
acpiprt10 at acpi0: bus -1 (PEG0)
acpiprt11 at acpi0: bus -1 (PEG1)
acpiprt12 at acpi0: bus -1 (PEG2)
acpiprt13 at acpi0: bus -1 (PEG3)
acpiec0 at acpi0
acpipci0 at acpi0 PCI0: 0x00000004 0x00000011 0x00000001
acpibat0 at acpi0: BAT1 type LION oem "SAMSUNG Electronics"
acpicmos0 at acpi0
"ETD0B00" at acpi0 not configured
acpiac0 at acpi0: AC unit online
acpibtn0 at acpi0: LID0
acpibtn1 at acpi0: PWRB
"PNP0C0B" at acpi0 not configured
"PNP0C0B" at acpi0 not configured
"PNP0C0B" at acpi0 not configured
"PNP0C0B" at acpi0 not configured
"PNP0C0B" at acpi0 not configured
acpicpu0 at acpi0: C3(200@109 io@0x416), C2(500@80 io@0x414), C1(1000@1 halt),
PSS
acpicpu1 at acpi0: C3(200@109 io@0x416), C2(500@80 io@0x414), C1(1000@1 halt),
PSS
acpicpu2 at acpi0: C3(200@109 io@0x416), C2(500@80 io@0x414), C1(1000@1 halt),
PSS
acpicpu3 at acpi0: C3(200@109 io@0x416), C2(500@80 io@0x414), C1(1000@1 halt),
PSS
acpipwrres0 at acpi0: FN00, resource for FAN0
acpipwrres1 at acpi0: FN01, resource for FAN1
acpipwrres2 at acpi0: FN02, resource for FAN2
acpipwrres3 at acpi0: FN03, resource for FAN3
acpipwrres4 at acpi0: FN04, resource for FAN4
acpitz0 at acpi0: critical temperature is 120 degC
acpitz1 at acpi0: critical temperature is 120 degC
acpivideo0 at acpi0: GFX0
acpivout0 at acpivideo0: DD02
cpu0: using IvyBridge MDS workaround
cpu0: Enhanced SpeedStep 2294 MHz: speeds: 2300, 1800, 1600, 1400, 1200, 1000,
800 MHz
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 "Intel Core 2G Host" rev 0x09
inteldrm0 at pci0 dev 2 function 0 "Intel HD Graphics 3000" rev 0x09
drm0 at inteldrm0
inteldrm0: msi, SANDYBRIDGE, gen 6
"Intel 6 Series MEI" rev 0x04 at pci0 dev 22 function 0 not configured
ehci0 at pci0 dev 26 function 0 "Intel 6 Series USB" rev 0x04: apic 2 int 16
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 configuration 1 interface 0 "Intel EHCI root hub" rev 2.00/1.00
addr 1
azalia0 at pci0 dev 27 function 0 "Intel 6 Series HD Audio" rev 0x04: msi
azalia0: codecs: Realtek ALC269, Intel/0x2805, using Realtek ALC269
audio0 at azalia0
ppb0 at pci0 dev 28 function 0 "Intel 6 Series PCIE" rev 0xb4: msi
pci1 at ppb0 bus 1
iwn0 at pci1 dev 0 function 0 "Intel Centrino Wireless-N 130" rev 0x34: msi,
MIMO 1T2R, BGN, address b8:03:05:d1:49:21
ppb1 at pci0 dev 28 function 3 "Intel 6 Series PCIE" rev 0xb4: msi
pci2 at ppb1 bus 2
re0 at pci2 dev 0 function 0 "Realtek 8168" rev 0x06: RTL8168E/8111E-VL
(0x2c80), msi, address e8:03:9a:e2:92:35
rgephy0 at re0 phy 7: RTL8169S/8110S/8211 PHY, rev. 5
ehci1 at pci0 dev 29 function 0 "Intel 6 Series USB" rev 0x04: apic 2 int 23
usb1 at ehci1: USB revision 2.0
uhub1 at usb1 configuration 1 interface 0 "Intel EHCI root hub" rev 2.00/1.00
addr 1
pcib0 at pci0 dev 31 function 0 "Intel HM65 LPC" rev 0x04
ahci0 at pci0 dev 31 function 2 "Intel 6 Series AHCI" rev 0x04: msi, AHCI 1.3
ahci0: port 0: 6.0Gb/s
ahci0: port 2: 1.5Gb/s
scsibus1 at ahci0: 32 targets
sd0 at scsibus1 targ 0 lun 0: <ATA, ST2000LM015-2E81, 0001> naa.5000c500e4bf58a4
sd0: 1907729MB, 512 bytes/sector, 3907029168 sectors, thin
cd0 at scsibus1 targ 2 lun 0: <Slimtype, DVD A DS8A8SH, KS21> removable
ichiic0 at pci0 dev 31 function 3 "Intel 6 Series SMBus" rev 0x04: apic 2 int 18
iic0 at ichiic0
spdmem0 at iic0 addr 0x50: 4GB DDR3 SDRAM PC3-10600 SO-DIMM
spdmem1 at iic0 addr 0x52: 4GB DDR3 SDRAM PC3-10600 SO-DIMM
isa0 at pcib0
isadma0 at isa0
pckbc0 at isa0 port 0x60/5 irq 1 irq 12
pckbd0 at pckbc0 (kbd slot)
wskbd0 at pckbd0: console keyboard
pms0 at pckbc0 (aux slot)
wsmouse0 at pms0 mux 0
pms0: Elantech Touchpad, version 3, firmware 0x350f00
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
vmm0 at mainbus0: VMX/EPT (using slow L1TF mitigation)
efifb at mainbus0 not configured
uhub2 at uhub0 port 1 configuration 1 interface 0 "Intel Rate Matching Hub" rev
2.00/0.00 addr 2
uvideo0 at uhub2 port 4 configuration 1 interface 0 "Vimicro Vimicro USB Camera
(Phosphor)" rev 2.00/1.60 addr 3
uvideo0: no format descriptors found!
uhub3 at uhub1 port 1 configuration 1 interface 0 "Intel Rate Matching Hub" rev
2.00/0.00 addr 2
umass0 at uhub3 port 1 configuration 1 interface 0 " USB DISK 2.0" rev
2.00/1.10 addr 3
umass0: using SCSI over Bulk-Only
scsibus2 at umass0: 2 targets, initiator 0
sd1 at scsibus2 targ 1 lun 0: <, USB DISK 2.0, PMAP> removable
serial.13fe1e00077612460052
sd1: 1968MB, 512 bytes/sector, 4030464 sectors
ugen0 at uhub3 port 3 "Intel product 0x0189" rev 2.00/69.19 addr 4
vscsi0 at root
scsibus3 at vscsi0: 256 targets
softraid0 at root
scsibus4 at softraid0: 256 targets
sd2 at scsibus4 targ 1 lun 0: <OPENBSD, SR CRYPTO, 006>
sd2: 1907468MB, 512 bytes/sector, 3906496063 sectors
root on sd2a (58fe7e63a98c7ae2.a) swap on sd2b dump on sd2b
inteldrm0: 1366x768, 32bpp
wsdisplay0 at inteldrm0 mux 1: console (std, vt100 emulation), using wskbd0
wsdisplay0: screen 1-5 added (std, vt100 emulation)
sd1 detached
scsibus2 detached
umass0 detached
=================================================================================21258
Disklabel:
# /dev/rsd2c:
type: SCSI
disk: SCSI disk
label: SR CRYPTO
duid: 58fe7e63a98c7ae2
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 243168
total sectors: 3906496063
boundstart: 1024
boundend: 3906496030
16 partitions:
# size offset fstype [fsize bsize cpg]
a: 1027136 1024 4.2BSD 2048 16384 7960 # /
b: 33559785 1028160 swap # none
c: 3906496063 0 unused
d: 8401952 34587968 4.2BSD 2048 16384 12960 # /tmp
e: 8401984 42989920 4.2BSD 2048 16384 12960 # /var
f: 4209056 51391904 4.2BSD 2048 16384 12960 # /var/log
g: 10490432 55600960 4.2BSD 2048 16384 12960 # /usr
h: 4209024 66091392 4.2BSD 2048 16384 12960 # /usr/X11R6
i: 960 64 MSDOS
j: 125837152 70300416 4.2BSD 2048 16384 12960 # /usr/local
k: 1048578560 196137600 4.2BSD 4096 32768 26062 # /home
=================================================================================
Fdisk:
Disk: sd2 Usable LBA: 34 to 3906496029 [3906496063 Sectors]
#: type [ start: size ]
------------------------------------------------------------------------
0: EFI Sys [ 64: 960 ]
1: OpenBSD [ 1024: 3906495006 ]
=================================================================================
booting up without the key inserted
power on
the boot screen displays
probing: pc0 mem [572k 64k 2730M 5374M]
disk hd0 cd0 sr0*
>> openbsd/amd64 BootX64 3.63
keydisk not found
keydisk not found
open (sr0a/etc/boot.conf) : operation not permitted
boot>
keydisk not found
booting sr0a:/bsd : keydisk not found
open sr0a:/bsd : operation not permitted
failed (1) will try bsd
boot>
keydisk not found
booting sr0a:/bsd : keydisk not found
open sr0a:/bsd : operation not permitted
failed (1) will try bsd
turning timeout off
boot>
booting up with the key inserted
i insert the key then power on
the boot screen displays
probing: pc0 mem [572k 64k 2730M 5374M]
disk hd0 hd1 sr0*
>> openbsd/amd64 Bootx64 3.62
open (hd0a/etc/boot.conf) :invalid argument
boot>
cannot open hd0a/etc/random.seed :invalid argument
booting hd0a:/bsd :invalid argument
failed (22) will try bsd
boot>
cannot open hd0a/etc/random.seed :invalid argument
booting hd0a:/bsd :invalid argument
failed (22) will try bsd
turning timeout off
boot>
at this point i type
boot sr0a:/bsd
the boot process then proceeds normally
once booted if i reboot with the key still inserted then
the key is not found,
i have to completely shutdown the laptop then
boot up again and go through the above proceedure.
i've noticed a few things during the booting with and without the keydisk.
without keydisk with keyfisk
disk hd0 cd0 sr0* disk hd0 hd1 sr0*
openbsd/amd64 BootX64 3.63 >> openbsd/amd64 Bootx64 3.62
failed (1) will try bsd failed (22) will try bsd
also i have no idea why i have hd devices showing up at boot time
and i have sd devices in dmesg.
shadrock