hi there, i have bought a very nice little 160GB external usb disk. i have left the fat32 partition in place, except that i made it 8G shorter and have put ffs in there for openbsd backup purposes. hotplugd mounted both partitions fine, i worked with it for some time. today i started getting strange errors from windows when copying to the fat32 partition, namely "sector not found" and "disk is full" messages.
chkdsk said all is fine. i was puzzled. so i opened partitionmagic which greeted me with the following errors: "PowerQuest PartitionMagic has detected an error 116 on the partition starting at sector 295804656 on disk2. the starting LBA value is 295894656 and the CHS value is 16434495. the LBA and CHS values must be equal. PowerQuest PartitionMagic has verified that the LBA value is correct and can fix the CHS value. fix this error?" after hitting [yes], another one: "PowerQuest PartitionMagic has detected an error 110 on the partition starting at sector 63 on disk2. the length of the partition in the partition table is incorrect. the CHS length is 295789725, the LBA length is 295804593, and the File System length is 295804593. PowerQuest PartitionMagic has determined that the length can be changed to the correct value of 295804782. fix this error?" after "fixing" these errors the first partition became "BAD" and the second unusable. using the storage manager in windows i deleted the openbsd partition and everything went back to normal. almost normal. i could recreate the partition and i did, but a fat32 this time. i found out that it doesn't matter, if the disk is mounted under openbsd the partition table becomes corrupted. this is were i looked at the disks from openbsd and using partitioninfo a utility by powerquest. i was quite surprised: this is my wd0 in my notebook: amaaq> fdisk wd0 Disk: wd0 geometry: 9729/255/63 [156296385 Sectors] Offset: 0 Signature: 0xAA55 Starting Ending LBA Info: #: id C H S - C H S [ start: size ] ------------------------------------------------------------------------ 0: 07 0 1 1 - 1977 254 63 [ 63: 31776507 ] HPFS/QNX/AUX 1: 0C 1978 0 1 - 8198 254 63 [ 31776570: 99940365 ] Win95 FAT32L *2: A6 8199 0 1 - 9728 254 63 [ 131716935: 24579450 ] OpenBSD 3: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused powerquest: =========================================================================================================== Disk Geometry Information for Disk 1: 9729 Cylinders, 255 Heads, 63 Sectors/Track System PartSect # Boot BCyl Head Sect FS ECyl Head Sect StartSect NumSects =========================================================================================================== 0 0 80 0 1 1 07 1977 254 63 63 31,776,507 0 1 00 1978 0 1 0C 8198 254 63 31,776,570 99,940,365 0 2 00 8199 0 1 A6 9728 254 63 131,716,935 24,579,450 peace and harmony -- everything the same. now here is my new toy (indenting the fdisk for readability): amaaq> fdisk sd0 fdisk: sysctl(machdep.bios.diskinfo): Device not configured Disk: sd0 geometry: 152627/64/32 [312581808 Sectors] Offset: 0 Signature: 0xAA55 Starting Ending LBA Info: #: id C H S - C H S [ start: size ] ------------------------------------------------------------------------ *0: 0C 0 1 32 - 144435 55 16 [ 63: 295804593 ] Win95 FAT32L 1: 0C 144435 55 17 - 152627 53 16 [ 295804656: 16777152 ] Win95 FAT32L 2: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused 3: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused where is my nice */255/63 geometry i thought at this point... these partitions are definitely not on CHS boundaries... funny thing is, even partitioninfo barfed and came up with an entirely different geometry (but "aligned" the partitions to CHS boundary): =========================================================================================================== Disk Geometry Information for Disk 2: 310,101 Cylinders, 16 Heads, 63 Sectors/Track System PartSect # Boot BCyl Head Sect FS ECyl Head Sect StartSect NumSects =========================================================================================================== 0 0 80 0 1 1 0C 293,456 15 63 63 295,804,593 0 1 00 293457 0 1 0C 310,100 15 63 295,804,656 16,777,152 at this point i had to do the "repairing" dance again, deleting the second partition, chkdsk, recreating the partition in partitionmagic, then i replugged the disk, and this seemed much better: =========================================================================================================== Disk Geometry Information for Disk 2: 19457 Cylinders, 255 Heads, 63 Sectors/Track System PartSect # Boot BCyl Head Sect FS ECyl Head Sect StartSect NumSects =========================================================================================================== 0 0 80 0 1 1 0C 18412 254 63 63 295,804,782 0 1 00 18413 0 1 0C 19456 254 63 295,804,845 16,771,860 but wait, i have another 200GB external disk... amaaq> fdisk sd1 fdisk: sysctl(machdep.bios.diskinfo): Device not configured Disk: sd1 geometry: 190782/64/32 [390721968 Sectors] Offset: 0 Signature: 0xAA55 Starting Ending LBA Info: #: id C H S - C H S [ start: size ] ------------------------------------------------------------------------ 0: 07 0 1 32 - 50007 1 7 [ 63: 102414312 ] HPFS/QNX/AUX 1: 0C 95393 50 2 - 190779 46 1 [ 195366465: 195350400 ] Win95 FAT32L 2: 0C 50007 1 8 - 95393 50 1 [ 102414375: 92952090 ] Win95 FAT32L 3: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused =========================================================================================================== Disk Geometry Information for Disk 2: 24321 Cylinders, 255 Heads, 63 Sectors/Track System PartSect # Boot BCyl Head Sect FS ECyl Head Sect StartSect NumSects =========================================================================================================== 0 0 00 0 1 1 07 6374 254 63 63 102,414,312 0 1 00 12161 0 1 0C 24320 254 63 195,366,465 195,350,400 0 2 00 6375 0 1 0C 12160 254 63 102,414,375 92,952,090 once again, i find the windows readings more reassuring... the scary thing is, that the errors always reappear if i mount sd0 under openbsd. it is correcting/corrupting the partition table and messes up the CHS vs LBA settings (as partition magic says) the strange thing is, that i have sd1 for quite long now, and i have never come across this before, i can mount them rw and this corruption does not come up. why with sd0? why are the geometries different in the 2 systems? with internal harddisks i have seen the */255/63 geometry all my life (but i don't have anything exotic) is the "geometry autodetecting" mechanism barfing in openbsd? could this be because of the scsi layer emulation? should i set the geometry by hand? would it help? i have meant to ask this years ago, but now is a good time, could someone please elaborate why are all the wd* disks being emulated as scsi disks? after all, these are wd* beasts, aren't they? and how can i run atactl(8) on these external disks? disklabels and dmesg coming up: amaaq> disklabel wd0 # Inside MBR partition 2: type A6 start 131716935 size 24579450 # /dev/rwd0c: type: ESDI disk: ESDI/IDE disk label: TOSHIBA MK8025GA flags: bytes/sector: 512 sectors/track: 63 tracks/cylinder: 16 sectors/cylinder: 1008 cylinders: 16383 total sectors: 156301488 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: 16895529 131716935 4.2BSD 2048 16384 328 # Cyl 130671*-147432 b: 1331568 148612464 swap # Cyl 147433 -148753 c: 156301488 0 unused 0 0 # Cyl 0 -155060 d: 6352353 149944032 4.2BSD 2048 16384 328 # Cyl 148754 -155055* i: 31776507 63 unknown # Cyl 0*- 31524* j: 99940365 31776570 MSDOS # Cyl 31524*-130671* amaaq> disklabel sd0 disklabel: warning, DOS partition table with no valid OpenBSD partition # /dev/rsd0c: type: SCSI disk: SCSI disk label: 1600BEVExternal flags: bytes/sector: 512 sectors/track: 32 tracks/cylinder: 64 sectors/cylinder: 2048 cylinders: 152627 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] c: 312581808 0 unused 0 0 # Cyl 0 -152627* i: 295804593 63 MSDOS # Cyl 0*-144435* j: 16777152 295804656 MSDOS # Cyl 144435*-152627* amaaq> disklabel sd1 disklabel: warning, DOS partition table with no valid OpenBSD partition # /dev/rsd1c: type: SCSI disk: SCSI disk label: 2000JB External flags: bytes/sector: 512 sectors/track: 32 tracks/cylinder: 64 sectors/cylinder: 2048 cylinders: 190782 total sectors: 390721968 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] c: 390721968 0 unused 0 0 # Cyl 0 -190782* i: 102414312 63 unknown # Cyl 0*- 50007* j: 195350400 195366465 MSDOS # Cyl 95393*-190779* k: 92952090 102414375 MSDOS # Cyl 50007*- 95393* OpenBSD 4.0 (GENERIC) #1107: Sat Sep 16 19:15:58 MDT 2006 [EMAIL PROTECTED]:/usr/src/sys/arch/i386/compile/GENERIC cpu0: Intel(R) Pentium(R) M processor 1.80GHz ("GenuineIntel" 686-class) 1.80 GHz cpu0: FPU,V86,DE,PSE,TSC,MSR,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,TM,SBF,EST,TM2 cpu0: Enhanced SpeedStep 1800 MHz (1340 mV): speeds: 1800, 1600, 1400, 1200, 1000, 800, 600 MHz real mem = 535326720 (522780K) avail mem = 480366592 (469108K) using 4256 buffers containing 26869760 bytes (26240K) of memory mainbus0 (root) bios0 at mainbus0: AT/286+(8b) BIOS, date 03/23/05, BIOS32 rev. 0 @ 0xfd700, SMBIOS rev. 2.31 @ 0xd6010 (31 entries) bios0: TOSHIBA Satellite M30X apm0 at bios0: Power Management spec V1.2 apm0: AC on, battery charge unknown apm0: flags 30102 dobusy 0 doidle 1 pcibios0 at bios0: rev 2.1 @ 0xfd700/0x900 pcibios0: PCI IRQ Routing Table rev 1.0 @ 0xfdf20/192 (10 entries) pcibios0: PCI Interrupt Router at 000:31:0 ("Intel 82371FB ISA" rev 0x00) pcibios0: PCI bus #3 is the last bus bios0: ROM list: 0xc0000/0x10000 0xd0000/0x1000 0xd6000/0x800! 0xe0000/0x4000! cpu0 at mainbus0 pci0 at mainbus0 bus 0: configuration mode 1 (no bios) pchb0 at pci0 dev 0 function 0 "Intel 82852GM Hub-PCI" rev 0x02 "Intel 82852GM Memory" rev 0x02 at pci0 dev 0 function 1 not configured "Intel 82852GM Configuration" rev 0x02 at pci0 dev 0 function 3 not configured ppb0 at pci0 dev 1 function 0 "Intel 82852/82855 AGP" rev 0x02 pci1 at ppb0 bus 1 vga1 at pci1 dev 0 function 0 "ATI Radeon Mobility M10 NP" rev 0x00 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 0x03: 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 0x03: irq 5 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 0x03: irq 4 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 0x03: irq 11 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 ppb1 at pci0 dev 30 function 0 "Intel 82801BAM Hub-to-PCI" rev 0x83 pci2 at ppb1 bus 2 "VIA VT6306 FireWire" rev 0x80 at pci2 dev 0 function 0 not configured rl0 at pci2 dev 1 function 0 "Realtek 8139" rev 0x10: irq 11, address 00:02:3f:db:8a:23 rlphy0 at rl0 phy 0: RTL internal PHY iwi0 at pci2 dev 2 function 0 "Intel PRO/Wireless 2200BG" rev 0x05: irq 11, address 00:0e:35:7b:e7:4f cbb0 at pci2 dev 4 function 0 "ENE CB-710 CardBus" rev 0x00: irq 10 vendor "ENE", unknown product 0x0530 (class memory subclass flash, rev 0x00) at pci2 dev 4 function 1 not configured sdhc0 at pci2 dev 4 function 2 vendor "ENE", unknown product 0x0550 rev 0x00: irq 11 sdmmc0 at sdhc0 vendor "ENE", unknown product 0x0520 (class memory subclass flash, rev 0x00) at pci2 dev 4 function 3 not configured cbb0: bad Vcc request. sock_ctrl 0xffffff88, sock_status 0xffffffff cardslot0 at cbb0 slot 0 flags 0 cardbus0 at cardslot0: bus 3 device 0 cacheline 0x8, lattimer 0x20 pcmcia0 at cardslot0 ichpcib0 at pci0 dev 31 function 0 "Intel 82801DBM LPC" rev 0x03 pciide0 at pci0 dev 31 function 1 "Intel 82801DBM IDE" rev 0x03: DMA, channel 0 configured to compatibility, channel 1 configured to compatibility wd0 at pciide0 channel 0 drive 0: <TOSHIBA MK8025GAS> wd0: 16-sector PIO, LBA, 76319MB, 156301488 sectors wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 5 atapiscsi0 at pciide0 channel 1 drive 0 scsibus0 at atapiscsi0: 2 targets cd0 at scsibus0 targ 0 lun 0: <TSSTcorp, CD/DVDW SN-S082D, SS02> SCSI0 5/cdrom removable cd0(pciide0:1:0): using PIO mode 4, Ultra-DMA mode 2 ichiic0 at pci0 dev 31 function 3 "Intel 82801DB SMBus" rev 0x03: irq 11 iic0 at ichiic0 "unknown" at iic0 addr 0x18 not configured auich0 at pci0 dev 31 function 5 "Intel 82801DB AC97" rev 0x03: irq 11, ICH4 AC97 ac97: codec id 0x414c4752 (Avance Logic ALC250A?) ac97: codec features headphone, 20 bit DAC, 18 bit ADC, No 3D Stereo audio0 at auich0 "Intel 82801DB Modem" rev 0x03 at pci0 dev 31 function 6 not configured 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 pms0 at pckbc0 (aux slot) pckbc0: using irq 12 for aux slot wsmouse0 at pms0 mux 0 pcppi0 at isa0 port 0x61 midi0 at pcppi0: <PC speaker> spkr0 at pcppi0 lpt0 at isa0 port 0x378/4 irq 7 npx0 at isa0 port 0xf0/16: using exception 16 pccom1 at isa0 port 0x2f8/8 irq 3: ns16550a, 16 byte fifo biomask ef75 netmask ef75 ttymask fff7 pctr: 686-class user-level performance counters enabled mtrr: Pentium Pro MTRR support umass0 at uhub3 port 4 configuration 1 interface 0 umass0: Western Digital External HDD, rev 2.00/1.02, addr 2 umass0: using SCSI over Bulk-Only scsibus1 at umass0: 2 targets sd0 at scsibus1 targ 1 lun 0: <WD, 1600BEVExternal, 1.02> SCSI0 0/direct fixed sd0: 152627MB, 152627 cyl, 64 head, 32 sec, 512 bytes/sec, 312581808 sec total uhidev0 at uhub1 port 1 configuration 1 interface 0 uhidev0: KYE NetScroll+ Traveler, rev 1.10/0.00, addr 2, iclass 3/1 ums0 at uhidev0: 3 buttons and Z dir. wsmouse1 at ums0 mux 0 dkcsum: wd0 matches BIOS drive 0x80 dkcsum: sd0 matches BIOS drive 0x81 root on wd0a rootdev=0x0 rrootdev=0x300 rawdev=0x302 umass1 at uhub3 port 5 configuration 1 interface 0 umass1: Western Digital External HDD, rev 2.00/4.11, addr 3 umass1: using SCSI over Bulk-Only scsibus2 at umass1: 2 targets sd1 at scsibus2 targ 1 lun 0: <WD, 2000JB External, 0411> SCSI0 0/direct fixed sd1: 190782MB, 190782 cyl, 64 head, 32 sec, 512 bytes/sec, 390721968 sec total uhidev1 at uhub3 port 5 configuration 1 interface 1 uhidev1: Western Digital External HDD, rev 2.00/4.11, addr 3, iclass 3/0 uhid0 at uhidev1: input=2, output=2, feature=0 -f -- the devil can cite scripture for his purpose.