Saturday, July 01, 2017

ext2 or usb problem

I have three Toshiba 1TB USB drives that I use for backups and
archives of my various systems. These disks pre-date my predominant
use of OpenBSD, and have ext2 file-systems. One of the disks is the
primary, to which new backups and archives are written. Another is the
secondary. When the primary changes, I have a script that rsyncs the
primary to the secondary. There's also a tertiary drive in my safe
deposit box, so there's an off-site copy of all this stuff.
Periodically, I rotate their roles, so the off-site drive doesn't get
too stale.

I did some backups yesterday to the primary drive and, for the first
time, ran the rsync script to copy primary to secondary on OpenBSD. I
created directories /tmp/primary and /tmp/secondary on which to mount
each of the file-systems. Then I mounted the primary drive with write
access and archived some files. I then umounted it with the intention
of re-mounting it read-only, except I got distracted at the wrong
moment by a phone call and didn't do it. After the call, I mounted the
secondary drive read-write and started the script to rsync the primary
to the secondary. Because there was nothing mounted on /tmp/primary,
rsync started deleting files wholesale. When I saw what was happening,
I ctrl-c-ed out of the script, did a df and saw my error. Shouldn't be
a big deal.

So I mounted the primary drive read-only and re-started the rsync
script and the right thing happened -- files that had been deleted on
the secondary drive were being copied from the primary. It got to a
file that I knew to be fairly large, so I got up and went off to do
other things. I was gone for a couple of hours. When I came back, it
was still on the same file and the light on the secondary drive was
blinking constantly. I opened another terminal and did a bunch of dfs,
separated by a few seconds, and the blocks-in-use count did not
change. I did some more dfs to be sure and got the same result. This
was clearly not making progress, so I ctrl-c-ed out of the script and
decided to finish this on a Linux system. I was not going to use the
OpenBSD system on which I was doing this any more yesterday, so I ran
shutdown, with the intent of pulling both drive connectors after the
power went off. Except the system would not shut down. I got the
'Syncing disks' message and there it sat. The light on the secondary
drive was still blinking. I waited for quite a few minutes, far longer
than this usually takes, and finally, with no other options, I pulled
the secondary drive's connector from the machine's usb socket. Some
kernel messages appeared and the system shut down.

This morning, I took the drives to the Linux system and,
understanding that the secondary drive probably had not been sync-ed
properly, ran fsck. There were many inconsistencies and problems with
the meta-data, but I got through it and fsck completed. I am now
running the rsync script on the Linux machine and it is proceeding
normally, well past the place where things got stuck on OpenBSD
yesterday.

I am guessing, but do not know, that the trouble here is either in the
ext2 support or perhaps in the usb driver. If ext2, I realize that it
is not widely used in the OpenBSD community. But the support is there
and I chose the ext2 file-system for this reason, wanting a
file-system that would work on either Linux or OpenBSD. I could have
chosen UFS/FFS, but I didn't trust the support in Linux. Perhaps a bad
decision.

I realize that debugging this is likely to be difficult, but I will
try to help in any way I can.

OpenBSD 6.1-current (GENERIC.MP) #69: Fri May 19 09:08:02 MDT 2017
deraadt@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 8458735616 (8066MB)
avail mem = 8196587520 (7816MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 3.0 @ 0xbd1b7000 (89 entries)
bios0: vendor LENOVO version "FWKT63A" date 12/08/2016
bios0: LENOVO 10HYCTO1WW
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP APIC FPDT FIDT TCPA MCFG HPET SSDT LPIT SSDT
SSDT SSDT DBGP DBG2 SSDT MSDM SSDT UEFI SSDT LUFT ASF! BGRT
acpi0: wakeup devices PEGP(S4) PEG0(S4) PEGP(S4) PEG1(S4) PEGP(S4)
PEG2(S4) SIO1(S3) PXSX(S4) RP09(S4) PXSX(S4) RP10(S4) PXSX(S4)
RP11(S4) PXSX(S4) RP12(S4) PXSX(S4) [...]
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Pentium(R) CPU G4400T @ 2.90GHz, 2904.00 MHz
cpu0: FPU,VME,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,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,SDBG,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,RDRAND,NXE,PAGE1GB,RDTSCP,LONG,LAHF,ABM,3DNOWP,PERF,ITSC,FSGSBASE,SGX,ERMS,INVPCID,RDSEED,SMAP,CLFLUSHOPT,PT,SENSOR,ARAT
cpu0: 256KB 64b/line 8-way L2 cache
cpu0: TSC frequency 2904000000 Hz
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 10 var ranges, 88 fixed ranges
cpu0: apic clock running at 23MHz
cpu0: mwait min=64, max=64, C-substates=0.2.1.2.4.1, IBE
cpu1 at mainbus0: apid 2 (application processor)
cpu1: Intel(R) Pentium(R) CPU G4400T @ 2.90GHz, 2904.00 MHz
cpu1: FPU,VME,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,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,SDBG,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,RDRAND,NXE,PAGE1GB,RDTSCP,LONG,LAHF,ABM,3DNOWP,PERF,ITSC,FSGSBASE,SGX,ERMS,INVPCID,RDSEED,SMAP,CLFLUSHOPT,PT,SENSOR,ARAT
cpu1: 256KB 64b/line 8-way L2 cache
cpu1: smt 0, core 1, package 0
ioapic0 at mainbus0: apid 2 pa 0xfec00000, version 20, 120 pins
acpimcfg0 at acpi0 addr 0xe0000000, bus 0-255
acpihpet0 at acpi0: 23999999 Hz
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus -1 (PEG0)
acpiprt2 at acpi0: bus -1 (PEG1)
acpiprt3 at acpi0: bus -1 (PEG2)
acpiprt4 at acpi0: bus -1 (RP09)
acpiprt5 at acpi0: bus -1 (RP10)
acpiprt6 at acpi0: bus -1 (RP11)
acpiprt7 at acpi0: bus -1 (RP12)
acpiprt8 at acpi0: bus -1 (RP13)
acpiprt9 at acpi0: bus -1 (RP01)
acpiprt10 at acpi0: bus -1 (RP02)
acpiprt11 at acpi0: bus -1 (RP03)
acpiprt12 at acpi0: bus -1 (RP04)
acpiprt13 at acpi0: bus -1 (RP05)
acpiprt14 at acpi0: bus -1 (RP06)
acpiprt15 at acpi0: bus -1 (RP07)
acpiprt16 at acpi0: bus -1 (RP08)
acpiprt17 at acpi0: bus -1 (RP17)
acpiprt18 at acpi0: bus -1 (RP18)
acpiprt19 at acpi0: bus -1 (RP19)
acpiprt20 at acpi0: bus -1 (RP20)
acpiprt21 at acpi0: bus -1 (RP14)
acpiprt22 at acpi0: bus -1 (RP15)
acpiprt23 at acpi0: bus -1 (RP16)
acpiec0 at acpi0: not present
acpicpu0 at acpi0: C3(200@256 mwait.1@0x40), C2(200@151 mwait.1@0x33),
C1(1000@1 mwait.1), PSS
acpicpu1 at acpi0: C3(200@256 mwait.1@0x40), C2(200@151 mwait.1@0x33),
C1(1000@1 mwait.1), PSS
acpipwrres0 at acpi0: PG00, resource for PEG0
acpipwrres1 at acpi0: PG01, resource for PEG1
acpipwrres2 at acpi0: PG02, resource for PEG2
acpipwrres3 at acpi0: WRST
acpipwrres4 at acpi0: WRST
acpipwrres5 at acpi0: WRST
acpipwrres6 at acpi0: WRST
acpipwrres7 at acpi0: WRST
acpipwrres8 at acpi0: WRST
acpipwrres9 at acpi0: WRST
acpipwrres10 at acpi0: WRST
acpipwrres11 at acpi0: WRST
acpipwrres12 at acpi0: WRST
acpipwrres13 at acpi0: WRST
acpipwrres14 at acpi0: WRST
acpipwrres15 at acpi0: WRST
acpipwrres16 at acpi0: WRST
acpipwrres17 at acpi0: WRST
acpipwrres18 at acpi0: WRST
acpipwrres19 at acpi0: WRST
acpipwrres20 at acpi0: WRST
acpipwrres21 at acpi0: WRST
acpipwrres22 at acpi0: WRST
acpipwrres23 at acpi0: FN00, resource for FAN0
acpipwrres24 at acpi0: FN01, resource for FAN1
acpipwrres25 at acpi0: FN02, resource for FAN2
acpipwrres26 at acpi0: FN03, resource for FAN3
acpipwrres27 at acpi0: FN04, resource for FAN4
acpitz0 at acpi0: critical temperature is 119 degC
acpitz1 at acpi0: critical temperature is 119 degC
"INT3F0D" at acpi0 not configured
acpibtn0 at acpi0: SLPB
"PNP0C14" at acpi0 not configured
"INT33A1" at acpi0 not configured
acpibtn1 at acpi0: PWRB
tpm0 at acpi0: TPM_ addr 0xfed40000/0x5000: WEC WPCT200 rev 0x2
"INT340E" at acpi0 not configured
"PNP0C0B" at acpi0 not configured
"PNP0C0B" at acpi0 not configured
"PNP0C0B" at acpi0 not configured
"PNP0C0B" at acpi0 not configured
"PNP0C0B" at acpi0 not configured
"PNP0C14" at acpi0 not configured
"LEN4001" at acpi0 not configured
acpivideo0 at acpi0: GFX0
acpivout0 at acpivideo0: DD1F
cpu0: Enhanced SpeedStep 2904 MHz: speeds: 2801, 2800, 2700, 2600,
2400, 2300, 2100, 2000, 1800, 1700, 1500, 1400, 1200, 1100, 900, 800
MHz
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 "Intel Core 6G Host" rev 0x07
vga1 at pci0 dev 2 function 0 vendor "Intel", unknown product 0x1902 rev 0x06
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
xhci0 at pci0 dev 20 function 0 "Intel 100 Series xHCI" rev 0x31: msi
usb0 at xhci0: USB revision 3.0
uhub0 at usb0 configuration 1 interface 0 "Intel xHCI root hub" rev
3.00/1.00 addr 1
"Intel 100 Series MEI" rev 0x31 at pci0 dev 22 function 0 not configured
ahci0 at pci0 dev 23 function 0 "Intel 100 Series AHCI" rev 0x31: msi,
AHCI 1.3.1
ahci0: port 0: 6.0Gb/s
ahci0: PHY offline on port 1
ahci0: PHY offline on port 2
ahci0: PHY offline on port 3
ahci0: PHY offline on port 4
ahci0: PHY offline on port 5
scsibus1 at ahci0: 32 targets
sd0 at scsibus1 targ 0 lun 0: <ATA, SanDisk SD8SB8U1, X412> SCSI3
0/direct fixed naa.5001b444a6b93e2c
sd0: 122104MB, 512 bytes/sector, 250069680 sectors, thin
pcib0 at pci0 dev 31 function 0 "Intel B150 LPC" rev 0x31
"Intel 100 Series PMC" rev 0x31 at pci0 dev 31 function 2 not configured
azalia0 at pci0 dev 31 function 3 "Intel 100 Series HD Audio" rev 0x31: msi
azalia0: codecs: Realtek/0x0233, Intel/0x2809, using Realtek/0x0233
audio0 at azalia0
ichiic0 at pci0 dev 31 function 4 "Intel 100 Series SMBus" rev 0x31:
apic 2 int 16
iic0 at ichiic0
em0 at pci0 dev 31 function 6 "Intel I219-V" rev 0x31: msi, address
00:23:24:d8:20:60
isa0 at pcib0
isadma0 at isa0
pckbc0 at isa0 port 0x60/5 irq 1 irq 12
pckbd0 at pckbc0 (kbd slot)
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
uhidev0 at uhub0 port 4 configuration 1 interface 0 "Microsoft
Microsoft 3-Button Mouse with IntelliEye(TM)" rev 1.10/3.00 addr 2
uhidev0: iclass 3/1
ums0 at uhidev0: 3 buttons, Z dir
wsmouse0 at ums0 mux 0
uhidev1 at uhub0 port 5 configuration 1 interface 0 "vendor 0x05af USB
Keyboard" rev 1.10/1.01 addr 3
uhidev1: iclass 3/1
ukbd0 at uhidev1: 8 variable keys, 6 key codes
wskbd1 at ukbd0 mux 1
wskbd1: connecting to wsdisplay0
uhidev2 at uhub0 port 5 configuration 1 interface 1 "vendor 0x05af USB
Keyboard" rev 1.10/1.01 addr 3
uhidev2: iclass 3/1, 2 report ids
uhid0 at uhidev2 reportid 1: input=1, output=0, feature=0
uhid1 at uhidev2 reportid 2: input=2, output=0, feature=0
vscsi0 at root
scsibus2 at vscsi0: 256 targets
softraid0 at root
scsibus3 at softraid0: 256 targets
root on sd0a (d8287128904972be.a) swap on sd0b dump on sd0b

No comments:

Post a Comment