# USB hard drive not recognized



## dpx (Nov 22, 2017)

I have external USB hard drive, formatted as zfs for backups:
Geom name: da0
Providers:
1. Name: da0
   Mediasize: 320072931328 (298G)
   Sectorsize: 512
   Mode: r1w1e2
   descr: Apacer Technology Inc.
   ident: 09091808F6
   rotationrate: unknown
   fwsectors: 63
   fwheads: 255

Since that drive is starting to fail, I want to attach other 500G disk and retire current one.

I have very reliable 500G USB hard disk that I am currently using for MacBook Pro (macOS) backups -- so I know it is working well.

When I plug in the drive into FreeBSD machine, on boot or after re-plugging it while machine runs, I get following in dmesg:


```
usb_alloc_device: set address 2 failed (USB_ERR_IOERROR, ignored)
usbd_setup_device_desc: getting device descriptor at addr 2 failed, USB_ERR_IOERROR
usbd_req_re_enumerate: addr=2, set address failed! (USB_ERR_IOERROR, ignored)
usbd_setup_device_desc: getting device descriptor at addr 2 failed, USB_ERR_IOERROR
usbd_req_re_enumerate: addr=2, set address failed! (USB_ERR_IOERROR, ignored)
usbd_setup_device_desc: getting device descriptor at addr 2 failed, USB_ERR_IOERROR
usbd_req_re_enumerate: addr=2, set address failed! (USB_ERR_IOERROR, ignored)
usbd_setup_device_desc: getting device descriptor at addr 2 failed, USB_ERR_IOERROR
usbd_req_re_enumerate: addr=2, set address failed! (USB_ERR_IOERROR, ignored)
usbd_setup_device_desc: getting device descriptor at addr 2 failed, USB_ERR_IOERROR
ugen6.2: <Unknown > at usbus6 (disconnected)
uhub_reattach_port: could not allocate new device
```

Is there something I can test/do in order to get FreeBSD recognizing the disk?


----------



## ShelLuser (Nov 22, 2017)

First: why use ZFS for a single removable drive? I would definitely recommend against this and instead suggest to rely on UFS. ZFS is at its best if you can use it with multiple drives, a single drive is somewhat defying the purpose. Another very nasty problem can occur if you happen to run into 2 pools which share the same name. It's something you can work around on, but even so it's a lot of unneeded extra hassle.

I don't have a direct answer for the drive problem but I do wonder about a few things.. Is it using the same USB standards? For example, is it possible that this is an issue of USB 2.0 vs. 3.0?

Another idea, but please keep in mind that this is a (very) rough guess in my part: have you tried emptying the HD? So removing all partitions or the entire partition table? It seems odd to me if this would make a difference, but considering how the errors all complain about reading errors I still can't help wonder if this could be caused by using unknown file systems (unknown to the server).


----------



## dpx (Nov 22, 2017)

One of the reasons I switched from Linux to FreeBSD is ZFS. You can't detect bit rot using ext4, at least not without lots of gymnastics. I don't know much about UFS but I don't expect it to have scrub.

Also drive gymnastics, adding drive to a pool and replacing drive easily (exactly what I need now) is beautiful with ZFS.

Error I am getting is on driver level, way before any file system kicking in. I think.

Edit: in fact I have been using failing drive on Linux for ages, and I couldn't tell it starts to fail. It was probably failing for some time (bad sectors) but only scrub revealed that.


----------



## p3rj (Nov 22, 2017)

Is that drive powered by USB? Then perhaps your port does doesn't deliver enough power for the drive (assuming it's not the same hardware you know it's working with).


----------



## dpx (Nov 22, 2017)

p3rj said:


> Is that drive powered by USB? Then perhaps your port does doesn't deliver enough power for the drive (assuming it's not the same hardware you know it's working with).



Exactly that  Solved!

I was assuming it is wrong port type (USB 1 or USB 2) but power was the right answer. Since Mac lacks ports I was using small inexpensive self-powered USB hub made by hama. Plugging in entire contraption into desktop computer makes drive visible.

Thanks!


----------



## SirDice (Nov 22, 2017)

dpx said:


> One of the reasons I switched from Linux to FreeBSD is ZFS. You can't detect bit rot using ext4, at least not without lots of gymnastics. I don't know much about UFS but I don't expect it to have scrub.


You can't fix bit-rot with a single disk ZFS pool either (there's no redundancy). You can detect it but not fix it. Not unless you set copies to 2 or higher.


----------



## dpx (Nov 22, 2017)

Yeah I know but at least I have insight into what's going on with the disk. With say Linux/ext4 you are completely blind only relying on s.m.a.r.t which is not completely reliable. I am using this USB disks for backup along with few other backup systems so it is not completely dead end if something fails. I just love to use occasional scrub so I don't feed into failing backup media thinking it is working.


----------



## SirDice (Nov 22, 2017)

dpx said:


> Yeah I know but at least I have insight into what's going on with the disk.


Ok, cool. As long as you're aware of it. 



> With say Linux/ext4 you are completely blind only relying on s.m.a.r.t which is not completely reliable.


Oh, I fully agree. Having worked for a SaaS company that had a lot of virtual Linux machines, you won't believe the amount of corrupted filesystems we had with ext4.


----------



## poorandunlucky (Nov 23, 2017)

ShelLuser said:


> ZFS is at its best if you can use it with multiple drives, a single drive is somewhat defying the purpose.



It's awesome even if you have it on a thumbdrive... it's good practice working with the commands... it's fun... it's even something to talk about!  : P

I think you should ask your boss to send you to an IT conference or trade show or something like that, I think you deserve it.  *pats your shoulder*  : ]


----------

