Now I was able to help myself.
I solved the problem by simply mounting the second flash drive as a drive permanently.
This is how I did it:
first i logged in as user pi via ssh in a terminal:
After that I become root as follows:
now determine the connected drives:
ls -l /dev/sd*
In my case the flash drive with the system on it has 2 partitions (boot & root).
The other one has one partition (which still has the windows format).
root@nextcloudpi:~# ls -l /dev/sd*
brw-rw---- 1 root disk 8, 0 M�r 17 12:28 /dev/sda
brw-rw---- 1 root disk 8, 1 17. M�r 12:28 /dev/sda1
brw-rw---- 1 root disk 8, 16 17. M�r 12:28 /dev/sdb
brw-rw---- 1 root disk 8, 17 17. M�r 12:28 /dev/sdb1
brw-rw---- 1 root disk 8, 18 17. M�r 12:28 /dev/sdb2
Now you have to repartition the second flash drive. In my case the sda.
Please have a look before (best at wiki.ubuntuusers.de/fdisk/ what to do why and how!).
For start point/end point or size I simply quit with enter:
Now the flash drive will be partitioned
We now change to the media directory:
Now create a directory for the mount, e.g. ncbusb:
Now we mount the new flash drive with the following command:
sudo mount /dev/sda1 /media/ncbusb
Now we get the UUID of the new drive with blkid:
In my case, the output looked like this:
/dev/sda1: UUID=“8b800054-c154-4666-bd47-1fa308672ee7” BLOCK_SIZE=“4096” TYPE=“ext4”
/dev/sdb1: LABEL_FATBOOT=“boot” LABEL=“boot” UUID=“F914-FF4D” BLOCK_SIZE=“512” TYPE=“vfat” PARTUUID=“93b980bb-01”
/dev/sdb2: LABEL=“rootfs” UUID=“1943b829-a99b-45b8-9fe5-7136dbea4c4a” BLOCK_SIZE=“4096” TYPE=“ext4” PARTUUID=“93b980bb-02”
We need here the UUID of the sda1 so the 8b800054-c154-4666-bd47-1fa308672ee7
Now we edit the fstab. This will be processed at boot time. So we mount the backup flash drive at boot time:
At the end of the fstab we make a new line, which should look like this (of course with your own UUID!!):
UUID=8b800054-c154-4666-bd47-1fa308672ee7 /media/ncbusb ext4 defaults 0 0
Now you have successfully mounted the new flash drive into the system.
At nextcloudpi in the administration you can now set up an automatic backup under BACKUPS
to set up an automatic backup.
Now enter the following as destination directory:
I tested my system with a manual backup and rebooted.
Everything works as desired!
Translated with DeepL Translate: The world's most accurate translator (free version)