Hello,

I'm trying to use a CF card in my OpenBSD 3.9 box and am running into
strange problems.  I have a 64MB CF card which is connected to my PC
through a CF/IDE adapter and available as wd1.  I initialised the CF with
fdisk, disklabel and newfs (commands and output attached below) as
usual.

When I copy files to the CF card, binary files get corrupted (/bsd, /bin/ls,
etc) while text files are all okay (/etc/passwd).  The file sizes are correct
while data differs and I'm unable run any binaries off CF.

I have changed CF cards, CF/IDE adapters, motherboards, and ran 3.8
and 3.9 releases without any luck.  The commands I ran along with their
output on 3.9-release is below.  I have also posted the correct and corrupted
files online.

I'm stumped! Can someone please hit me with a clue stick?
Thanks for taking a few moments to go through this.

Note: BIOS reports CF card CHS 980/4/32 which is matches output
from fdisk.


# dd if=/dev/zero of=/dev/wd1c bs=1k count=200
# fdisk -i wd1c


# fdisk wd1c
Disk: wd1c      geometry: 980/4/32 [125440 Sectors]
Offset: 0       Signature: 0xAA55
        Starting       Ending       LBA Info:
#: id    C   H  S -    C   H  S [       start:      size   ]
------------------------------------------------------------------------
0: 00    0   0  0 -    0   0  0 [           0:           0 ] unused
1: 00    0   0  0 -    0   0  0 [           0:           0 ] unused
2: 00    0   0  0 -    0   0  0 [           0:           0 ] unused
*3: A6    0   1  1 -  979   3 32 [          32:      125408 ] OpenBSD

# disklabel -E /dev/wd1c
...

# disklabel /dev/wd1c
# Inside MBR partition 3: type A6 start 32 size 125408
# /dev/wd1c:
type: ESDI
disk: ESDI/IDE disk
label: Hitachi XXM2.3.0
flags:
bytes/sector: 512
sectors/track: 32
tracks/cylinder: 8
sectors/cylinder: 256
cylinders: 490
total sectors: 125440
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:        125000            32  4.2BSD   2048 16384   16 # Cyl     0*-   489
 c:        125440             0  unused      0     0      # Cyl     0 -   489


# newfs /dev/rwd1a
Warning: inode blocks/cyl group (65) >= data blocks (2) in last
   cylinder group. This implies 72 sector(s) cannot be allocated.
/dev/rwd1a:     124928 sectors in 976 cylinders of 4 tracks, 32 sectors
        61.0MB in 1 cyl groups (976 c/g, 61.00MB/g, 7808 i/g)
super-block backups (for fsck -b #) at:
32,


# fdisk -f -n /dev/wd1a
** /dev/rwd1a (NO WRITE)
** File system is already clean
INCORRECT MAXFILESIZE=1126174851989504 IN SUPERBLOCK
FIX? no

** Last Mounted on /mnt
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
1 files, 1 used, 30718 free (14 frags, 3838 blocks, 0.0% fragmentation)


# mount /dev/wd1a /mnt
# df
Filesystem  512-blocks      Used     Avail Capacity  Mounted on
/dev/wd0a     14710684   2336360  11638792    17%    /
/dev/wd1a       122876         4    116732     0%    /mnt

# cp /bin/sh /mnt
# diff /bin/sh /mnt/sh
Binary files /bin/sh and /mnt/sh differ

#### Note:  files posted online
#### Original files from OpenBSD 3.9 release --
####    http://rajasuperman.googlepages.com/ls
####    http://rajasuperman.googlepages.com/sh
#### Corrupted files from CF card --
####    http://rajasuperman.googlepages.com/ls.cf
####    http://rajasuperman.googlepages.com/sh.cf


# cp /etc/passwd /mnt
# diff /etc/passwd /mnt/passwd      #  no output from diff


# dmesg
OpenBSD 3.9 (GENERIC) #617: Thu Mar  2 02:26:48 MST 2006
   [EMAIL PROTECTED]:/usr/src/sys/arch/i386/compile/GENERIC
cpu0: Intel(R) Pentium(R) 4 CPU 2.40GHz ("GenuineIntel" 686-class) 2.40 GHz
cpu0: 
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,CNXT-ID
real mem  = 259567616 (253484K)
avail mem = 229863424 (224476K)
using 3194 buffers containing 13082624 bytes (12776K) of memory
mainbus0 (root)
bios0 at mainbus0: AT/286+(ce) BIOS, date 03/25/04, BIOS32 rev. 0 @ 0xfb490
apm0 at bios0: Power Management spec V1.2
apm0: AC on, battery charge unknown
apm0: flags 70102 dobusy 1 doidle 1
pcibios0 at bios0: rev 2.1 @ 0xf0000/0xdf84
pcibios0: PCI IRQ Routing Table rev 1.0 @ 0xfdee0/144 (7 entries)
pcibios0: PCI Exclusive IRQs: 3 5 9 10 11
pcibios0: PCI Interrupt Router at 000:31:0 ("Intel 82371SB ISA" rev 0x00)
pcibios0: PCI bus #1 is the last bus
bios0: ROM list: 0xc0000/0xb200!
cpu0 at mainbus0
pci0 at mainbus0 bus 0: configuration mode 1 (no bios)
pchb0 at pci0 dev 0 function 0 "Intel 82845G/GL" rev 0x03
vga1 at pci0 dev 2 function 0 "Intel 82845G/GL Video" rev 0x03:
aperture at 0xe0000000, size 0x4000000
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
uhci0 at pci0 dev 29 function 0 "Intel 82801DB USB" rev 0x02: irq 10
usb0 at uhci0: USB revision 1.0
uhub0 at usb0
uhub0: Intel UHCI root hub, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
uhci1 at pci0 dev 29 function 1 "Intel 82801DB USB" rev 0x02: irq 11
usb1 at uhci1: USB revision 1.0
uhub1 at usb1
uhub1: Intel UHCI root hub, rev 1.00/1.00, addr 1
uhub1: 2 ports with 2 removable, self powered
uhci2 at pci0 dev 29 function 2 "Intel 82801DB USB" rev 0x02: irq 9
usb2 at uhci2: USB revision 1.0
uhub2 at usb2
uhub2: Intel UHCI root hub, rev 1.00/1.00, addr 1
uhub2: 2 ports with 2 removable, self powered
ehci0 at pci0 dev 29 function 7 "Intel 82801DB USB" rev 0x02: irq 3
usb3 at ehci0: USB revision 2.0
uhub3 at usb3
uhub3: Intel EHCI root hub, rev 2.00/1.00, addr 1
uhub3: 6 ports with 6 removable, self powered
ppb0 at pci0 dev 30 function 0 "Intel 82801BA AGP" rev 0x82
pci1 at ppb0 bus 1
unknown vendor 0x163c product 0x3052 (class communications subclass
modem, rev 0x04) at pci1 dev 0 function 0 not configured
sis0 at pci1 dev 6 function 0 "SiS 900 10/100BaseTX" rev 0x02: irq 11,
address 00:0d:87:fa:91:a0
ukphy0 at sis0 phy 0: Generic IEEE 802.3u media interface, rev. 0: OUI
0x000760, model 0x0000
ichpcib0 at pci0 dev 31 function 0 "Intel 82801DB LPC" rev 0x02
pciide0 at pci0 dev 31 function 1 "Intel 82801DB IDE" rev 0x02: DMA,
channel 0 configured to compatibility, channel 1 configured to
compatibility
wd0 at pciide0 channel 0 drive 0: <ST340014A>
wd0: 16-sector PIO, LBA48, 38166MB, 78165360 sectors
wd1 at pciide0 channel 0 drive 1: <Hitachi XXM2.3.0>
wd1: 1-sector PIO, LBA, 61MB, 125184 sectors
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 5
wd1(pciide0:0:1): using PIO mode 1
pciide0: channel 1 disabled (no drives)
ichiic0 at pci0 dev 31 function 3 "Intel 82801DB SMBus" rev 0x02: irq 5
iic0 at ichiic0
auich0 at pci0 dev 31 function 5 "Intel 82801DB AC97" rev 0x02: irq 5, ICH4 AC97
ac97: codec id 0x434d4983 (C-Media Electronics CMI9761A+)
audio0 at auich0
isa0 at ichpcib0
isadma0 at isa0
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pcppi0 at isa0 port 0x61
midi0 at pcppi0: <PC speaker>
spkr0 at pcppi0
lpt0 at isa0 port 0x378/4 irq 7
lm0 at isa0 port 0x290/8: W83627THF
npx0 at isa0 port 0xf0/16: using exception 16
pccom0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
fdc0 at isa0 port 0x3f0/6 irq 6 drq 2
biomask ff6d netmask ff6d ttymask ffef
pctr: user-level cycle counter enabled
dkcsum: wd0 matches BIOS drive 0x80
dkcsum: wd1 matches BIOS drive 0x81
root on wd0a
rootdev=0x0 rrootdev=0x300 rawdev=0x302
wd1: no disk label
syncing disks...
OpenBSD 3.9 (GENERIC) #617: Thu Mar  2 02:26:48 MST 2006
   [EMAIL PROTECTED]:/usr/src/sys/arch/i386/compile/GENERIC
cpu0: Intel(R) Pentium(R) 4 CPU 2.40GHz ("GenuineIntel" 686-class) 2.40 GHz
cpu0: 
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,CNXT-ID
real mem  = 259567616 (253484K)
avail mem = 229863424 (224476K)
using 3194 buffers containing 13082624 bytes (12776K) of memory
mainbus0 (root)
bios0 at mainbus0: AT/286+(ce) BIOS, date 03/25/04, BIOS32 rev. 0 @ 0xfb490
apm0 at bios0: Power Management spec V1.2
apm0: AC on, battery charge unknown
apm0: flags 70102 dobusy 1 doidle 1
pcibios0 at bios0: rev 2.1 @ 0xf0000/0xdf84
pcibios0: PCI IRQ Routing Table rev 1.0 @ 0xfdee0/144 (7 entries)
pcibios0: PCI Exclusive IRQs: 3 5 9 10 11
pcibios0: PCI Interrupt Router at 000:31:0 ("Intel 82371SB ISA" rev 0x00)
pcibios0: PCI bus #1 is the last bus
bios0: ROM list: 0xc0000/0xb200!
cpu0 at mainbus0
pci0 at mainbus0 bus 0: configuration mode 1 (no bios)
pchb0 at pci0 dev 0 function 0 "Intel 82845G/GL" rev 0x03
vga1 at pci0 dev 2 function 0 "Intel 82845G/GL Video" rev 0x03:
aperture at 0xe0000000, size 0x4000000
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
uhci0 at pci0 dev 29 function 0 "Intel 82801DB USB" rev 0x02: irq 10
usb0 at uhci0: USB revision 1.0
uhub0 at usb0
uhub0: Intel UHCI root hub, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
uhci1 at pci0 dev 29 function 1 "Intel 82801DB USB" rev 0x02: irq 11
usb1 at uhci1: USB revision 1.0
uhub1 at usb1
uhub1: Intel UHCI root hub, rev 1.00/1.00, addr 1
uhub1: 2 ports with 2 removable, self powered
uhci2 at pci0 dev 29 function 2 "Intel 82801DB USB" rev 0x02: irq 9
usb2 at uhci2: USB revision 1.0
uhub2 at usb2
uhub2: Intel UHCI root hub, rev 1.00/1.00, addr 1
uhub2: 2 ports with 2 removable, self powered
ehci0 at pci0 dev 29 function 7 "Intel 82801DB USB" rev 0x02: irq 3
usb3 at ehci0: USB revision 2.0
uhub3 at usb3
uhub3: Intel EHCI root hub, rev 2.00/1.00, addr 1
uhub3: 6 ports with 6 removable, self powered
ppb0 at pci0 dev 30 function 0 "Intel 82801BA AGP" rev 0x82
pci1 at ppb0 bus 1
unknown vendor 0x163c product 0x3052 (class communications subclass
modem, rev 0x04) at pci1 dev 0 function 0 not configured
sis0 at pci1 dev 6 function 0 "SiS 900 10/100BaseTX" rev 0x02: irq 11,
address 00:0d:87:fa:91:a0
ukphy0 at sis0 phy 0: Generic IEEE 802.3u media interface, rev. 0: OUI
0x000760, model 0x0000
ichpcib0 at pci0 dev 31 function 0 "Intel 82801DB LPC" rev 0x02
pciide0 at pci0 dev 31 function 1 "Intel 82801DB IDE" rev 0x02: DMA,
channel 0 configured to compatibility, channel 1 configured to
compatibility
wd0 at pciide0 channel 0 drive 0: <ST340014A>
wd0: 16-sector PIO, LBA48, 38166MB, 78165360 sectors
wd1 at pciide0 channel 0 drive 1: <Hitachi XXM2.3.0>
wd1: 1-sector PIO, LBA, 61MB, 125184 sectors
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 5
wd1(pciide0:0:1): using PIO mode 1
pciide0: channel 1 disabled (no drives)
ichiic0 at pci0 dev 31 function 3 "Intel 82801DB SMBus" rev 0x02: irq 5
iic0 at ichiic0
auich0 at pci0 dev 31 function 5 "Intel 82801DB AC97" rev 0x02: irq 5, ICH4 AC97
ac97: codec id 0x434d4983 (C-Media Electronics CMI9761A+)
audio0 at auich0
isa0 at ichpcib0
isadma0 at isa0
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pcppi0 at isa0 port 0x61
midi0 at pcppi0: <PC speaker>
spkr0 at pcppi0
lpt0 at isa0 port 0x378/4 irq 7
lm0 at isa0 port 0x290/8: W83627THF
npx0 at isa0 port 0xf0/16: using exception 16
pccom0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
fdc0 at isa0 port 0x3f0/6 irq 6 drq 2
biomask ff6d netmask ff6d ttymask ffef
pctr: user-level cycle counter enabled
dkcsum: wd0 matches BIOS drive 0x80
dkcsum: wd1 matches BIOS drive 0x81
root on wd0a
rootdev=0x0 rrootdev=0x300 rawdev=0x302

- Raja

Reply via email to