Raspberry Pi4 USB HDD Issues

Hey erveryone,

I’m using Nextcloud via NextcloudPi on a Raspberry Pi 4. Database and Files are stored on a USB HDD (Seagate Expansion Portable 4TB). This setup runs smooth since some time.

Now I tried to do backups and this is where trouble starts. To save the backups, I bought a second HDD (same as primary) and will keep it at work, bringing it home and connecting it for manual backup to the pi all two weeks or something.
The Issue I’m facing is, that as soon as I try to mount the second HDD after plugging it in, both HDDs are disconnected from the Pi and are gone from lsusb output.

Additional Infos:

  1. The disk holding the database and datafiles is formated throug ncp-format-USB and labeld as “datastorage”
  2. The backup HDD is formated via gparted to ext4 and labeld as “Backup”
  3. The second HDD is never visible in lsblk on the Pi but working fine on my desktop sytem (Solus)

after plugging in the backup hdd, dmesg gives following output:
[ 120.069220] usb 2-1: new SuperSpeed Gen 1 USB device number 3 using xhci_hcd
[ 120.100720] usb 2-1: New USB device found, idVendor=0bc2, idProduct=231a, bcdDevice= 7.10
[ 120.100736] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 120.100750] usb 2-1: Product: Expansion
[ 120.100763] usb 2-1: Manufacturer: Seagate
[ 120.100775] usb 2-1: SerialNumber: NAAQB6EA
[ 120.136706] scsi host1: uas
[ 120.138084] scsi 1:0:0:0: Direct-Access Seagate Expansion 0710 PQ: 0 ANSI: 6
[ 120.142403] sd 1:0:0:0: Attached scsi generic sg1 type 0
[ 140.356142] [UFW BLOCK] IN=eth0 OUT= MAC=01:00:5e:00:00:01:cc:ce:1e:b3:c5:50:08:00 SRC=192.168.178.1 DST=224.0.0.1 LEN=36 TOS=0x00 PREC=0xC0 TTL=1 ID=31768 DF PROTO=2

after running ncp-automount a lot of errors do appear in dmesg output:
[ 161.789648] sd 0:0:0:0: [sda] tag#11 uas_eh_abort_handler 0 uas-tag 1 inflight: CMD OUT
[ 161.789668] sd 0:0:0:0: [sda] tag#11 CDB: opcode=0x8a 8a 00 00 00 00 00 0e 99 aa 38 00 00 00 28 00 00
[ 161.839664] scsi host0: uas_eh_device_reset_handler start
[ 161.990619] usb 2-2: reset SuperSpeed Gen 1 USB device number 2 using xhci_hcd
[ 162.037574] scsi host0: uas_eh_device_reset_handler success
[ 168.280700] sd 1:0:0:0: [sdb] Spinning up disk…
[ 189.370012] .
[ 208.510194] sd 0:0:0:0: [sda] tag#23 uas_eh_abort_handler 0 uas-tag 2 inflight: CMD IN
[ 208.510214] sd 0:0:0:0: [sda] tag#23 CDB: opcode=0x88 88 00 00 00 00 00 00 45 21 68 00 00 00 08 00 00
[ 208.510454] xhci_hcd 0000:01:00.0: WARNING: Host System Error
[ 213.530179] xhci_hcd 0000:01:00.0: xHCI host not responding to stop endpoint command.
[ 213.546230] xhci_hcd 0000:01:00.0: Host halt failed, -110
[ 213.546242] xhci_hcd 0000:01:00.0: xHCI host controller not responding, assume dead
[ 213.546339] xhci_hcd 0000:01:00.0: HC died; cleaning up
[ 213.546484] usb 1-1: USB disconnect, device number 2
[ 213.547429] usb 2-1: USB disconnect, device number 3
[ 213.547950] sd 1:0:0:0: tag#24 uas_zap_pending 0 uas-tag 1 inflight: CMD
[ 213.547967] sd 1:0:0:0: tag#24 CDB: opcode=0x0 00 00 00 00 00 00
[ 213.548088] ready
[ 213.590217] scsi host0: uas_eh_device_reset_handler FAILED to get lock err -19
[ 213.590231] sd 0:0:0:0: Device offlined - not ready after error recovery
[ 213.590253] sd 0:0:0:0: [sda] tag#23 UNKNOWN(0x2003) Result: hostbyte=0x00 driverbyte=0x06
[ 213.590264] sd 0:0:0:0: [sda] tag#23 CDB: opcode=0x88 88 00 00 00 00 00 00 45 21 68 00 00 00 08 00 00
[ 213.590273] print_req_error: I/O error, dev sda, sector 4530536
[ 213.590319] sd 0:0:0:0: rejecting I/O to offline device
[ 213.590328] print_req_error: I/O error, dev sda, sector 244951608
[ 213.590342] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 1, rd 0, flush 0, corrupt 0, gen 0
[ 213.591502] sd 0:0:0:0: rejecting I/O to offline device
[ 213.591514] print_req_error: I/O error, dev sda, sector 4530536
[ 213.591527] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 1, rd 1, flush 0, corrupt 0, gen 0
[ 213.821642] sd 0:0:0:0: rejecting I/O to offline device
[ 213.821656] print_req_error: I/O error, dev sda, sector 19235672
[ 213.821670] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 1, rd 2, flush 0, corrupt 0, gen 0
[ 213.822332] sd 0:0:0:0: rejecting I/O to offline device
[ 213.822344] print_req_error: I/O error, dev sda, sector 19235672
[ 213.822356] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 1, rd 3, flush 0, corrupt 0, gen 0
[ 213.831773] sd 0:0:0:0: rejecting I/O to offline device
[ 213.831786] print_req_error: I/O error, dev sda, sector 19235672
[ 213.831799] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 1, rd 4, flush 0, corrupt 0, gen 0
[ 213.840772] sd 0:0:0:0: rejecting I/O to offline device
[ 213.840784] print_req_error: I/O error, dev sda, sector 19235672
[ 213.840797] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 1, rd 5, flush 0, corrupt 0, gen 0
[ 213.847991] sd 0:0:0:0: rejecting I/O to offline device
[ 213.848004] print_req_error: I/O error, dev sda, sector 19235672
[ 213.848018] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 1, rd 6, flush 0, corrupt 0, gen 0
[ 213.850938] sd 0:0:0:0: rejecting I/O to offline device
[ 213.850951] print_req_error: I/O error, dev sda, sector 19235672
[ 213.850964] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 1, rd 7, flush 0, corrupt 0, gen 0
[ 214.160268] sd 1:0:0:0: [sdb] Read Capacity(16) failed: Result: hostbyte=0x07 driverbyte=0x00
[ 214.160284] sd 1:0:0:0: [sdb] Sense not available.
[ 214.760263] sd 1:0:0:0: [sdb] Read Capacity(10) failed: Result: hostbyte=0x07 driverbyte=0x00
[ 214.760278] sd 1:0:0:0: [sdb] Sense not available.
[ 215.000274] sd 1:0:0:0: [sdb] 0 512-byte logical blocks: (0 B/0 B)
[ 215.000290] sd 1:0:0:0: [sdb] 0-byte physical blocks
[ 215.210268] sd 1:0:0:0: [sdb] Write Protect is off
[ 215.210284] sd 1:0:0:0: [sdb] Mode Sense: 00 00 00 00
[ 215.420272] sd 1:0:0:0: [sdb] Asking for cache data failed
[ 215.420287] sd 1:0:0:0: [sdb] Assuming drive cache: write through
[ 216.610214] sd 1:0:0:0: [sdb] Read Capacity(16) failed: Result: hostbyte=0x07 driverbyte=0x00
[ 216.610221] sd 1:0:0:0: [sdb] Sense not available.
[ 217.210279] sd 1:0:0:0: [sdb] Read Capacity(10) failed: Result: hostbyte=0x07 driverbyte=0x00
[ 217.210294] sd 1:0:0:0: [sdb] Sense not available.
[ 218.210280] sd 1:0:0:0: [sdb] Attached SCSI disk
[ 218.390563] xhci_hcd 0000:01:00.0: WARN Can’t disable streams for endpoint 0x82, streams are being disabled already
[ 218.392506] usb 2-2: USB disconnect, device number 2
[ 218.394487] sd 0:0:0:0: [sda] Synchronizing SCSI cache
[ 218.496793] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 2, rd 7, flush 0, corrupt 0, gen 0
[ 218.496806] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 3, rd 7, flush 0, corrupt 0, gen 0
[ 218.497583] BTRFS: error (device sda1) in __btrfs_free_extent:6805: errno=-5 IO failure
[ 218.497604] BTRFS info (device sda1): forced readonly
[ 218.497612] BTRFS: error (device sda1) in btrfs_run_delayed_refs:2935: errno=-5 IO failure
[ 218.497712] BTRFS error (device sda1): pending csums is 4096
[ 219.020243] sd 0:0:0:0: [sda] Synchronize Cache(10) failed: Result: hostbyte=0x07 driverbyte=0x00
[ 219.220611] xhci_hcd 0000:01:00.0: WARN Can’t disable streams for endpoint 0x82, streams are being disabled already

Any advice on how to connect both HDDs simultaneously to the Pi?

Best regards
Philipp

Do the hdds have their own power supplys? If not, you should use a powered usb hub to connect them both at a time…

Hi @CoCoL0r3s

from my experience with RPis and external HDDs the problem most likely is a voltage drop on your USB power rail, ie.e. together the two harddrives draw too much current for your power supply.

Two options to overcome this:

  • Get a stronger power supply for your RPi
  • Make sure to power the HDDs independently

(suggesting to go for option 1…)

I disagree on the suggestion, 2 is the better option, as pulling too much power from usb may harm the RaspberryPi

hey guys,

thx for your quick answers. The HDDs do not have external power supplies as these are USB3 driven 2.5 inch disks.
The Pi is hooked to the official power supply (https://www.raspberrypi.org/products/type-c-power-supply/) which is rated 5.1V / 3.0A. So this might be to low powered? Is the Pi even able to handle a power supply with more than 3A?

@FadeFx has a point here, but many HDDs don’t have this option. Fiddling around with USB Y-connectors (forbidden by USB standard) doesn’t feel like the right solution either.

@CoCoL0r3s the issue most likely is during spin-up of the HDD where most current is drawn. But 3A seems quite enough, especially for two 2.5" disks. :thinking:

A powered usb hub is the way to go…

@simonspa yeah did not think of power issues as I thought 3A should be way enough power to drive two 2.5 inch HDDs, but you’ll never know

@FadeFx will do if necessary. Depending on how difficult it would be to mount a SMB share from my Fritzbox I will try to plug the second HDD there and create the backup to the SMB share before investing in additional hardware.

That would be the harder option, as you would have to do a backup over your network. Depending on your network speed this could take long or longer…

Time is not a problem as I would start the backup in the evening and let it run through night. I have Gigabit wired LAN and right now I am only using roughly 500GB of the 4TB, HDD size is chosen to be future prove. I’m just not sure how to enable SMB v1 (AVM cancled support vor v2/v3) on raspbian.

https://www.raspberrypi.org/forums/viewtopic.php?t=261238

thank you!

I wanted to setup a raid1 configuration with btrfs and two external 2.5" drives. Error as described here. And you’re right - it seems that the rpi 4 cannot power 2 usb drives, as it is working with one 2.5" and one 3.5" drive (3.5 with external power supply). Just tried now.
Well, it seems we have to accept that fact - wondering why the original power supply delivers 3A, while the device can’t even support 2 usb drives?

Anyway i recommend using 3,5" hdds made for nas use, these drives are made for 24/7 spinning, which is to expect in a cloud usage. Laptop hdds usually are not made for this and are likely to fail earlier.

With further testing and research I found, that this issue is especially related to 2.5 inch HDDs with more than 2TB capacity. These drives have more magnetic plates inside and thus require more energy than smaller drives (up to 4A on spin up). So with two up to date 2TB drives, it SHOULD work (did not test). Anyway I will switch the primary HDD of the pi to a 3.5 inch NAS grade HDD and connect one of the small HDDs only temporary for backups as backup over SMB is painfully slow even with small databases.