Services Failing after Swapping Backup Drives

Thanks for your response. I’ve moved everything back to /mnt/dietpi_userdata.

When trying to restart the service I get this:

root@DietPi:/mnt/dietpi_userdata/mysql/mysql# journalctl -n 100
Feb 21 21:50:12 DietPi systemd[1]: Starting MariaDB 10.1.44 database server...
Feb 21 21:50:13 DietPi mysqld[24103]: 2020-02-21 21:50:13 1995718448 [Note] /usr/sbin/mysqld (mysqld 10.1.44-MariaDB-0+deb9u1) starting a
s process 24103 ...
Feb 21 21:50:13 DietPi mysqld[24103]: 2020-02-21 21:50:13 1995718448 [Warning] Can't create test file /var/lib/mysql/DietPi.lower-test
Feb 21 21:50:13 DietPi mysqld[24103]: [90B blob data]
Feb 21 21:50:13 DietPi mysqld[24103]: 2020-02-21 21:50:13 1995718448 [ERROR] Aborting
Feb 21 21:50:13 DietPi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Feb 21 21:50:13 DietPi systemd[1]: Failed to start MariaDB 10.1.44 database server.
Feb 21 21:50:13 DietPi systemd[1]: mariadb.service: Unit entered failed state.
Feb 21 21:50:13 DietPi systemd[1]: mariadb.service: Failed with result 'exit-code'.

The warning about not being able to create the test file went away when I tested earlier, but now it’s back. I’m pretty sure it’s a permissions issue (at least in part). The following is what I had after the move:

root@DietPi:/mnt/dietpi_userdata# ls -l
total 36
drwxr-xr-x 2 root root 4096 Feb 21 12:54 downloads
drwxr-xr-x 2 root root 4096 Feb 21 12:56 Music
drwxr-x--- 5 root root 4096 Feb 21 13:43 mysql
drwxr-x--- 6 root root 4096 Feb 21 12:57 nextcloud_data
drwxr-xr-x 3 root root 4096 Feb 21 12:56 php_bak
drwxr-xr-x 2 root root 4096 Feb 21 12:54 Pictures
drwx------ 3 root root 4096 Feb 21 12:58 syncthing
drwxr-xr-x 2 root root 4096 Feb 21 12:57 syncthing_data
drwxr-xr-x 2 root root 4096 Feb 21 12:54 Video

I did another rsync preserving permissions this time and now have:

root@DietPi:/mnt/dietpi_userdata# ls -l
total 36
drwxrwxr-x 2 dietpi   dietpi   4096 Mar 10  2019 downloads
drwxrwxr-x 2 dietpi   dietpi   4096 Mar 15  2019 Music
drwxrwx--- 5 mysql    mysql    4096 Feb 15 15:39 mysql
drwxrwx--- 6 www-data www-data 4096 Mar 10  2019 nextcloud_data
drwxrwxr-x 3 dietpi   dietpi   4096 Mar 10  2019 php_bak
drwxrwxr-x 2 dietpi   dietpi   4096 Mar 10  2019 Pictures
drwx------ 3 dietpi   dietpi   4096 Feb 15 12:11 syncthing
drwxr-xr-x 2 dietpi   dietpi   4096 Feb 15 12:11 syncthing_data
drwxrwxr-x 2 dietpi   dietpi   4096 Mar 10  2019 Video

After that I also was able to start Mariadb. I also see that Nextcloud is in maintenance mode (do I let that resolve itself or do I need to disable it? - I did remove about 20GB of failed uploads that were in my userdata folder to make the restore to SD possible). Should I consider moving to the USB now? My real goal is to get to a more stable system running off a USB SSD as I mention here: https://dietpi.com/forum/t/request-recommendations-on-hardware-setup-and-restore-options/3849/1