Hi all,

Just to close the loop on this issue for other people running into
this issue in the future.

With many thanks to Ken Westerback (krw@), this was found to be a
small issue in how fdisk wrote the partition entry in the MBR.  So
these entries are stored in two formats, CHS (pre-historic) and LBA
(dark ages).  The problem was that the LBA format was OK, but the CHS
format was wrong.

This combined with the ancient BIOS version on my ALIX (v0.99, as can
be seen in the output below), which apparently had an LBA-issue so the
MBR boot code had to fall back to CHS mode which then tried to boot
from the wrong part of the disk.

The bug was fixed by Ken in 7thnDFCs964LjKPw; see 

https://marc.info/?l=openbsd-cvs&m=168469010101328&w=2 and
http://cvsweb.openbsd.org/src/sbin/fdisk/part.c?rev=1.163&content-type=text/x-cvsweb-markup

But can also be worked around with an update to ALIX BIOS v0.99m (from
2014 (!!!), see https://pcengines.ch/alix2.htm for that version).

So if you're on really old hardware and you see:

Using drive 0, partition 3;
--------------------------^ this semicolon
Loading;......
-------^ and this semicolon

note that these semicolons indicate the system is using CHS to boot,
and that could have issues with fdisk partition entries created with
older fdisk versions (you generally only create fdisk partitions once,
so nothing really breaks if you upgrade to an older release that has
this fdisk bug not fixed).

Also many thanks to others who responded on- and off-list for
suggestions and experiences!

Paul 'WEiRD' de Weerd

On Sat, Apr 29, 2023 at 09:42:03PM +0200, Paul de Weerd wrote:
| The 4GB CF card in an old ALIX machine failed.  I swapped the card
| with a new (32GB) one and reinstalled, but now during boot I get:
| 
| --- booting from local storage ---------------------------------------
| PC Engines ALIX.2 v0.99
| 640 KB Base Memory
| 261120 KB Extended Memory
| 
| 01F0 Master 848A SDCFXS-032G                             
| Phys C/H/S 62041/16/63 Log C/H/S 3892/255/63 LBA
| 
| Using drive 0, partition 3;
| No O/S
| ----------------------------------------------------------------------
| 
| When I use the boot loader from TFTP I can boot from disk just fine:
| 
| --- booting from network ---------------------------------------------
| PC Engines ALIX.2 v0.99
| 640 KB Base Memory
| 261120 KB Extended Memory
| 
| 01F0 Master 848A SDCFXS-032G                             
| Phys C/H/S 62041/16/63 Log C/H/S 3892/255/63 LBA
| 
| Intel UNDI, PXE-2.0 (build 082)
| Copyright (C) 1997,1998,1999  Intel Corporation
| VIA Rhine III Management Adapter v2.43 (2005/12/15)
| 
| CLIENT MAC ADDR: 00 0D B9 14 6C 58  
| CLIENT IP: 192.168.34.248  MASK: 255.255.255.0  DHCP IP: 192.168.34.1         
 
| GATEWAY IP: 192.168.34.1 
| probing: pc0 com0 pxe![2.1] mem[640K 255M a20=on]                             
 
| disk: hd0
| net: mac 00:0d:b9:14:6c:58, ip 192.168.34.248, server 192.168.34.2
| >> OpenBSD/i386 PXEBOOT 3.45
| open(tftp:/etc/boot.conf): Operation not permitted
| boot> stty com0 38400
| boot> set tty com0
| switching console to com0
| >> OpenBSD/i386 PXEBOOT 3.45
| boot> boot hd0a:/bsd
| booting hd0a:/bsd: 10615315+2581508+204808+0+1134592 
[740729+107+609424+659874]=0xfc9e58
| entry point at 0x201000
| 
| [ using 2010712 bytes of bsd ELF symbol table ]
| Copyright (c) 1982, 1986, 1989, 1991, 1993
|         The Regents of the University of California.  All rights reserved.
| Copyright (c) 1995-2023 OpenBSD. All rights reserved.  https://www.OpenBSD.org
| 
| OpenBSD 7.3-current (GENERIC) #691: Fri Apr 28 15:28:14 MDT 2023
|     dera...@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC
| RTC BIOS diagnostic error 80<clock_battery>
| real mem  = 267931648 (255MB)
| avail mem = 245862400 (234MB)
| random: good seed from bootblocks
| mpath0 at root
| scsibus0 at mpath0: 256 targets
| mainbus0 at root
| bios0 at mainbus0: date 12/10/07, BIOS32 rev. 0 @ 0xfceb2
| pcibios0 at bios0: rev 2.1 @ 0xf0000/0x10000
| pcibios0: pcibios_get_intr_routing - function not supported
| pcibios0: PCI IRQ Routing information unavailable.
| pcibios0: PCI bus #0 is the last bus
| bios0: ROM list: 0xe0000/0xa800
| cpu0 at mainbus0: (uniprocessor)
| cpu0: Geode(TM) Integrated Processor by AMD PCS ("AuthenticAMD" 586-class) 
499 MHz, 05-0a-02
| cpu0: FPU,DE,PSE,TSC,MSR,CX8,SEP,PGE,CMOV,CFLUSH,MMX,MMXX,3DNOW2,3DNOW
| mtrr: K6-family MTRR support (2 registers)
| pci0 at mainbus0 bus 0: configuration mode 1 (no bios)
| pchb0 at pci0 dev 1 function 0 "AMD Geode LX" rev 0x33
| glxsb0 at pci0 dev 1 function 2 "AMD Geode LX Crypto" rev 0x00: RNG AES
| vr0 at pci0 dev 9 function 0 "VIA VT6105M RhineIII" rev 0x96: irq 10, address 
00:0d:b9:14:6c:58
| ukphy0 at vr0 phy 1: Generic IEEE 802.3u media interface, rev. 3: OUI 
0x004063, model 0x0034
| vr1 at pci0 dev 10 function 0 "VIA VT6105M RhineIII" rev 0x96: irq 11, 
address 00:0d:b9:14:6c:59
| ukphy1 at vr1 phy 1: Generic IEEE 802.3u media interface, rev. 3: OUI 
0x004063, model 0x0034
| vr2 at pci0 dev 11 function 0 "VIA VT6105M RhineIII" rev 0x96: irq 12, 
address 00:0d:b9:14:6c:5a
| ukphy2 at vr2 phy 1: Generic IEEE 802.3u media interface, rev. 3: OUI 
0x004063, model 0x0034
| glxpcib0 at pci0 dev 15 function 0 "AMD CS5536 ISA" rev 0x03: rev 3, 32-bit 
3579545Hz timer, watchdog, gpio, i2c
| gpio0 at glxpcib0: 32 pins
| iic0 at glxpcib0
| maxtmp0 at iic0 addr 0x4c: lm86
| pciide0 at pci0 dev 15 function 2 "AMD CS5536 IDE" rev 0x01: DMA, channel 0 
wired to compatibility, channel 1 wired to compatibility
| wd0 at pciide0 channel 0 drive 0: <SDCFXS-032G>
| wd0: 1-sector PIO, LBA48, 30535MB, 62537328 sectors
| wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 4
| pciide0: channel 1 ignored (disabled)
| ohci0 at pci0 dev 15 function 4 "AMD CS5536 USB" rev 0x02: irq 15, version 
1.0, legacy support
| ehci0 at pci0 dev 15 function 5 "AMD CS5536 USB" rev 0x02: irq 15
| usb0 at ehci0: USB revision 2.0
| uhub0 at usb0 configuration 1 interface 0 "AMD EHCI root hub" rev 2.00/1.00 
addr 1
| isa0 at glxpcib0
| isadma0 at isa0
| com0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
| com0: console
| pcppi0 at isa0 port 0x61
| spkr0 at pcppi0
| npx0 at isa0 port 0xf0/16: reported by CPUID; using exception 16
| usb1 at ohci0: USB revision 1.0
| uhub1 at usb1 configuration 1 interface 0 "AMD OHCI root hub" rev 1.00/1.00 
addr 1
| nvram: invalid checksum
| vscsi0 at root
| scsibus1 at vscsi0: 256 targets
| softraid0 at root
| scsibus2 at softraid0: 256 targets
| root on wd0a (ccd1db21646168f7.a) swap on wd0b dump on wd0b
| clock: unknown CMOS layout
| WARNING: bad clock chip time
| WARNING: CHECK AND RESET THE DATE!
| Automatic boot in progress: starting file system checks.
| ----------------------------------------------------------------------
| 
| If I understand correctly, the 'No O/S' bit comes from the MBR
| (/usr/src/sys/arch/i386/stand/mbr/mbr.S), it indicates it can't find
| the bootloader on disk, so I re-ran installboot which seemed to work
| fine:
| 
| --- installboot -v wd0 -----------------------------------------------
| Using / as root
| installing bootstrap on /dev/rwd0c
| using first-stage /usr/mdec/biosboot, second-stage /usr/mdec/boot
| copying /usr/mdec/boot to //boot
| looking for superblock at 65536
| found valid ffs2 superblock
| //boot is 6 blocks x 16384 bytes
| fs block shift 2; part offset 64; inode block 96, offset 1904
| expecting 64-bit fs blocks (incr 4)
| master boot record (MBR) at sector 0
|         partition 3: type 0xA6 offset 64 size 62537264
| /usr/mdec/biosboot will be written at sector 64
| ----------------------------------------------------------------------
| 
| But the result is the same: the machine doesn't boot (unexpectedly -
| the installer did run installboot while installing the system).
| 
| Trying to reproduce in an i386 vmm VM, everything worked fine there,
| so I'm suspecting it's something to do with the hardware, perhaps CHS
| vs LBA?  Anybody an idea what this could be?
| 
| Paul
| 
| -- 
| >++++++++[<++++++++++>-]<+++++++.>+++[<------>-]<.>+++[<+
| +++++++++++>-]<.>++[<------------>-]<+.--------------.[-]
|                  http://www.weirdnet.nl/                 
| 

-- 
>++++++++[<++++++++++>-]<+++++++.>+++[<------>-]<.>+++[<+
+++++++++++>-]<.>++[<------------>-]<+.--------------.[-]
                 http://www.weirdnet.nl/                 

Reply via email to