# usb drive madness

## pranyi

I have serious problem using my external usb harddrives.

I wanted to copy 15 gigs from one external drive to the other. 

After copying about 5 gigs, the kernel simply disconnected the

drives and reassigned the devices,  sdb became sdc and the

sda became sdd.  :Sad: 

OK, I wanted to go on so I umounted the directories 

and mounted the from the new devices. 

After some gigabytes further copying the kernel diconnected

the devices again: sdc became sda and sdd became sdb.  :Sad: 

I umounted the dirs and tried to mount them again. Now

the mounting took 20 minutes (!!!) to complete. 

What would you suggest in such a situation.

My kernel is : vmlinuz-2.6.12-gentoo-r6

The output of lspci:

```

0000:00:00.0 Host bridge: ATI Technologies Inc Radeon 9100 IGP Host Bridge (rev 02)

0000:00:01.0 PCI bridge: ATI Technologies Inc Radeon 9100 IGP AGP Bridge

0000:00:13.0 USB Controller: ATI Technologies Inc OHCI USB Controller #1 (rev 01)

0000:00:13.1 USB Controller: ATI Technologies Inc OHCI USB Controller #2 (rev 01)

0000:00:13.2 USB Controller: ATI Technologies Inc EHCI USB Controller (rev 01)

0000:00:14.0 SMBus: ATI Technologies Inc ATI SMBus (rev 1a)

0000:00:14.1 IDE interface: ATI Technologies Inc ATI Dual Channel Bus Master PCI IDE Controller

0000:00:14.3 ISA bridge: ATI Technologies Inc: Unknown device 434c

0000:00:14.4 PCI bridge: ATI Technologies Inc: Unknown device 4342

0000:00:14.5 Multimedia audio controller: ATI Technologies Inc IXP150 AC'97 Audio Controller (rev 01)

0000:01:05.0 VGA compatible controller: ATI Technologies Inc Radeon 9100 IGP

0000:02:08.0 Ethernet controller: 3Com Corporation 3Com 3C920B-EMB-WNM Integrated Fast Ethernet Controller (rev 40)

0000:02:0a.0 FireWire (IEEE 1394): VIA Technologies, Inc. IEEE 1394 Host Controller (rev 80)

0000:02:0c.0 CardBus bridge: ENE Technology Inc CB-710/2/4 Cardbus Controller (rev 02)

0000:02:0c.1 FLASH memory: ENE Technology Inc CB710 Memory Card Reader Controller

```

I saw the following messages in dmesg:

```

usb 1-1: new high speed USB device using ehci_hcd and address 6

midi: probe of 1-1:1.0 failed with error -5

scsi4 : SCSI emulation for USB Mass Storage devices

hub 1-0:1.0: port 2 disabled by hub (EMI?), re-enabling...

usb 1-2: USB disconnect, address 5

usb-storage: device found at 6

usb-storage: waiting for device to settle before scanning

usb 1-2: new high speed USB device using ehci_hcd and address 7

midi: probe of 1-2:2.0 failed with error -5

scsi5 : SCSI emulation for USB Mass Storage devices

usb-storage: device found at 7

usb-storage: waiting for device to settle before scanning

  Vendor: Maxtor 6  Model: L200P0            Rev: BAH4

  Type:   Direct-Access                      ANSI SCSI revision: 00

SCSI device sda: 398297088 512-byte hdwr sectors (203928 MB)

sda: assuming drive cache: write through

SCSI device sda: 398297088 512-byte hdwr sectors (203928 MB)

sda: assuming drive cache: write through

 sda: sda1 sda2 sda3 sda4 < sda5 sda6 sda7 sda8 sda9 sda10 >

Attached scsi disk sda at scsi4, channel 0, id 0, lun 0

Attached scsi generic sg0 at scsi4, channel 0, id 0, lun 0,  type 0

usb-storage: device scan complete

  Vendor: FUJITSU   Model: MHT2040AT         Rev: 0022

  Type:   Direct-Access                      ANSI SCSI revision: 00

SCSI device sde: 78140160 512-byte hdwr sectors (40008 MB)

sde: assuming drive cache: write through

SCSI device sde: 78140160 512-byte hdwr sectors (40008 MB)

sde: assuming drive cache: write through

 sde: sde1

Attached scsi disk sde at scsi5, channel 0, id 0, lun 0

Attached scsi generic sg1 at scsi5, channel 0, id 0, lun 0,  type 0

usb-storage: device scan complete

scsi2 (0:0): rejecting I/O to dead device

EXT3-fs error (device sdc6): ext3_readdir: directory #2 contains a hole at offset 0

scsi2 (0:0): rejecting I/O to dead device

EXT3-fs error (device sdc6): ext3_readdir: directory #2 contains a hole at offset 0

__journal_remove_journal_head: freeing b_frozen_data

__journal_remove_journal_head: freeing b_frozen_data

__journal_remove_journal_head: freeing b_committed_data

__journal_remove_journal_head: freeing b_committed_data

scsi2 (0:0): rejecting I/O to dead device

printk: 10292 messages suppressed.

Buffer I/O error on device sdc6, logical block 523

lost page write due to I/O error on sdc6

scsi3 (0:0): rejecting I/O to dead device

```

[/code]

----------

## kirchner

I think you might find help here:

http://gentoo-wiki.com/HOWTO_USB_Mass_Storage_Device#Adding_symlink_via_udev

I'm not certain that those are the directions I followed, but they look roughly correct.  I use this and autofs to mount my usbkey and ipod shuffle at /mnt/auto/usbkey and /mnt/auto/ipod respectively.

----------

## servo888

 *kirchner wrote:*   

> I think you might find help here:
> 
> http://gentoo-wiki.com/HOWTO_USB_Mass_Storage_Device#Adding_symlink_via_udev
> 
> I'm not certain that those are the directions I followed, but they look roughly correct.  I use this and autofs to mount my usbkey and ipod shuffle at /mnt/auto/usbkey and /mnt/auto/ipod respectively.

 

There is a more important problem you over looked - the issue is that the kernel drops the USB drive. It doesn't matter what device node it finds - the problem is you can't copy large files. I have the same exacty issue and would really like to find a solution asap. How the hell are you suppose to backup to a 'back up drive' when it dies after a few GB's.

----------

## servo888

 *pranyi wrote:*   

> I have serious problem using my external usb harddrives.
> 
> I wanted to copy 15 gigs from one external drive to the other. 
> 
> After copying about 5 gigs, the kernel simply disconnected the
> ...

 

Are you by chance using other USB devices which are 1.1? Say a mouse, or keyboard?

----------

## pranyi

No, my mouse and keyboard are connected by ps.

I had another drive attached by usb  (2.0) , but after I had problems I disconnected it and I still had the same problems.

----------

## Gentree

 *Quote:*   

> I umounted the dirs and tried to mount them again. Now 
> 
> the mounting took 20 minutes (!!!) to complete.

 

well that would not seem too surprising if you have many gigs of data on a drive that got dumped. It will have to fsck the whole thing over usb1.1 , that will be a long job.  If it failed in that way and you are trying to back-up it would make sence to rm -fr or reformat anyway.

Why aren't they on usb 2? 

It may help to post some info like fstab or df output to save us guessing your config. and what the usb ports are on. Onboard or pci card?  I have had probs with cheapo USB cards dropping out in a way that would give that sort of problem if connected to a hard-drive.

setting udev to give them consistant device names would obviously make life easier.

have a look at your kernel support for USB as well. 

```

grep -i "usb" /usr/src/linux/.config

# USB support

CONFIG_USB_ARCH_HAS_HCD=y

CONFIG_USB_ARCH_HAS_OHCI=y

CONFIG_USB=y

CONFIG_USB_DEBUG=y

# Miscellaneous USB options

CONFIG_USB_DEVICEFS=y

# CONFIG_USB_BANDWIDTH is not set

# CONFIG_USB_DYNAMIC_MINORS is not set

# CONFIG_USB_SUSPEND is not set

# CONFIG_USB_OTG is not set

# USB Host Controller Drivers

CONFIG_USB_EHCI_HCD=m

CONFIG_USB_EHCI_SPLIT_ISO=y

CONFIG_USB_EHCI_ROOT_HUB_TT=y

# CONFIG_USB_ISP116X_HCD is not set

CONFIG_USB_OHCI_HCD=m

# CONFIG_USB_OHCI_BIG_ENDIAN is not set

CONFIG_USB_OHCI_LITTLE_ENDIAN=y

CONFIG_USB_UHCI_HCD=m

```

HTH   :Cool: 

----------

## Voorhees51

Are you trying to copy all 15 Gig at once?

 I'd try copying it in smaller chunks, and see if that works

----------

## Gentree

He seems to have a reliability issue here that needs a solution not a work-around . I once copied 80G from one IDE drive to another without a hitch, that's the way it should work.

 :Confused: 

----------

## pranyi

 *Gentree wrote:*   

> 
> 
> Why aren't they on usb 2? 
> 
> 

 

They ARE on usb 2, I hope.

 *Quote:*   

> 
> 
> It may help to post some info like fstab or df output to save us guessing your config. and what the usb ports are on. Onboard or pci card? 
> 
> 

 

Onboard.

 *Quote:*   

> 
> 
> setting udev to give them consistant device names would obviously make life easier.
> 
> 

 

How does it work?

have a look at your kernel support for USB as well. 

```

# CONFIG_USB_IRDA is not set

# USB devices

# CONFIG_SND_USB_AUDIO is not set

# CONFIG_SND_USB_USX2Y is not set

# USB support

CONFIG_USB_ARCH_HAS_HCD=y

CONFIG_USB_ARCH_HAS_OHCI=y

CONFIG_USB=y

# CONFIG_USB_DEBUG is not set

# Miscellaneous USB options

CONFIG_USB_DEVICEFS=y

CONFIG_USB_BANDWIDTH=y

# CONFIG_USB_DYNAMIC_MINORS is not set

# CONFIG_USB_SUSPEND is not set

# CONFIG_USB_OTG is not set

# USB Host Controller Drivers

CONFIG_USB_EHCI_HCD=y

# CONFIG_USB_EHCI_SPLIT_ISO is not set

# CONFIG_USB_EHCI_ROOT_HUB_TT is not set

CONFIG_USB_OHCI_HCD=y

# CONFIG_USB_OHCI_BIG_ENDIAN is not set

CONFIG_USB_OHCI_LITTLE_ENDIAN=y

# CONFIG_USB_UHCI_HCD is not set

# CONFIG_USB_SL811_HCD is not set

# USB Device Class drivers

CONFIG_USB_AUDIO=m

CONFIG_USB_BLUETOOTH_TTY=y

CONFIG_USB_MIDI=y

# CONFIG_USB_ACM is not set

CONFIG_USB_PRINTER=y

# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help

 for more information

CONFIG_USB_STORAGE=y

# CONFIG_USB_STORAGE_DEBUG is not set

```

----------

## Gentree

There are two debug options in there it would probably be a good idea to turn them on since you have something to debug   :Wink: 

I suggest usbview to see what is connected and under what protocol.

It's also helpful to make all these modules so that you can use lsmod to see what is getting loaded or not.

HTH   :Cool: 

----------

