>Synopsis: rw mount on read-only usb-sticks leads to unusable usb port
>Category: system usb
>Environment:
System : OpenBSD 5.1
Details : OpenBSD 5.1 (GENERIC.MP) #207: Sun Feb 12 09:42:14 MST
2012
[email protected]:/usr/src/sys/arch/amd64/compile/GENERIC.MP
Architecture: OpenBSD.amd64
Machine : amd64
>Description:
With some usb-sticks which have a read-only switch the status is not
correctly detected. When you accidently mount such a stick read-write
it is not possible to use the usb port anymore until you reboot the
system.
>How-To-Repeat:
On the testsystem I have two usb-sticks. Both have a ffs filesystem.
That one with iSerialNumber 1916060078113E00 works as expected and that
one with iSerialNumber 08AD320000003957 not.
The easiest way to verify that the read-only status is correctly
detected is by running fsck:
fsck on iSerialNumbeR 1916060078113E00
# fsck /dev/sd1a
** /dev/rsd1a (NO WRITE)
** File system is clean; not checking
=> Stick is in read-only position and so the no write state is correct
fsck on iSerialNumber 08AD320000003957
# fsck /dev/sd0a
** /dev/rsd0a
** File system is clean; not checking
=> Stick is in read-only position and the no write state is missing
When you try to mount /dev/sd1a you get directly a "Permission denied"
message:
# mount /dev/sd1a /mnt/
mount_ffs: /dev/sd1a on /mnt: Permission denied
=> So everything is ok with this stick
With /dev/sd0a the sticks gets mounted and a error messages appears in
dmesg
# mount /dev/sd0a /mnt/
# dmesg
....
sd0(umass0:1:0): Check Condition (error 0x70) on opcode 0x2a
SENSE KEY: Write Protected
ASC/ASCQ: Write Protected
# df
....
/dev/sd0a 7772668 4 7384032 0% /mnt
When you try to umount the stick you get more error messages:
# umount /dev/sd0a
# dmesg
....
sd0(umass0:1:0): Check Condition (error 0x70) on opcode 0x2a
SENSE KEY: Write Protected
ASC/ASCQ: Write Protected
sd0(umass0:1:0): Check Condition (error 0x70) on opcode 0x2a
SENSE KEY: Write Protected
ASC/ASCQ: Write Protected
# df doesn't how the mount anymore
As of now the stick and the usb port is not usable anymore.
When you try to mount it read-only:
# mount -o ro /dev/sd0a /mnt/
mount_ffs: /dev/sd0a on /mnt: Device busy
Even if you remove the stick and reattache it there are no new dmesg
entries and you can still not use the usb port anymore until you
reboot the system.
On a linux system the read-only state is correctly detected for both
sticks.
If I can do anything else to help with this problem please let me know.
dmesg:
OpenBSD 5.1 (GENERIC.MP) #207: Sun Feb 12 09:42:14 MST 2012
[email protected]:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 3210084352 (3061MB)
avail mem = 3110531072 (2966MB)
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.4 @ 0xbf6c7000 (81 entries)
bios0: vendor FUJITSU SIEMENS // Phoenix Technologies Ltd. version "6.00
R1.08.2317.A2" date 02/08/2007
bios0: FUJITSU SIEMENS CELSIUS W
acpi0 at bios0: rev 0
acpi0: sleep states S0 S1 S3 S4 S5
acpi0: tables DSDT FACP TCPA ASF! SLIC MCFG HPET APIC BOOT
acpi0: wakeup devices PEXA(S4) PEXB(S4) PEXC(S4) PEXD(S4) USB1(S3) USB2(S3)
USB3(S3) USB4(S3) USB5(S3) USB6(S3) USB7(S3) USB8(S3) PCIH(S4) KEYB(S4)
PS2M(S4) COM1(S1)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimcfg0 at acpi0 addr 0xe0000000, bus 0-11
acpihpet0 at acpi0: 14318179 Hz
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Pentium(R) D CPU 3.00GHz, 2992.93 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,SBF,SSE3,MWAIT,DS-CPL,EST,CNXT-ID,CX16,xTPR,PDCM,NXE,LONG,LAHF
cpu0: 2MB 64b/line 8-way L2 cache
cpu0: apic clock running at 223MHz
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Intel(R) Pentium(R) D CPU 3.00GHz, 3351.64 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,SBF,SSE3,MWAIT,DS-CPL,EST,CNXT-ID,CX16,xTPR,PDCM,NXE,LONG,LAHF
cpu1: 2MB 64b/line 8-way L2 cache
ioapic0 at mainbus0: apid 2 pa 0xfec00000, version 20, 24 pins
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus -1 (PEXA)
acpiprt2 at acpi0: bus 3 (PEXB)
acpiprt3 at acpi0: bus -1 (PEXC)
acpiprt4 at acpi0: bus 9 (PEXD)
acpiprt5 at acpi0: bus 12 (PCIH)
acpicpu0 at acpi0
acpicpu1 at acpi0
acpibtn0 at acpi0: PWRB
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 "Intel 82Q965 Host" rev 0x02
vga1 at pci0 dev 2 function 0 "Intel 82Q965 Video" rev 0x02
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
intagp0 at vga1
agp0 at intagp0: aperture at 0xc0000000, size 0x10000000
inteldrm0 at vga1: apic 2 int 16
drm0 at inteldrm0
"Intel 82Q965 Video" rev 0x02 at pci0 dev 2 function 1 not configured
uhci0 at pci0 dev 26 function 0 "Intel 82801H USB" rev 0x02: apic 2 int 20
uhci1 at pci0 dev 26 function 1 "Intel 82801H USB" rev 0x02: apic 2 int 18
ehci0 at pci0 dev 26 function 7 "Intel 82801H USB" rev 0x02: apic 2 int 18
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 "Intel EHCI root hub" rev 2.00/1.00 addr 1
azalia0 at pci0 dev 27 function 0 "Intel 82801H HD Audio" rev 0x02: msi
azalia0: codecs: Realtek ALC260
audio0 at azalia0
ppb0 at pci0 dev 28 function 0 "Intel 82801H PCIE" rev 0x02: msi
pci1 at ppb0 bus 3
ppb1 at pci0 dev 28 function 5 "Intel 82801H PCIE" rev 0x02: msi
pci2 at ppb1 bus 9
bge0 at pci2 dev 0 function 0 "Broadcom BCM5755" rev 0x02, BCM5755 A2 (0xa002):
apic 2 int 17, address 00:30:05:c3:32:11
brgphy0 at bge0 phy 1: BCM5755 10/100/1000baseT PHY, rev. 0
uhci2 at pci0 dev 29 function 0 "Intel 82801H USB" rev 0x02: apic 2 int 23
uhci3 at pci0 dev 29 function 1 "Intel 82801H USB" rev 0x02: apic 2 int 22
uhci4 at pci0 dev 29 function 2 "Intel 82801H USB" rev 0x02: apic 2 int 21
ehci1 at pci0 dev 29 function 7 "Intel 82801H USB" rev 0x02: apic 2 int 23
usb1 at ehci1: USB revision 2.0
uhub1 at usb1 "Intel EHCI root hub" rev 2.00/1.00 addr 1
ppb2 at pci0 dev 30 function 0 "Intel 82801BA Hub-to-PCI" rev 0xf2
pci3 at ppb2 bus 12
pcib0 at pci0 dev 31 function 0 "Intel 82801H LPC" rev 0x02
pciide0 at pci0 dev 31 function 2 "Intel 82801H SATA" rev 0x02: DMA, channel 0
configured to native-PCI, channel 1 configured to native-PCI
pciide0: using apic 2 int 19 for native-PCI interrupt
wd0 at pciide0 channel 0 drive 0: <ST3160815AS>
wd0: 16-sector PIO, LBA48, 152627MB, 312581808 sectors
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 6
ichiic0 at pci0 dev 31 function 3 "Intel 82801H SMBus" rev 0x02: apic 2 int 19
iic0 at ichiic0
spdmem0 at iic0 addr 0x50: 512MB DDR2 SDRAM non-parity PC2-5300CL5
spdmem1 at iic0 addr 0x51: 2GB DDR2 SDRAM non-parity PC2-5300CL5
spdmem2 at iic0 addr 0x52: 512MB DDR2 SDRAM non-parity PC2-5300CL5
pciide1 at pci0 dev 31 function 5 "Intel 82801H SATA" rev 0x02: DMA, channel 0
wired to native-PCI, channel 1 wired to native-PCI
pciide1: using apic 2 int 22 for native-PCI interrupt
"Intel 82801H DMI-PCI" rev 0x00 at pci0 dev 31 function 6 not configured
usb2 at uhci0: USB revision 1.0
uhub2 at usb2 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb3 at uhci1: USB revision 1.0
uhub3 at usb3 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb4 at uhci2: USB revision 1.0
uhub4 at usb4 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb5 at uhci3: USB revision 1.0
uhub5 at usb5 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb6 at uhci4: USB revision 1.0
uhub6 at usb6 "Intel UHCI root hub" rev 1.00/1.00 addr 1
isa0 at pcib0
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
spkr0 at pcppi0
mtrr: Pentium Pro MTRR support
umass0 at uhub0 port 3 configuration 1 interface 0 "PQI USB Flash Drive" rev
2.00/11.00 addr 2
umass0: using SCSI over Bulk-Only
scsibus0 at umass0: 2 targets, initiator 0
sd0 at scsibus0 targ 1 lun 0: <Generic, USB Flash Disk, 1100> SCSI2 0/direct
removable serial.35380901320000003957
sd0: 3861MB, 512 bytes/sector, 7907328 sectors
uhidev0 at uhub4 port 1 configuration 1 interface 0 "Logitech USB Mouse" rev
1.10/29.00 addr 2
uhidev0: iclass 3/1
ums0 at uhidev0: 3 buttons, Z dir
wsmouse0 at ums0 mux 0
vscsi0 at root
scsibus1 at vscsi0: 256 targets
softraid0 at root
scsibus2 at softraid0: 256 targets
root on wd0a (7bc8f1db95ff72e5.a) swap on wd0b dump on wd0b
WARNING: / was not properly unmounted
umass1 at uhub0 port 4 configuration 1 interface 0 "USB 2.0 Flash Drive" rev
2.00/1.00 addr 3
umass1: using SCSI over Bulk-Only
scsibus3 at umass1: 2 targets, initiator 0
sd1 at scsibus3 targ 1 lun 0: <USB 2.0, Flash Drive, 5.00> SCSI2 0/direct
removable serial.02046025060078113E00
sd1: 243MB, 512 bytes/sector, 497920 sectors
sd1 detached
scsibus3 detached
umass1 detached
umass1 at uhub0 port 4 configuration 1 interface 0 "USB 2.0 Flash Drive" rev
2.00/1.00 addr 3
umass1: using SCSI over Bulk-Only
scsibus3 at umass1: 2 targets, initiator 0
sd1 at scsibus3 targ 1 lun 0: <USB 2.0, Flash Drive, 5.00> SCSI2 0/direct
removable serial.02046025060078113E00
sd1: 243MB, 512 bytes/sector, 497920 sectors
usbdevs:
Controller /dev/usb0:
addr 1: high speed, self powered, config 1, EHCI root hub(0x0000),
Intel(0x8086), rev 1.00
port 1 powered
port 2 powered
port 3 addr 2: high speed, power 500 mA, config 1, USB Flash Drive(0x0901),
PQI(0x3538), rev 11.00, iSerialNumber 08AD320000003957
port 4 addr 3: high speed, power 100 mA, config 1, Flash Drive(0x6025), USB
2.0(0x0204), rev 1.00, iSerialNumber 1916060078113E00
Controller /dev/usb1:
addr 1: high speed, self powered, config 1, EHCI root hub(0x0000),
Intel(0x8086), rev 1.00
port 1 powered
port 2 powered
port 3 powered
port 4 powered
port 5 powered
port 6 powered
Controller /dev/usb2:
addr 1: full speed, self powered, config 1, UHCI root hub(0x0000),
Intel(0x8086), rev 1.00
port 1 powered
port 2 powered
Controller /dev/usb3:
addr 1: full speed, self powered, config 1, UHCI root hub(0x0000),
Intel(0x8086), rev 1.00
port 1 powered
port 2 powered
Controller /dev/usb4:
addr 1: full speed, self powered, config 1, UHCI root hub(0x0000),
Intel(0x8086), rev 1.00
port 1 addr 2: low speed, power 50 mA, config 1, USB Mouse(0xc001),
Logitech(0x046d), rev 29.00
port 2 powered
Controller /dev/usb5:
addr 1: full speed, self powered, config 1, UHCI root hub(0x0000),
Intel(0x8086), rev 1.00
port 1 powered
port 2 powered
Controller /dev/usb6:
addr 1: full speed, self powered, config 1, UHCI root hub(0x0000),
Intel(0x8086), rev 1.00
port 1 powered
port 2 powered