OpenWrt Forum Archive

Topic: usb stick & hotplug

The content of this topic has been archived on 31 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I managed to mount my usb stick manually on my Kamikaze 7.09 box, but I'd like it to be mounted automatically when plugging it in and rebooting the router.

I made the file /etc/hotplug.d/usb/10-usb-storage executable

Is there anything else that I'm missing?

hm, any ideas?

well what about hotplugging though? I don't need it for swap, I just don't want to mount it manually all the time

I thought this was part of 7.09. I recently built a trunk version and plugged in a usb stick and it mounted it /mnt/usb......

what does dmesg or logread say when you put the stick in ?

Here is the output of logread when I plug it in:

Oct  9 19:25:16 OpenWrt authpriv.info dropbear[568]: Child connection from 10.1.1.190:2153
Oct  9 19:25:21 OpenWrt authpriv.notice dropbear[568]: password auth succeeded for 'root' from 10.1.1.190:2153
Oct  9 19:25:32 OpenWrt cron.warn crond[509]: time disparity of 4088245 minutes detected
Oct  9 19:25:48 OpenWrt user.info kernel: hub.c: new USB device 01:03.2-2, assigned address 2
Oct  9 19:25:48 OpenWrt user.info kernel: scsi0 : SCSI emulation for USB Mass Storage devices
Oct  9 19:25:48 OpenWrt user.warn kernel:   Vendor:           Model: USB Flash Memory  Rev: 5.00
Oct  9 19:25:48 OpenWrt user.warn kernel:   Type:   Direct-Access                      ANSI SCSI revision: 02
Oct  9 19:25:48 OpenWrt user.warn kernel: Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0
Oct  9 19:25:50 OpenWrt user.warn kernel: SCSI device sda: 4028416 512-byte hdwr sectors (2063 MB)
Oct  9 19:25:50 OpenWrt user.warn kernel: sda: Write Protect is off
Oct  9 19:25:50 OpenWrt user.info kernel: Partition check:
Oct  9 19:25:50 OpenWrt user.info kernel:  p1
Oct  9 19:25:50 OpenWrt user.debug kernel: WARNING: USB Mass Storage data integrity not assured
Oct  9 19:25:50 OpenWrt user.debug kernel: USB Mass Storage device found at 2
Oct  9 19:25:50 OpenWrt user.notice root: usb device is mass storage
Oct  9 19:25:50 OpenWrt user.notice root: waiting on usb drive 0 ...
Oct  9 19:25:51 OpenWrt user.notice root: waiting on usb drive 1 ...
Oct  9 19:25:52 OpenWrt user.notice root: waiting on usb drive 2 ...
Oct  9 19:25:53 OpenWrt user.notice root: waiting on usb drive 3 ...
Oct  9 19:25:54 OpenWrt user.notice root: waiting on usb drive 4 ...
Oct  9 19:25:55 OpenWrt user.notice root: waiting on usb drive 5 ...
Oct  9 19:25:56 OpenWrt user.notice root: waiting on usb drive 6 ...
Oct  9 19:25:57 OpenWrt user.notice root: waiting on usb drive 7 ...
Oct  9 19:25:58 OpenWrt user.notice root: waiting on usb drive 8 ...
Oct  9 19:25:59 OpenWrt user.notice root: waiting on usb drive 9 ...
Oct  9 19:26:00 OpenWrt user.notice root: waiting on usb drive 10 ...

and here is what dmesg says:

...
usb.c: registered new driver usbdevfs
usb.c: registered new driver hub
eth0.1: add 01:00:5e:00:00:01 mcast address to master interface
PCI: Setting latency timer of device 01:02.0 to 64
PCI: Enabling device 01:02.0 (0004 -> 0006)
wl0: Broadcom BCM4318 802.11 Wireless Controller 4.80.53.0
CSLIP: code copyright 1989 Regents of the University of California
PPP generic driver version 2.4.2
PCI: Setting latency timer of device 00:03.0 to 64
usb-ohci.c: USB OHCI at membase 0xb8003000, IRQ 6
usb-ohci.c: usb-00:03.0, PCI device 14e4:4715
usb.c: new USB bus registered, assigned bus number 1
hub.c: USB hub found
hub.c: 2 ports detected
uhci.c: USB Universal Host Controller Interface driver v1.1
PCI: Enabling device 01:03.0 (0000 -> 0001)
uhci.c: USB UHCI at I/O 0x100, IRQ 2
usb.c: new USB bus registered, assigned bus number 2
hub.c: USB hub found
hub.c: 2 ports detected
PCI: Enabling device 01:03.1 (0000 -> 0001)
uhci.c: USB UHCI at I/O 0x120, IRQ 2
usb.c: new USB bus registered, assigned bus number 3
hub.c: USB hub found
hub.c: 2 ports detected
usb-uhci.c: $Revision: 1.275 $ time 08:58:50 Sep 29 2007
usb-uhci.c: High bandwidth mode enabled
usb-uhci.c: v1.275:USB Universal Host Controller Interface driver
PCI: Enabling device 01:03.2 (0000 -> 0002)
ehci_hcd 01:03.2: PCI device 1106:3104
ehci_hcd 01:03.2: irq 2, pci mem c01d1000
usb.c: new USB bus registered, assigned bus number 4
EHCI: Enabling VIA 6212 workarounds
ehci_hcd 01:03.2: USB 2.0 enabled, EHCI 1.00, driver 2003-Dec-29/2.4
hub.c: USB hub found
hub.c: 4 ports detected
SCSI subsystem driver Revision: 1.00
Initializing USB Mass Storage driver...
usb.c: registered new driver usb-storage
USB Mass Storage support registered.
device wl0 entered promiscuous mode
wl0: attempt to add interface with same source address.
br-lan: port 2(wl0) entering learning state
br-lan: port 2(wl0) entering forwarding state
br-lan: topology change detected, propagating
hub.c: new USB device 01:03.2-2, assigned address 2
scsi0 : SCSI emulation for USB Mass Storage devices
  Vendor:           Model: USB Flash Memory  Rev: 5.00
  Type:   Direct-Access                      ANSI SCSI revision: 02
Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0
SCSI device sda: 4028416 512-byte hdwr sectors (2063 MB)
sda: Write Protect is off
Partition check:
/dev/scsi/host0/bus0/target0/lun0: p1
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 2

There's no /dev/sdaXXX though. Mounting the stick using /dev/scsi/host0/bus0/target0/lun0/part1 works however (except that I have to mount it manually all the time)

thomasw wrote:

Here is the output of logread when I plug it in:

/dev/scsi/host0/bus0/target0/lun0: p1
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 2

There's no /dev/sdaXXX though. Mounting the stick using /dev/scsi/host0/bus0/target0/lun0/part1 works however (except that I have to mount it manually all the time)

/dev/scsi/host0/bus0/target0/lun0: p1 - that is where its at, your not using 2.6

The discussion might have continued from here.