O O Ø O O O O
OpenBSD Boot Hackery
MBR
It only took a few years, but I finally came across the bug in our Master Boot Record code. Mickey had a fix sitting in his source tree. This is fixed in -current.
If you are experiencing the Partition:0 Disk:3 hang, this new MBR should fix your problem. I have a downloadable copy here. To install it, boot from a floppy (or CD) and do a:
# dd if=/dev/rwd0c of=mbr.save bs=512 count=1
# fdisk -f mbr.new -e wd0
Enter 'help' for information
fdisk: 1> update
Machine code updated.
fdisk:*1> quit
Writing current MBR to disk.
In Current, this is much easier, as fdisk has been fixed to act like the DOS FDISK /MBR command:
# fdisk -uf mbr.new wd0
fdisk
OpenBSD's fdisk is a little less-than-friendly when it comes to large hard drives. I have made some fixes that make editing partitions over the 1024 cylinder mark significantly easier. Fixes include:
- "print" now takes a modifier to indicate what units to display when printing sizes. Modifiers include bytes, sectors, kilobytes, megabytes, and gigabytes.
fdisk: 1> print
Disk: wd0 geometry: 2584/240/63 [39070080 Sectors]
Offset: 0 Signature: 0xAA55
Starting Ending LBA Info:
#: id C H S - C H S [ start: size ]
------------------------------------------------------------------------
*0: 0B 558 1 1 - 1014 239 63 [ 8437023: 6909777 ] Win95 FAT-32
1: 0F 1015 0 1 - 2413 239 63 [ 15346800: 21152880 ] Extended LBA
2: 1C 2414 0 1 - 2583 239 63 [ 36499680: 2570400 ]
3: A6 0 1 1 - 557 239 63 [ 63: 8436897 ] OpenBSD
fdisk: 1> print m
Disk: wd0 geometry: 2584/240/63 [19077 Megabytes]
Offset: 0 Signature: 0xAA55
Starting Ending LBA Info:
#: id C H S - C H S [ start: size ]
------------------------------------------------------------------------
*0: 0B 558 1 1 - 1014 239 63 [ 8437023: 3374M] Win95 FAT-32
1: 0F 1015 0 1 - 2413 239 63 [ 15346800: 10329M] Extended LBA
2: 1C 2414 0 1 - 2583 239 63 [ 36499680: 1255M]
3: A6 0 1 1 - 557 239 63 [ 63: 4120M] OpenBSD
fdisk: 1>
Isn't that much prettier?
CHS notation may now be used to create partitions with cylinder values over 1024. Since the partition table can't really handle these, the large CHS values are used to set the size/offset portion of the partition table correctly, and the cylinders are truncated to 1023 when the MBR is written out to disk. The end result, however, is that everything works out like you think it should. Here's a sample (from one of my machines). Note those large cylinder values:
Disk: wd0 geometry: 2584/240/63 [39070080 Sectors]
Offset: 0 Signature: 0xAA55
Starting Ending LBA Info:
#: id C H S - C H S [ start: size ]
------------------------------------------------------------------------
*0: 0B 558 1 1 - 1014 239 63 [ 8437023: 6909777 ] Win95 FAT-32
1: 0F 1015 0 1 - 2413 239 63 [ 15346800: 21152880 ] Extended LBA
2: 1C 2414 0 1 - 2583 239 63 [ 36499680: 2570400 ]
3: A6 0 1 1 - 557 239 63 [ 63: 8436897 ] OpenBSD
Offset: 15346800 Signature: 0xAA55
Starting Ending LBA Info:
#: id C H S - C H S [ start: size ]
------------------------------------------------------------------------
0: 07 1015 1 1 - 1556 239 63 [ 15346863: 8194977 ] HPFS/QNX/AUX
1: A6 1557 0 1 - 1695 168 8 [ 23541840: 2097152 ] OpenBSD
2: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused
3: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused
Large Hard Drives
To the best of my knowledge, booting >8G now works under OpenBSD. I had nothing whatsoever to do with it, though.