USBdrive vs. USBdrive1 | attach external HDD -> data directory not found anymore

I have the following problem:

I use NextcloudPi (NCP) on an Odroid HC2 with a 2TB Western digital Red HHD on the ATA-Port. I installed NCP on the SD and set the HHD as data location during the setup. So far everything is fine. But as I attach an UBB HDD to the Odroid’s USB 2.0 port to backup my NCP, NCP stops working as it can not find it’s data directory anymore. So far this is what I found out what happens:

The ATA HDD is mounted as USBdrive. When I attach the USB-HDD this second device is mounted in two places: first under it’s label name “4TB” an second as USBdrive. The ATA-HDD then gets mounted as USBdrive1 and therefore can not be found by NCP anymore.
I am on the latest 13. Version of Nextcloud

It would be great if someone had a solution for me!

Thanks for reading so far!
Best regards,

I don’t use ncp, not sure how it mount device. But you can always fix the mounting pair (device and point) by UUID.

Your sd card and USB-HDD all have their own uuid, check their uuid and fix them on /etc/fstab.

unplug all usb-hdd
open a terminal, ls /dev/disk/by-uuid, copy the id (it is the sdcard)
plug your 2T hdd
open a terminal, ls /dev/disk/by-uuid, copy the new id (it is the 2T hdd)
update the /etc/fstab accordingly
your should be fine

The answer to your question is in the official documentation

Important note: If you are using only one USB drive, you can leave the default path /media/USBdrive for all configuration options, but if you are going to use more than one you need to reference them by label, or NCP will not be able to know which one is which. For instance, if the label of the drive is mylabel then use the path /media/mylabel for items such as nc-datadir, nc-database and so on.

1 Like