# External USB hard disk disappears



## zbang (Dec 28, 2010)

I have an external FreeAgent Pro USB drive that mounts, operates for a while, starts to throw errors, and disappears. 

It's recognized when connected and mounts ("*mount -t ntfs -o ro /dev/da0s1 /d4*")


```
Dec 28 09:12:21 roxton root: Unknown USB device: vendor 0x0bc2 product 0x3110 bu
s uhub3
Dec 28 09:12:21 roxton kernel: ugen3.2: <Seagate> at usbus3
Dec 28 09:12:21 roxton kernel: umass0: <Mass Storage Iface> on usbus3
Dec 28 09:12:21 roxton kernel: umass0:  SCSI over Bulk-Only; quirks = 0x0000
Dec 28 09:12:21 roxton kernel: umass0: Get Max Lun not supported (USB_ERR_STALLED)
Dec 28 09:12:22 roxton kernel: umass0:0:0:-1: Attached to scbus0
Dec 28 09:12:22 roxton kernel: da0 at umass-sim0 bus 0 scbus0 target 0 lun 0
Dec 28 09:12:22 roxton kernel: da0: <Seagate FreeAgent Pro 4109> Fixed Direct Access SCSI-4 device
Dec 28 09:12:22 roxton kernel: da0: 40.000MB/s transfers
Dec 28 09:12:22 roxton kernel: da0: 476940MB (976773168 512 byte sectors: 255H 63S/T 60801C)
```

I can access data, however after a while with heavy load, it starts to log things like:

```
Dec 28 12:00:50 roxton kernel: (da0:umass-sim0:0:0:0): AutoSense failed
Dec 28 12:00:50 roxton kernel: g_vfs_done():da0s1[READ(offset=311608762368, length=4096)]error = 5
Dec 28 12:00:50 roxton kernel: ntfs_readattr_plain: ntfs_readntvattr_plain failed: o: -1500438528, s: 4096
Dec 28 12:00:50 roxton kernel: ntfs_readattr_plain: attrib: 0 - 1231727
Dec 28 12:00:50 roxton kernel: ntfs_strategy: ntfs_readattr failed
```

Eventually it vanishes

```
Dec 28 12:11:41 roxton kernel: (da0:umass-sim0:0:0:0): lost device
Dec 28 12:11:46 roxton kernel: (da0:umass-sim0:0:0:0): SYNCHRONIZE CACHE(10). CDB: 35 0 0 0 0 0 0 0 0 0
Dec 28 12:11:46 roxton kernel: (da0:umass-sim0:0:0:0): SCSI sense: Error code 0x0
Dec 28 12:11:46 roxton kernel: (da0:umass-sim0:0:0:0): removing device entry
```

[cmd=]camcontrol rescan all[/cmd] will not find it, however usbconfig shows that it's connected:

```
ugen3.2: <FreeAgent Pro Seagate> at usbus3, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON
```

I'm not sure if there is any way to kick/reset the drive at the USB level to try again. 

The drive is connected to the front panel USB on a Dell gx260, running 8.1-RELEASE upgraded from 7.2-release. hald is running.

The drive seems to work well off my windows-xp laptop (I defrag'ed it yesterday, all 350gb of it.)  Based on some other threads, I will try it on a USB port directly on the MB when I get home. (If there isn't a quick/easy solution, I'll connect with firewire instead.)

thanks,

z!


----------



## zbang (Dec 30, 2010)

Some further experimentation:

The drive seems to work properly via both USB and firewire from a windows-xp system. It also seems OK, albeit slow, connected to the back panel USB ports. Slow meaning less than half the speed (as reported by iostat) of the front panel ports on a simple file copy to /dev/null. (I haven't cracked the case to check connections, yet.)

Also interesting is that when the drive is connected to a firewire port, I get:

```
Dec 30 10:00:41 roxton kernel: firewire0: fw_explore_node: node1: explore_read_quads failure
Dec 30 10:00:41 roxton kernel: fwohci0: txd err=14 ack busy_X
Dec 30 10:00:41 roxton kernel: firewire0: fw_explore_node: node1: explore_read_quads failure
Dec 30 10:00:55 roxton kernel: fwohci0: fwohci_intr_core: BUS reset
Dec 30 10:00:55 roxton kernel: fwohci0: fwohci_intr_core: node_id=0x00000001, SelfID Count=3, CYCLEMASTER mode
Dec 30 10:00:55 roxton kernel: firewire0: 2 nodes, maxhop <= 1 cable IRM irm(1)  (me)
Dec 30 10:00:55 roxton kernel: firewire0: bus manager 1
Dec 30 10:00:55 roxton kernel: fwohci0: txd err= 3 miss Ack err
Dec 30 10:00:55 roxton kernel: firewire0: fw_explore_node: fwdev->speed(S800) decremented due to negotiation
Dec 30 10:00:55 roxton kernel: firewire0: New S400 device ID:0020370100a08825
```
so it looks like it's connected, however no /dev/da0* entries are created. 
`# camcontrol devlist` does not show any devices and `# camcontrol rescan all` fails with

```
camcontrol: CAMIOCOMMAND ioctl failed: Invalid argument
```

FWIW, I did not have this sort of problem with 7.2. And, not being familiar with the cam subsystem, I'm not sure where to look or what to look for.

z!
(hoping the formatting is better this time)


----------



## roscoe (Dec 31, 2010)

To get my firewire drive recognized by FreeBSD (i.e. create a /dev/daxx entry) I needed to add the following to /boot/loader.conf


```
sbp_load="YES"
```

--roscoe


----------



## zbang (Dec 31, 2010)

Yep, that got FW working (I'd thought that since it was part of the GENERIC kernel, thus didn't need to be explicitly loaded). Still curious about the USB, though.


----------



## danbi (Jan 4, 2011)

Is it possible for the drive to not receive enough power? I had similar experience with AMD (nforce chipset) systems where the USB ports did not supply enough power for the drive to operate properly.


----------



## wblock@ (Jan 4, 2011)

danbi said:
			
		

> Is it possible for the drive to not receive enough power? I had similar experience with AMD (nforce chipset) systems where the USB ports did not supply enough power for the drive to operate properly.



A powered hub can help with that, or using power-only USB cables that run to a jack on the drive.


----------



## zbang (Jan 4, 2011)

danbi said:
			
		

> Is it possible for the drive to not receive enough power?



Good thought, but the drive in question is externally powered,  not over the USB. (I generally distrust USB for powering anything larger than a mouse or mobile phone.)


----------



## wwwdrich (Jan 11, 2011)

I am seeing the same thing on my 8.1 system running a 2TB Seagate GoFlex Desk drive on USB.  The drive is externally powered and I have tried it both on a hub and directly connected to the system, with the same results.  The only thing I can figure is that the drive is going to sleep for some reason and FreeBSD isn't doing the "right thing" to wake it back up.

Here is what I see in dmesg:

```
ugen1.7: <Seagate> at usbus1
umass2: <Seagate FA GoFlex Desk, class 0/0, rev 2.00/1.55, addr 7> on usbus1
umass2:  SCSI over Bulk-Only; quirks = 0x0000
umass2:4:2:-1: Attached to scbus4
da2 at umass-sim2 bus 2 scbus4 target 0 lun 0
da2: <Seagate FA GoFlex Desk 0155> Fixed Direct Access SCSI-4 device 
da2: 40.000MB/s transfers
da2: 1907729MB (3907029167 512 byte sectors: 255H 63S/T 243201C)
```
and some time later...

```
ugen1.7: <Seagate> at usbus1 (disconnected)
umass2: at uhub3, port 4, addr 7 (disconnected)
(da2:umass-sim2:2:0:0): lost device
(da2:umass-sim2:2:0:0): Synchronize cache failed, status == 0xa, scsi status == 0x0
(da2:umass-sim2:2:0:0): removing device entry
```

When this happens I can fsck and remount the drive w/o unplugging it and plugging it back in, but anything that was writing to it fails.

Oddly enough, I am not seeing the same problem with two other Seagate FreeAgent drives that are also attached via. USB, but they are a different model of drive.


----------



## valuequest (Feb 26, 2011)

zbang said:
			
		

> hald is running.



Okay I am having trouble getting my 8.1-release system to operate any external USB devices also.  So far I can tell from camcontrol and usbconfig commands the system recognizes that the USB hardware is present but when I attempt to access the USB media the system reports back umass AutoSense failed errors.

Does hald _have_ to be running in order for USB devices to work?  If so why?


----------



## wblock@ (Feb 26, 2011)

valuequest said:
			
		

> Okay I am having trouble getting my 8.1-release system to operate any external USB devices also.  So far I can tell from camcontrol and usbconfig commands the system recognizes that the USB hardware is present but when I attempt to access the USB media the system reports back umass AutoSense failed errors.
> 
> Does hald _have_ to be running in order for USB devices to work?  If so why?



hal can be used by higher-level software to detect device changes.  USB devices will work fine without it, although you might have to mount them by hand.

As far as the autosense errors, no idea, but probably best asked on the freebsd-usb mailing list.


----------



## wwwdrich (Feb 26, 2011)

The short answer to my problem is that Seagate is a bunch of #!%&!*#%!#$(! 

The new Seagate drives will auto spin-down after 20 minutes of inactivity. For Windows there is a utility for this, but for everything else you're on your own. In my case I now have a cron that touches a file on the drive every 15 minutes. I hate it, but it fixed the problem for me.


----------



## roscoe (Feb 27, 2011)

I too am using cron to touch a file every 10 minutes on my external Vantec enclosures.
Been using that for over a year now, works well for my purposes.


----------

