External HDD Issues

One of the configurations was an SSD. AFAIK Spindown is not an issue.

I’m experiencing the slightly the same problem. Everything works fine with the RootFS on the SSD, but as soon as I connect an other drive (HDD) to the Pi4, either the 2.0 or 3.0 Interface, my system works for a couple of minutes. dmesg shows nothing suspicions, but at a point there are I/O errors and I’ve to power off the system to reboot.

[   17.364657] bcmgenet fd580000.genet eth0: Link is Down
[   20.484652] bcmgenet fd580000.genet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[   20.484674] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   21.554570] usb 1-1.3: new high-speed USB device number 3 using xhci_hcd
[   21.686181] usb 1-1.3: New USB device found, idVendor=0bc2, idProduct=2322, bcdDevice= 0.00
[   21.686188] usb 1-1.3: New USB device strings: Mfr=2, Product=3, SerialNumber=1
[   21.686193] usb 1-1.3: Product: Expansion
[   21.686198] usb 1-1.3: Manufacturer: Seagate
[   21.686202] usb 1-1.3: SerialNumber: NA82GX95
[   21.690166] usb 1-1.3: UAS is blacklisted for this device, using usb-storage instead
[   21.690210] usb 1-1.3: UAS is blacklisted for this device, using usb-storage instead
[   21.690216] usb-storage 1-1.3:1.0: USB Mass Storage device detected
[   21.690500] usb-storage 1-1.3:1.0: Quirks match for vid 0bc2 pid 2322: 800000
[   21.690548] scsi host1: usb-storage 1-1.3:1.0
[   22.725179] scsi 1:0:0:0: Direct-Access     Seagate  Expansion        9300 PQ: 0 ANSI: 6
[   22.725518] sd 1:0:0:0: Attached scsi generic sg1 type 0
[   22.726431] sd 1:0:0:0: [sdb] 976773167 512-byte logical blocks: (500 GB/466 GiB)
[   22.905179] sd 1:0:0:0: [sdb] Write Protect is off
[   22.905188] sd 1:0:0:0: [sdb] Mode Sense: 4f 00 00 00
[   22.905873] sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[   22.932308]  sdb: sdb1
[   22.934900] sd 1:0:0:0: [sdb] Attached SCSI disk



Disk /dev/sda: 223.6 GiB, 240057409536 bytes, 468862128 sectors
Disk model: SSD PLUS 240GB  
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 33553920 bytes
Disklabel type: dos
Disk identifier: 0xd2120dee

Device     Boot Start       End   Sectors   Size Id Type
/dev/sda1        2048 468860927 468858880 223.6G  7 HPFS/NTFS/exFAT


Disk /dev/sdb: 465.8 GiB, 500107861504 bytes, 976773167 sectors
Disk model: Expansion       
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000

Device     Boot Start       End   Sectors   Size Id Type
/dev/sdb1        2048 976773119 976771072 465.8G  7 HPFS/NTFS/exFAT

Does this external hard drive have it’s own power supply? Or is it taking power from the Rpi?

Your rootfs is on sda1 which is HPFS/NTFS/exFAT ?

Hey,

Both external drives running powered by the Pi, but I also testet it with SSD (Pi) and HDD (external) and the behavior was the same.

Your rootfs is on sda1 which is HPFS/NTFS/exFAT ?

It was formatted by diet-drive_manager to ext4. In fdisk -l it shows up as quoted, but in the Drive Manager:

 Mount target: /                                                                                                      │
│ Mount source: /dev/sda1                                                                                              │
│ Filesystem:   ext4                                                                                                   │
│ UUID:         d84b9fc3-6679-46a8-b0c7-bd8fc7051255                                                                   │
│ Allocation:   Capacity: 220GiB | Used: 216GiB (99%)                                                                  │
│ Status:       Drive is online and ready for use                                                                      │
│ Read only:    Disabled

Generally do never power a USB HDD or SSD through the RPi USB port. It only serves 0.6A for all ports together by default, 1A when having max USB power enabled. But even when this is enough for the drives, the RPi itself might face voltage drop then, making the whole system unstable. Everything larger than a USB stick should or must be powered via dedicated PSU.

Hey

I considered your advice and updated the power supply to 5V/6A and upgraded the USB Cable management to Y-Cables to ensure enough flexibility is there for the power handling. But still in this optimal powered case the discussed error was still there.

I tried to isolate the problem to the ground by coping the RootFS back to the SD card, but still having the cache and userdata on the SSD while ensuring the nextclouddata is still on the HDD connected via a symlink to the user data folder. So there it is a stable system without crashes.

Possible Problem could be the UAS driver that comes with Rpi4 as default for an USB connection that could not handle the high IO in the SSD and HDD together. May be a fallback to USB mass storage driver would be a solution.

I m relying here on the german forum entry https://forum-raspberrypi.de/forum/thread/43707-freeze-problem-bei-betrieb-von-einer-ssd/

Further Information about SSDs running into problems with Rpi4 could be found here in english: https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=245931

Not sure if you understood my advice correctly. The issue is not the RPi PSU, but to use USB power for external HDD/SSD at all. Regardless how much power the RPi PSU has, the USB ports will not give more then max 1A. Also an Y-cable does not help, since the single (USB3) port can give 1A already and two USB ports will still not give more, since 1A is a shared limit across all USB ports together. This is a general limitation on most SBCs. So the optimal, or better only valid, powered case it to use a dedicated PSU for the external drives, hence a docking station or 2,5" case with dedicated power plug.

I had a similar experience to what baz123 described. I tried DietPi on Pi4 with a Kingston 480 GB SATA SSD drive and an adapter identified as JMicron USB to ATA/ATAPI Bridge. Transferring root file system to the SSD would always cause a disk failure.

Some time ago I found an old USB 2 SATA case and tried it, which worked like a charm. It’s not very fast of course but still beats SD card speeds easily.

After reading this thread I decided to try the USB 3 adapter again, with the usb-storage option. I’ve only ran it for a few hours but it seems very promising. Without the usb-storage.quirks in cmdline.txt the SSD failed immediately. Now I can install/remove software, and have successfully copied some 50 GB of data to the disk. I did not benchmark but the disk also seems to be faster.

So if someone struggles with external drives they might give usb-storage.quirks a try. It seems Pi4 USB ports can power SSD disks - I’ve had two Pi4s running from SSDs for several weeks this way. I have no other USB devices attached but have used a USB keyboard occasionally without problems.

I just did a quick google search and found this sticky at Raspberrypi board.

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

Yep exactly that one. baz123 also referred to that post earlier but I guess it didn’t help in his case. Just wanted to say it solved my problem with a SATA SSD and a USB 3 adapter. I also had better success with Raspbian but I really really want to use DietPi :smiley:

As you say, I did find it and try it. Didn’t help with DietPi at all. I don’t think I used it on Raspbian - the SSD just worked although I have had one instance where that install failed, but generally seems very stable.

More testing with some interesting results. I tried the usb-storage trick with my second Pi 4 and a different USB 3 adapter. Again, everything seemed to be fine. Until I tried to connect to wifi hotspot which didn’t work.

It took me a while but I think I finally found out what was going on. My finding: when the SSD is plugged in a USB 3 port - no wifi hotspot. Plugged in a USB 2 port - everything ok, including wifi hotspot.

So it’s back to USB 2 speeds for me because I like to run wifi hotspot with Pi-Hole. But the USB (3) adapter works anyway.

So in this case, using the SSD with a USB 3 port seems to leave Pi4’s wifi adapter underpowered. I suppose a powered USB hub would solve the problem.

in general it’s recommended to use external power supply for your external HDD/SSD

Hi,

I had some similar issues if I the power is switched on. my external hard drive is not mounted to RASPBERRY PI 4B if, cause maybe the mounting happens before the drive is ready after power up. Anybody a tipp how to slow down the booting process :slight_smile:.

Does anybody has already a solution for mounting later in the boot sequence or with a delay? Maybe with a logging and messaging of the progress? Somewhere in the rc scripts?

Does anybody face this issue with an external mechanical Hard drive already when powering up in parallel? It is a Red Western Digital 4GB with external power supply…

Thanks!

BR Peter

Hi,

within /etc/fstab you could set a value (x-systemd.automount) to mount the drive not during boot but just in case needed. Means it will be mounted as soon as an application tries to access.