Summary
-------
My primary laptop ("nitrogen") died, so I moved its disk to a backup
laptop ("oxygen").  That laptop then died. :(  I have now moved the
former-nitrogen-disk to an external enclosure so that I can access my
files via USB from still another laptop ("silver").

When I connect the USB cable to silver I see the usual dmesg lines.
But the former-nitrogen-disk contents are "wierd":
* fdisk and disklabel look fine, but
* if I mount any one of the partitions,
  * 'df -i' looks fine (shows lots of space & inodes used)
  * but 'ls -a' and 'echo *' say there are no files present

If I try to fsck any of the partitions, I get the following error
# fsck -p /dev/rsd1a
CANNOT READ: BLK 128
/dev/rsd1a: UNEXPECTED INCONSISTENCY; RUN fsck_ffs MANUALLY.
# fsck -n /dev/rsd1a
** /dev/rsd1a (NO WRITE)

CANNOT READ: BLK 128
CONTINUE? yes

THE FOLLOWING DISK SECTORS COULD NOT BE READ: 128, 129, 130, 131, 132, 133, 
134, 135, 136, 137, 138, 139, 140, 141, 142, 143,

LOOK FOR ALTERNATE SUPERBLOCKS? no

#
What's suspicious is that I get this identical message (including the
exact same sector numbers) for *any* partition.  While I could certainly
imagine that whatever broke nitrogen and oxygen managed to corrupt the
disk contents, it seems implausible that it would garble the exact same
list of sectors on each of several different FFS partitions.

Instead, my symptoms look more like a disk-addressing mixup between
oxygen/nitrogen and the external enclosure.

Can anyone suggest (in more detail) what's going on here, and/or what
I can do to fix it (i.e., access the former-nitrogen-disk filesystems
from another laptop)?  I'd at least like to understand the problem a
bit before I go blindly poking around with fsck...


Further details
---------------
* oxygen and nitrogen are both Thinkpad T42 laptops, and were running
  4.6-stable/i386; dmesg below
* silver is an HP Pavillion dv4, freshly installed with 4.7-release/i386
  from the CD set
* I know silver's USB system & the USB cable are ok, because I just used
  them (including the same USB cable) to recover a week-old backup copy
  of my home directory from an (another) external USB disk
* the former-nitrogen-disk is a Hitachi HTS541616J9AT00 160GB 2.5" PATA
  disk.  The external enclosure is labelled "Rocketfish RF-PHD25 2.5"
  Enclosure kit for hard drives"; it (and the disk within) is powered
  via the USB connection.

The dmesg when connecting the USB cable to the external enclosure is:
> sd1 at scsibus2 targ 1 lun 0: <Hitachi, HTS541616J9AT00, 0 0> SCSI0 0/direct 
> fixed
> sd1: 152627MB, 512 bytes/sec, 312581808 sec total
The size and sector count matches those reported in nitrogen's dmesg
(given below) back when it was working properly.

Here are the fdisk and disklabel output:
# fdisk sd1
Disk: sd1       geometry: 19457/255/63 [312581808 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 -  19456 239  63 [          63:   312575697 ] OpenBSD     
# disklabel sd1
# /dev/rsd1c:
type: ESDI
disk: ESDI/IDE disk
label: Hitachi HTS54161
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 240
sectors/cylinder: 15120
cylinders: 20673
total sectors: 312581808
rpm: 3600
interleave: 1
boundstart: 63
boundend: 312575760
drivedata: 0 

16 partitions:
#                size           offset  fstype [fsize bsize  cpg]
  a:          1058337               63  4.2BSD   2048 16384    1 
  b:          4203360          1058400    swap                   
  c:        312581808                0  unused                   
  d:          1058400          5261760  4.2BSD   2048 16384    1 
  e:          1058400          6320160  4.2BSD   2048 16384    1 
  f:          1058400          7378560  4.2BSD   2048 16384    1 
  g:         15739920          8436960  4.2BSD   2048 16384    1 
  h:         15739920         24176880  4.2BSD   2048 16384    1 
  j:        272658960         39916800  4.2BSD   2048 16384    1 
#

Here is what mounting a partition looked like (before I noticed the
fsck anomolies):
# mount -r /dev/sd1a /mnt
# cd /mnt
# df -hi .
Filesystem     Size    Used   Avail Capacity iused   ifree  %iused  Mounted on
/dev/sd1a      507M    177M    304M    37%    5388   77170     7%   /mnt
# ls -lFgd .
drwxr-xr-x  21 root  wheel  1024 Oct 15 16:01 ./
# ls -la
# echo *
echo: No match.
#

This partition (the "a" one) should be an FFS filesystem containing
nitrogen's root partition.

nitrogen's dmesg:
--- begin dmesg ---
Date: Wed, 28 Oct 2009 11:39:34 -0400 (EDT)
From: Jonathan Thornburg <jth...@astro.indiana.edu>
To: dm...@openbsd.org
Subject: IBM/Lenovo Thinkpad T42 laptop, X works fine

OpenBSD 4.6 (GENERIC) #58: Thu Jul  9 21:24:42 MDT 2009
    dera...@i386.openbsd.org:/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,SEP,MTRR,PGE,MCA,CMOV,PAT,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,TM,SBF,EST,TM2
real mem  = 2146398208 (2046MB)
avail mem = 2066685952 (1970MB)
mainbus0 at root
bios0 at mainbus0: AT/286+ BIOS, date 06/18/04, BIOS32 rev. 0 @ 0xfd750, SMBIOS 
rev. 2.33 @ 0xe0010 (61 entries)
bios0: vendor IBM version "1RETCDWW (3.06f)" date 06/18/2004
bios0: IBM 23738ZU
apm0 at bios0: Power Management spec V1.2
apm0: battery life expectancy 97%
apm0: AC on, battery charge high
acpi at bios0 function 0x0 not configured
pcibios0 at bios0: rev 2.1 @ 0xfd6e0/0x920
pcibios0: PCI IRQ Routing Table rev 1.0 @ 0xfdea0/272 (15 entries)
pcibios0: PCI Interrupt Router at 000:31:0 ("Intel 82371FB ISA" rev 0x00)
pcibios0: PCI bus #6 is the last bus
bios0: ROM list: 0xc0000/0x10000 0xe0000/0x10000
cpu0 at mainbus0: (uniprocessor)
cpu0: Enhanced SpeedStep 1799 MHz: speeds: 1800, 1600, 1400, 1200, 1000, 800, 
600 MHz
pci0 at mainbus0 bus 0: configuration mode 1 (bios)
io address conflict 0x5800/0x8
io address conflict 0x5808/0x4
io address conflict 0x5810/0x8
io address conflict 0x580c/0x4
pchb0 at pci0 dev 0 function 0 "Intel 82855PM Host" rev 0x03
intelagp0 at pchb0
agp0 at intelagp0: aperture at 0xd0000000, size 0x10000000
ppb0 at pci0 dev 1 function 0 "Intel 82855PM AGP" rev 0x03
pci1 at ppb0 bus 1
vga1 at pci1 dev 0 function 0 "ATI Radeon Mobility M10" rev 0x00
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
radeondrm0 at vga1: irq 11
drm0 at radeondrm0
uhci0 at pci0 dev 29 function 0 "Intel 82801DB USB" rev 0x01: irq 11
uhci1 at pci0 dev 29 function 1 "Intel 82801DB USB" rev 0x01: irq 11
uhci2 at pci0 dev 29 function 2 "Intel 82801DB USB" rev 0x01: irq 11
ehci0 at pci0 dev 29 function 7 "Intel 82801DB USB" rev 0x01: irq 11
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 "Intel EHCI root hub" rev 2.00/1.00 addr 1
ppb1 at pci0 dev 30 function 0 "Intel 82801BAM Hub-to-PCI" rev 0x81
pci2 at ppb1 bus 2
mem address conflict 0xb0000000/0x1000
mem address conflict 0xb1000000/0x1000
cbb0 at pci2 dev 0 function 0 "TI PCI4520 CardBus" rev 0x01: irq 11
cbb1 at pci2 dev 0 function 1 "TI PCI4520 CardBus" rev 0x01: irq 11
em0 at pci2 dev 1 function 0 "Intel PRO/1000MT (82540EP)" rev 0x03: irq 11, 
address 00:0d:60:fc:eb:f8
ath0 at pci2 dev 2 function 0 "Atheros AR5212 (IBM MiniPCI)" rev 0x01: irq 11
ath0: AR5213 5.6 phy 4.1 rf5111 1.7 rf2111 2.3, WOR1W, address 00:05:4e:4b:1a:8f
cardslot0 at cbb0 slot 0 flags 0
cardbus0 at cardslot0: bus 3 device 0 cacheline 0x8, lattimer 0xb0
pcmcia0 at cardslot0
cardslot1 at cbb1 slot 1 flags 0
cardbus1 at cardslot1: bus 6 device 0 cacheline 0x8, lattimer 0xb0
pcmcia1 at cardslot1
ichpcib0 at pci0 dev 31 function 0 "Intel 82801DBM LPC" rev 0x01: 24-bit timer 
at 3579545Hz
pciide0 at pci0 dev 31 function 1 "Intel 82801DBM IDE" rev 0x01: DMA, channel 0 
configured to compatibility, channel 1 configured to compatibility
wd0 at pciide0 channel 0 drive 0: <Hitachi HTS541616J9AT00>
wd0: 16-sector PIO, LBA48, 152627MB, 312581808 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: <HL-DT-ST, RW/DVD GCC-4242N, 0201> ATAPI 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 0x01: irq 11
iic0 at ichiic0
spdmem0 at iic0 addr 0x50: 1GB DDR SDRAM non-parity PC2700CL2.5
spdmem1 at iic0 addr 0x51: 1GB DDR SDRAM non-parity PC2700CL2.5
auich0 at pci0 dev 31 function 5 "Intel 82801DB AC97" rev 0x01: irq 11, ICH4 
AC97
ac97: codec id 0x41445374 (Analog Devices AD1981B)
ac97: codec features headphone, 20 bit DAC, No 3D Stereo
audio0 at auich0
"Intel 82801DB Modem" rev 0x01 at pci0 dev 31 function 6 not configured
usb1 at uhci0: USB revision 1.0
uhub1 at usb1 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb2 at uhci1: USB revision 1.0
uhub2 at usb2 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb3 at uhci2: USB revision 1.0
uhub3 at usb3 "Intel UHCI root hub" rev 1.00/1.00 addr 1
isa0 at ichpcib0
isadma0 at isa0
com0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
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
lpt2 at isa0 port 0x3bc/4: polled
aps0 at isa0 port 0x1600/31
npx0 at isa0 port 0xf0/16: reported by CPUID; using exception 16
biomask efed netmask efed ttymask ffff
mtrr: Pentium Pro MTRR support
softraid0 at root
root on wd0a swap on wd0b dump on wd0b
--- end dmesg ---

-- 
-- "Jonathan Thornburg [remove -animal to reply]" 
<jth...@astro.indiana-zebra.edu>
   Dept of Astronomy, Indiana University, Bloomington, Indiana, USA
   "Washing one's hands of the conflict between the powerful and the
    powerless means to side with the powerful, not to be neutral."
                                      -- quote by Freire / poster by Oxfam

Reply via email to