New IT forum Follow us on Twitter
22 May 2012, 10:47:07 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: TonidoPlug2 - Now in stock!
 
   Home   SHOP Help Search Login Register  
Pages: [1]
  Print  
Author Topic: ubuntu / can't get USB HD to connect  (Read 1747 times)
Robert
Newbie
*
Posts: 21


« on: 09 April 2010, 08:49:02 am »

Hi, I had to move my plug which I use as a NAS system together with a Drobo via USB to a different place. The problem now is, that the USB device is no longer found.

DMESG output:
usb 1-1: new full speed USB device using orion-ehci and address 6
usb 1-1: device descriptor read/64, error -71
usb 1-1: device descriptor read/64, error -71
usb 1-1: new full speed USB device using orion-ehci and address 7
usb 1-1: device descriptor read/64, error -71
usb 1-1: device descriptor read/64, error -71
usb 1-1: new full speed USB device using orion-ehci and address 8
usb 1-1: device not accepting address 8, error -71
usb 1-1: new full speed USB device using orion-ehci and address 9
usb 1-1: device not accepting address 9, error -71
hub 1-0:1.0: unable to enumerate USB device on port 1
usb 1-1: new full speed USB device using orion-ehci and address 10
usb 1-1: device descriptor read/64, error -71
usb 1-1: device descriptor read/64, error -71
usb 1-1: new full speed USB device using orion-ehci and address 11
usb 1-1: device descriptor read/64, error -71
usb 1-1: device descriptor read/64, error -71
usb 1-1: new full speed USB device using orion-ehci and address 12
usb 1-1: device not accepting address 12, error -71
usb 1-1: new full speed USB device using orion-ehci and address 13
usb 1-1: device not accepting address 13, error -71
hub 1-0:1.0: unable to enumerate USB device on port 1

The Drobo shutsdown after a minute or so, as it looks like it thinks no USB connection is there.

I have written a simple .sh script to mount the different partitions after boot. So, no special UDEV stuff etc. setup yet.

1. Why is the USB device not seen at all? I have read that in Ubuntu during boot the USB controllers are shutdown... could this be a problem?

2. What do I need to do, to get the plug & HD see each other via USB?

3. What's the correct setup to automount the HD when the plug is rebooted?
Logged
NewIT_Marcus
Administrator
Hero Member
*****
Posts: 960


« Reply #1 on: 09 April 2010, 01:49:42 pm »

Please test other USB devices. These messages are indicative of problems with the USB port.
Logged
Robert
Newbie
*
Posts: 21


« Reply #2 on: 10 April 2010, 03:16:15 pm »

Did check with an old USB stick:

usb 1-1: new high speed USB device using orion-ehci and address 6
scsi2 : usb-storage 1-1:1.0
scsi 2:0:0:0: Direct-Access     FSC      MEMORYBIRD USB2  0    PQ: 0 ANSI: 2
sd 2:0:0:0: Attached scsi generic sg0 type 0
sd 2:0:0:0: [sda] 503808 512-byte logical blocks: (257 MB/246 MiB)
sd 2:0:0:0: [sda] Write Protect is off
sd 2:0:0:0: [sda] Mode Sense: 6b 00 00 00
sd 2:0:0:0: [sda] Assuming drive cache: write through
sd 2:0:0:0: [sda] Assuming drive cache: write through
 sda: sda1
sd 2:0:0:0: [sda] Assuming drive cache: write through
sd 2:0:0:0: [sda] Attached SCSI removable disk


So, this works... But I know that my Drobo works too.
Logged
Robert
Newbie
*
Posts: 21


« Reply #3 on: 10 April 2010, 03:24:32 pm »

Interesting, I change the USB cabel from a long one to a short one and now it works.

It's one of these cables that have a standard usb connector on one side and a squared one on the other side.

I'm wondering why the system recognizes the USB connection with the long cable but than fails. If it's a hardware problem the plug shouldn't have seen any USB action.
Logged
NewIT_Marcus
Administrator
Hero Member
*****
Posts: 960


« Reply #4 on: 11 April 2010, 11:11:24 am »

Robert -

I don't know enough about the technical specifications and requirements of USB devices to give you a specific answer. In such a situation, swapping out the individual elements of a chain can help one find a solution, as has happened in this case. We have heard of some rare problems caused by (presumably faulty) cables. The next tests you could do would be with the cable at issue, connecting from other PCs to other devices.
Logged
alfon
Newbie
*
Posts: 28


« Reply #5 on: 11 April 2010, 10:24:48 pm »


3. What's the correct setup to automount the HD when the plug is rebooted?


If you know for sure that your external hard disk will always be powered before the plug and will always be connected to it, all you need is an fstab entry, i.e. a line in /etc/fstab - something like:

Code:
/dev/sda1                                      /media/verbatim/samba  ext2   auto   0 0

This would tell your plug to mount the partition /dev/sda1 of drive /dev/sda under the directory /media/verbatim/samba . This directory must exist beforehand.

I have instead opted to go with a combination of fstab entries + udev rules. This has the advantage that, if I power up  / connect the drive after the plug boots, it will be recognised and mounted as soon as it is connected.

My fstab entries (One for each partition in the USB HD) are as follows:

Code:
UUID=3a3a2235-543d-4e3a-985e-3ef4345db427       swap    swap    noauto  0 0
UUID=b2f32134-4122-3e4f-b0f4-ad9f63e68dac       /media/verbatim/samba   ext3   noauto   0 0

A couple of notes on the above:

- "noauto" tells fstab NOT to attempt to mount the partition at bootup - this will be done by udev. The fstab entries serve just as definitions for the filesystems. These definitions will be used by fstab.

- Instead of /dev/sda1, dev/sda2, I have opted to use the UUID of the partitions. This is safer in the sense that /dev/sda means the first partition of the first hard drive. The UUID notation is more specific and will work only with the specific partitions in the specific drive. You can get the UUIDs of the partitions by typing the following after physically connecting the drive:
Code:
userid@myplug:/etc/udev/rules.d$ ls -l /dev/disk/by-uuid

After that, I wrote a shell file, /etc/udev/rules.d/v-h-d.sh with the following contents:
Code:
#!/bin/sh
# To be called by udev rule for Verbatim external USB disk drive

if  [ $1 = "1" ] ; then
   swapon /dev/usbhd$1
elif [ $1 = "4" ] ; then
   mount /dev/usbhd$1
fi

This file (permissions=-rwxrwx---, owner=root, group=root) will be called by udev when the drive is connected.

After that, I added the following udev rule (file /etc/udev/rules.d/90-verbatim-hard-drive.rules):
Code:
   KERNEL=="sd*" , ACTION=="add", SUBSYSTEMS=="usb", ATTRS{manufacturer}=="Verbatim", ATTRS{product}=="Desktop USB Drive", ATTRS{serial}=="1705000dd575", SYMLINK+="usbhd%n" RUN+="/etc/udev/rules.d/v-h-d.sh %n"

This file (permissions = -rw-r--r--, owner=root, group=root) essentially tells udev to add a symbolic link under /dev called usbhd1, usbhd2 etc and then call the above shell file, for each partition matching the criteria of my drive. The question of course is which criteria to use, and how to find the ones available in the first place. This is one of the things the udevadm utility does:
Code:
userid@myplug:/etc/udev/rules.d$ udevadm info .name=/dev/sda1 --attribute-walk

quoting from the output of udevadm:

Code:
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

I have tested the above setup and found it to work both when the USB HD is connected and running when the plug is started, and when it is connected after the plug is booted.

Hope this helps.
Alf
« Last Edit: 11 April 2010, 10:33:47 pm by alfon » Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!