Failed to backup

Hi! I was trying to backup and this error happened:

[ INFO ] DietPi-Backup | Backup to /mnt/dietpi-backup in progress, please wait...
sending incremental file list
  3,569,732,049  97%    1.39MB/s    0:01:03  rsync: [receiver] write failed on "/mnt/dietpi-backup/data/usr/lib/jvm/java-8-openjdk-arm64/jre/lib/rt.jar": Read-only file system (30)
rsync error: error in file IO (code 11) at receiver.c(378) [receiver=3.2.3]

rsync: [sender] write error: Broken pipe (32)
tput: unknown terminal "xterm-256color"
/boot/dietpi/func/dietpi-globals: line 269: ( 48 + 5 ) /  : syntax error: operand expected (error token is "/  ")
/boot/dietpi/dietpi-backup: error reading input file: Input/output error

- Press any key to return to DietPi-Launcher...
tput: unknown terminal "xterm-256color"
/boot/dietpi/func/dietpi-globals: line 171: ((: i<: syntax error: operand expected (error token is "<")

Looks like you have some file system corruption. Can you check for kernel error messages

dmesg -l err,crit,alert,emerg

Here you have it!

[    0.569447] bcm2708_fb soc:fb: Unable to determine number of FBs. Disabling driver.
[ 1583.893827] xhci_hcd 0000:01:00.0: ERROR Transfer event for unknown stream ring slot 2 ep 7
[ 1583.893871] xhci_hcd 0000:01:00.0: @00000004414c0480 00000000 00000000 05000000 02088001
[ 1615.385563] xhci_hcd 0000:01:00.0: ERROR Transfer event for unknown stream ring slot 2 ep 7
[ 1615.385602] xhci_hcd 0000:01:00.0: @00000004414c1180 00000000 00000000 05000000 02088001

What can it be? It’s almost a fresh install of DietPi.

What device do you use?
To what kind of medium do you backup?
And did you tried to use another USB port?
I just researched a little bit and it could be a problem with usb3 (Did you use usb3 port to connect the backup device?)

edit: typo

I’m using a single usb 3.0 ssd drive (crucial) and the backup was into the same drive where the dietpi OS is. It’s actually a very clean and recent install of dietpi.

Basically your drive went into read only mode, indicating some file system issues. How is the drive powered? Does it have a dedicated PSU?

It’s powered through the Rpi itself. I don’t have any other drives attached, just a single SSD — I believe that the rpi should have enough power for a single SSD, right?

No, it doesn’t have the power to run any USB to SATA converters savely. I ran into similiar issues (also with a SSD and USB to SATA adapter) a while ago and they were gone when using a external powered adapter.

Well, that’s bad then. It’s unfortunate that the PI with a shared power of 1 amp (I believe) can’t handle a single SSD which on average runs at 0.5 amps. Having to externally power the SSD makes me wonder if going back to a SD card would be more viable.

Issues are usually peak power consumption during startup or I/O peaks, which is not covered well by the values given by the SSD manufacturers. As a rule of thumb, to prevent issues and potential data loss, a 2.5" or bigger USB drive should always have a dedicated PSU, at least on RPi.

Why is that when searching 2.5 cases on Amazon most of them are sold with USB only? I mean, if they are made to be used with 2.5 drives which, can draw more than 0.9 (that is the usb 3.0 max) why is that? Shouldn’t all be sold with power cable?

Something is quite off here. To be honest, It’s not easy to find 2.5 enclosures with power adapters. Also, most of the 2.5 external hard drives are powered through usb, one can assume they’re made to work properly this way, right?

Just trying to understand how can I use the pi without having to power the SSD because it’s in a small cabinet where having yet another power brick won’t be easy. :frowning:

Normally you use these cases with “real” PCs/laptos and not with a SBC like the Pi. Consider it more like a USB hub, where you are also unable to power the connected devices reliable, if they draw much current.

You could also try to use a “better” stabilized power supply. Argon40 has a power supply with 3.5 Amps. Maybe you can find even something “beefier”.

I personally use this now:
https://www.conrad.de/de/p/renkforce-festplatten-adapter-1x-usb-2-0-stecker-a-1x-sata-kombi-stecker-7-15pol-30-00-cm-schwarz-1490971.html#productDownloads
https://www.amazon.de/Renkforce-USB2-0-SATA-ADAPTERKAB-30CM/dp/B06WGRL8GR
(Without a case, but for me it’s fine for a SSD)

From what I saw online after searching a while, the Kingston A400 has a max write power consumption of 1.5w which should be below the max pi shared power for all ports, whereas the crucial can actually go above that. Already ordered one to give it a try.

I’d rather have a SSD (or any other external disk) that could be powered only the with official pi 4 power, even if it has to be slower. The SD cards are very limited in speed/lifespan, that’s why it’s not an option to me.

Those adapters you’ve suggested Jappe could be a good option for a secondary storage 3.5 disk (which I need too) so having 2 external powered disks for the small cabinet where I have to put them, it’s not viable.

Do not trust these max power consumption numbers given by the manufacturers to cover short peaks especially during startup or when recovering from some idle mode. Obviously it is not true as of the issues :wink:. Usually these numbers cover operation consumption when the drive is up and not in any power savings state (where it needs to recover from first).

Also note that RPi up to 3+ has USB 2.0 only. You will recognise that many USB-only powered cases ship with a split USB cable so that a second USB port can provide additional power. In case of RPi this doesn’t help as of the shared 1.2A (6W) max over all USB ports. On RPi 4 with USB 3.0 it’s the same: While USB 3.0 generally can provide much more power, PCs, notebooks and all such with USB 3.0 support do, RPi 4 still does not provide more than 6W, and it’s similar for most other SBCs.

While a single drive 2.5" USB case usually has no dedicated PSU or power in, a docking station or 3.5" case always has, where you can plug 2.5" drives as well.

An alternative is a USB pen drive, where I never heard of any power related issues. On RPi up to 3+ the USB speed is so highly limited that the extra speed of an SSD is completely lost anyway :wink:.

MichaIng the thing is that this is happening on RPi 4b, not a 3.

However, I found this thread and applied the fix and it’s now working just fine and the backup was done very quickly afterwards whereas previously to that, it would fail and take a while.

Worth notice that I came across this community thread related with the quirks when I started testing the SSD (with the SATA-USB) and noticed that the write speeds were really off when using dd (at kbps). After applying the boot quirks the write speeds were back to ~200 mbps.

Let’s see how it goes from here. :slight_smile:

Makes sense that this happens on RPi 4 since RPi 3 and before do not have it enabled by default. Great that the USB quirk to disable UAS for the obviously incompatible drive solved it :slight_smile:.