NextCloudPi on Raspberry Pi 4 with 2x HDD via USB causing severe problems

Hi, I installed NCP on a Raspberry Pi 4 with 2 x HDD (WD 2TB USB 3.0) and ran into a couple of problems. My goal is to have one HDD for the NC data and the other for backup (or both as raid 1).

  1. First, I connected both HDD directly to the RPi and installed NCP which worked well. However, I soon realized that both the https and ssh connection started disconnecting and the HDD made strange sounds. My guess was that the power provided by the RPi was not enough to supply the HDDs.

  2. So I connected them to an active USB Hub with separate power supply. This worked much better.
    I formatted the HDDs with btrfs (the first via NCP, the other manually) and used ncp btrfs auto snapshots. This also worked well.
    [Actually, before using the auto snapshots I tried to add the second HDD as second RAID1 device to the first one, but as I don’t have much experience with btrfs yet I crashed the whole filesystem and started over again …]

Then I tried to use the btrfs auto sync feature to copy the snapshots to the second HDD. But nothing happened. [Should I report a bug about this?]

  1. Therefore I tried rsync instead. And, again, the HDDs started making the strange sounds and during the initial rsync a lot of I/O error messages started to appear. And in the end, the filesystem of my main data HDD was corrupted again.

I now can mount the data HDD with -o recovery,ro, but the ncdata dir still shows an I/O error when I try to open it. However, the snapshots seems to be alright.

So … I think I need some suggestions before I go on running into issues.

Does someone have experiences with a similar setup?

How can I figure out if the power supply is really causing the issues I faced?
Does the raspberry or HDD provides information about low power (in the logs)?
I guess somewhere there are the technical specy how much power the RPi can provide via USB …?

As btrfs is the default FS suggested by NCP, I expect that it is kind of robust. And AFAI understood, btrfs should be quite robust against failures due to journaling and file chacksums etc.

So, I’m a bit surprised that the FS crashed in a way I cannot mount it normally, and with I/O errors in recovery mode (The error msg in the log is “BTRFS error (device sdb1): parent transid verify failed on 54788096 wanted 658 found 130”).

Any idea how to recover?

Or, would you recommend to use btrfs for this setup?

Should I generally take a different approach?

Any suggestion what I could try to make the really robust?

Thanks in advance! :slight_smile:

Hi,

I solved all the power supply problems in my setup (Pi4 + 2 HDD) with this:

https://www.tp-link.com/uk/home-networking/computer-accessory/uh700/

If your HDD’s are fine and your USB hub it doesn’t have enough power this or equivalent solves the problem.

Is better to test the disks in a laptop or desktop and if they work properly you have a low power USB Hub.

Also, you can see the low power symbol with a monitor attached.
The power led (red) on the pi sometimes goes out. Need to be always on.
You need to be sure the Pi power supply the correct one. This can also cause problems. I’m using the official power supply for Raspberrypi 4.

1 Like

Btrfs raid1 works well for me, check this guide: https://askubuntu.com/questions/1026334/convert-a-single-drive-btrfs-disk-into-a-raid1-with-a-second-disk

Good to hear that this setup works for you. I’ll give this USB hub a try. Both HDDs work fine when attached to my notebook. I tried to copy several GBs of data from one to the other without problems.

Currently, my Pi gets its power via an attached HifiBerry AMP; maybe not an ideal solution.
I guess I’ll change this as well.

Also good to hear that you have good experiences with a btrfs raid1. In fact, I think I followed this guide, but it might be that the power issues caused the crashing of the fs.

So, you never experienced issues that the FS was broken due to HW problems?

Do you use any (active / passive) cooling for the Pi (4)?
Mine was getting pretty hot, but I didn’t check the temperature yet.

Yeah, sufficient power supply is mandatory, i use self powered 3,5" hdds, there it is no issue, also these ironwulf drives are built for 24/7 usage which most of the 2,5" drives are not…

Do not forget that even with raid1 it will always be necessary a data backup

I use that case on Nextcloud.


The fans are a little noisy. Depends on the environment in which it will be installed or your preference.
Idle temperature: 30ºC to 35ºC

On a raspberrypi 4 Pi-hole I use this:


Passive cooling
Idle temperature: 40ºC to 45ºC
Cannot see the green and red led’s

I did not tested with heavy loads
I always prefer aluminum cases where the case is also the heat sink
There are many boxes and some better ones
If I bought a box today for Nextcloud I would opt for a passive one (the noise is low but you hear)

1 Like

Thanks again for your hints. So I’ll go ahead and play around with another case and USB hub.

so you mean that they have their own power supply?

Exactly, the pi is not delivering enough power for two hdd’s you could however also use a powered usb hub to connect two 2.5" drives without their own power supply

Btw i use an aluminium case with a fan which should be connected to 12v but it was way too noisy for me so i connected it to 5v and it was still colling to arroud 35 to 38 degree during use…

1 Like

If found in the documentation that the Pi 4 can supply 1,2A for USB (depending on what else consumes power).

USB-Power Supply: From the Raspberry Pi 3 onwards, the total power supplied to all USB ports in aggregate is 1200mA. See Power for more information.

But I didn’t found yet, how much a WD Elements HDD is consuming.