Too many partitions?l

2009-04-23 Thread Nick Guenther
I set up a dual booting OpenBSD/ubuntu (only for the audio, I swear!)
install. I made sure to have the Ubuntu installer make an ext2 data
partition for sharing. For some reason OpenBSd couldn't see the ext2
partition until I added it manually. I would like to know why.

Here's my fdisk:
$ fdisk sd0
Disk: sd0   geometry: 19457/255/63 [312581808 Sectors]
Offset: 0   Signature: 0xAA55
Starting Ending LBA Info:
 #: id  C   H   S -  C   H   S [   start:size ]
---
 0: 83  0   1   1 -   2431 254  63 [  63:39070017 ] Linux files*
 1: 05   2432   0   1 -   2674 254  63 [39070080: 3903795 ] Extended DOS
*2: A6   2675   0   1 -   5106 254  63 [42973875:39070080 ] OpenBSD
 3: 83   5107   0   1 -  19456 254  63 [82043955:   230532750 ] Linux files*
Offset: 39070080Signature: 0xAA55
Starting Ending LBA Info:
 #: id  C   H   S -  C   H   S [   start:size ]
---
 0: 82   2432   1   1 -   2674 254  63 [39070143: 3903732 ] Linux swap
 1: 00  0   0   0 -  0   0   0 [   0:   0 ] unused
 2: 00  0   0   0 -  0   0   0 [   0:   0 ] unused
 3: 00  0   0   0 -  0   0   0 [   0:   0 ] unused
$

and original disklabel:
$ disklabel sd0
# Extended partition 1: type 05 start 39070080 size 3903795
# /dev/rsd0c:
type: SCSI
disk: SCSI disk
label: TOSHIBA MK1637GS
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 19457
total sectors: 312581808
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0   # microseconds
track-to-track seek: 0  # microseconds
drivedata: 0

16 partitions:
#size   offset  fstype [fsize bsize  cpg]
  a:  1253070 42973875  4.2BSD   2048 163841
  b:  1253070 44226945swap
  c:3125818080  unused
  d:  2329425 45480015  4.2BSD   2048 163841
  e:  2329425 47809440  4.2BSD   2048 163841
  f:  8530515 50138865  4.2BSD   2048 163841
  g:  2104515 58669380  4.2BSD   2048 163841
  h:  5285385 60773895  4.2BSD   2048 163841
  i: 39070017   63  ext2fs
  j:  3180870 66059280  4.2BSD   2048 163841
  k:  3903732 39070143 unknown
  l:  4209030 69240150  4.2BSD   2048 163841
  m:  8594775 73449180  4.2BSD   2048 163841

I used the 'b' command to extend disklabel(8)'s idea of the OpenBSD
area, and then it let me add this:
  n:230532750 82043955  ext2fs


and dmesg for good measure:
OpenBSD 4.5-current (GENERIC.MP) #80: Mon Apr 20 12:59:56 MDT 2009
dera...@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC.MP
cpu0: Intel(R) Core(TM)2 CPU U7600 @ 1.20GHz (GenuineIntel 686-class) 1.20 GHz
cpu0: 
FPU,V86,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,SBF,SSE3,MWAIT,DS-CPL,VMX,EST,TM2,CX16,xTPR
real mem  = 1064202240 (1014MB)
avail mem = 1020690432 (973MB)
mainbus0 at root
bios0 at mainbus0: AT/286+ BIOS, date 10/30/07, BIOS32 rev. 0 @
0xfcb25, SMBIOS rev. 2.4 @ 0xec000 (40 entries)
bios0: vendor TOSHIBA version Version 1.50 date 10/30/2007
bios0: TOSHIBA PORTEGE R500
acpi0 at bios0: rev 0
acpi0: tables DSDT FACP SSDT APIC MCFG HPET TCPA SLIC SSDT SSDT
acpi0: wakeup devices USB1(S3) USB3(S3) USB4(S3) EHCI(S3) GLAN(S4)
WLAN(S4) LID_(S4) PWRB(S4) HS87(S4) HS86(S4)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: apic clock running at 133MHz
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Intel(R) Core(TM)2 CPU U7600 @ 1.20GHz (GenuineIntel 686-class) 1.20 GHz
cpu1: 
FPU,V86,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,SBF,SSE3,MWAIT,DS-CPL,VMX,EST,TM2,CX16,xTPR
ioapic0 at mainbus0: apid 1 pa 0xfec0, version 20, 24 pins
ioapic0: misconfigured as apic 0, remapped to apid 1
acpihpet0 at acpi0: 14318179 Hz
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 3 (PCIB)
acpiprt2 at acpi0: bus 1 (PEX1)
acpiprt3 at acpi0: bus 2 (MPEX)
acpitz0 at acpi0: critical temperature 102 degC
acpicpu0 at acpi0
acpicpu1 at acpi0
acpibtn0 at acpi0: LID_
acpibat0 at acpi0: BAT1 model G71C00086210 serial 000796 type
Li-ION   oem 0
acpibtn1 at acpi0: PWRB
acpiac0 at acpi0: AC unit online
acpidock at acpi0 not configured
acpivideo at acpi0 not configured
bios0: ROM list: 0xc/0x1 0xe/0x1!
cpu0: unknown Enhanced SpeedStep CPU, msr 0x060b090e0600090e
cpu0: using only highest and lowest 

Re: Too many partitions?l

2009-04-23 Thread Theo de Raadt
 I set up a dual booting OpenBSD/ubuntu (only for the audio, I swear!)
 install. I made sure to have the Ubuntu installer make an ext2 data
 partition for sharing. For some reason OpenBSd couldn't see the ext2
 partition until I added it manually. I would like to know why.

The exact way that this works is not well documented.  Let me explain it
here.  I don't want to add this to any manual page, sorry.

A MBR is found.  If inside it we find a A6 partition we look for a
disklabel at the right offset.  If that disklabel is validated
(checksums, etc) then we use that disklabel as read from the disk, exactly
as it is.

If any of the above fails then we generate a spoofed label.  This is
filled with information that we find from the MBR.  (On other architectures
without an MBR, we may also do some other kinds of spoofing).

If you read a spoofed label, and modify it and write it out, it becomes
a real label for the next boot, as described above.  New MBR partitions
will not be noticed.

 After adding partition 'n' I can mount and use my data drive fine. My
 only guess was that I had too many partitions, but the FAQ says up to
 'p') which is greater than 'n' so that's not it. So any ideas why
 OpenBSD didn't pick up the data partition on it's own? If you look
 closely you'll see that it picked up the ubuntu root drive (as sd0i)
 which was also not within the original disklabel(8) b limits.

It was there originally.  The other one was not.  Hmm, there may be another
problem in that it will only spoof 3 partitions (it should probably be able
to spoof more).