mariadb failed

I used the Drive Manager to set user data to an external SSD, transferring data in the process. After completing the transer mariadb failed to launch. I must admit I have no idea what the problem is. Any help would be appreciated. Thank you!

mariadb status:

mariadb.service - MariaDB 10.3.27 database server                                                                  │
            │    Loaded: loaded (/lib/systemd/system/mariadb.service; disabled; vendor preset: enabled)                            │
            │   Drop-In: /etc/systemd/system/mariadb.service.d                                                                     │
            │            └─dietpi-services_edit.conf                                                                               │
            │    Active: failed (Result: exit-code) since Wed 2021-05-19 08:48:00 PDT; 6min ago                                    │
            │      Docs: man:mysqld(8)                                                                                             │
            │            https://mariadb.com/kb/en/library/systemd/                                                                │
            │  Main PID: 18796 (code=exited, status=1/FAILURE)                                                                     │
            │    Status: "MariaDB server is down"                                                                                  │
            │                                                                                                                      │
            │ May 19 08:47:58 DietPi systemd[1]: Starting MariaDB 10.3.27 database server...                                       │
            │ May 19 08:47:58 DietPi mysqld[18796]: 2021-05-19  8:47:58 0 [Note] /usr/sbin/mysqld (mysqld                          │
            │ 10.3.27-MariaDB-0+deb10u1) starting as process 18796 ...                                                             │
            │ May 19 08:47:58 DietPi mysqld[18796]: 2021-05-19  8:47:58 0 [Warning] Could not increase number of max_open_files to │
            │ more than 16384 (request: 32186)                                                                                     │
            │ May 19 08:47:58 DietPi mysqld[18796]: 2021-05-19  8:47:58 0 [Warning] Can't create test file                         │
            │ /var/lib/mysql/DietPi.lower-test                                                                                     │
            │ May 19 08:48:00 DietPi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE               │
            │ May 19 08:48:00 DietPi systemd[1]: mariadb.service: Failed with result 'exit-code'.                                  │
            │ May 19 08:48:00 DietPi systemd[1]: Failed to start MariaDB 10.3.27 database server.

Hi,

plus can you post following output

systemctl restart mariadb.service
journalctl -u mariadb
cat /var/log/mysql/error.log
readlink /var/lib/mysql
readlink -f /var/lib/mysql

systemctl restart mariadb.service

Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xe" for details.

journalctl -u mariadb

-- Logs begin at Tue 2021-05-18 22:26:36 PDT, end at Wed 2021-05-19 09:26:58 PDT. --
May 18 22:26:58 DietPi systemd[1]: Starting MariaDB 10.3.27 database server...
May 18 22:26:59 DietPi mysqld[842]: 2021-05-18 22:26:59 0 [Note] /usr/sbin/mysqld (mysqld 10.3.27-MariaDB-0+deb10u1) starting as process 842 ...
May 18 22:26:59 DietPi mysqld[842]: 2021-05-18 22:26:59 0 [Warning] Could not increase number of max_open_files to more than 16384 (request: 3218
6)
May 18 22:26:59 DietPi mysqld[842]: 2021-05-18 22:26:59 0 [Warning] Can't create test file /var/lib/mysql/DietPi.lower-test
May 18 22:27:00 DietPi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
May 18 22:27:00 DietPi systemd[1]: mariadb.service: Failed with result 'exit-code'.
May 18 22:27:00 DietPi systemd[1]: Failed to start MariaDB 10.3.27 database server.
May 18 22:28:53 DietPi systemd[1]: Starting MariaDB 10.3.27 database server...
May 18 22:28:53 DietPi mysqld[5429]: 2021-05-18 22:28:53 0 [Note] /usr/sbin/mysqld (mysqld 10.3.27-MariaDB-0+deb10u1) starting as process 5429 ..
.
May 18 22:28:53 DietPi mysqld[5429]: 2021-05-18 22:28:53 0 [Warning] Could not increase number of max_open_files to more than 16384 (request: 321
86)
May 18 22:28:53 DietPi mysqld[5429]: 2021-05-18 22:28:53 0 [Warning] Can't create test file /var/lib/mysql/DietPi.lower-test
May 18 22:28:55 DietPi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
May 18 22:28:55 DietPi systemd[1]: mariadb.service: Failed with result 'exit-code'.
May 18 22:28:55 DietPi systemd[1]: Failed to start MariaDB 10.3.27 database server.
May 18 22:28:57 DietPi systemd[1]: Starting MariaDB 10.3.27 database server...
May 18 22:28:57 DietPi mysqld[5520]: 2021-05-18 22:28:57 0 [Note] /usr/sbin/mysqld (mysqld 10.3.27-MariaDB-0+deb10u1) starting as process 5520 ..
.
May 18 22:28:57 DietPi mysqld[5520]: 2021-05-18 22:28:57 0 [Warning] Could not increase number of max_open_files to more than 16384 (request: 321
86)
May 18 22:28:57 DietPi mysqld[5520]: 2021-05-18 22:28:57 0 [Warning] Can't create test file /var/lib/mysql/DietPi.lower-test
May 18 22:28:58 DietPi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
May 18 22:28:58 DietPi systemd[1]: mariadb.service: Failed with result 'exit-code'.
May 18 22:28:58 DietPi systemd[1]: Failed to start MariaDB 10.3.27 database server.
May 18 22:30:06 DietPi systemd[1]: Starting MariaDB 10.3.27 database server...
May 18 22:30:06 DietPi mysqld[5791]: 2021-05-18 22:30:06 0 [Note] /usr/sbin/mysqld (mysqld 10.3.27-MariaDB-0+deb10u1) starting as process 5791 ..
.
May 18 22:30:06 DietPi mysqld[5791]: 2021-05-18 22:30:06 0 [Warning] Could not increase number of max_open_files to more than 16384 (request: 321
86)
May 18 22:30:06 DietPi mysqld[5791]: 2021-05-18 22:30:06 0 [Warning] Can't create test file /var/lib/mysql/DietPi.lower-test
May 18 22:30:07 DietPi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
May 18 22:30:07 DietPi systemd[1]: mariadb.service: Failed with result 'exit-code'.
May 18 22:30:07 DietPi systemd[1]: Failed to start MariaDB 10.3.27 database server.
May 18 22:37:12 DietPi systemd[1]: Starting MariaDB 10.3.27 database server...
May 18 22:37:12 DietPi mysqld[9982]: 2021-05-18 22:37:12 0 [Note] /usr/sbin/mysqld (mysqld 10.3.27-MariaDB-0+deb10u1) starting as process 9982 ..
.
May 18 22:37:12 DietPi mysqld[9982]: 2021-05-18 22:37:12 0 [Warning] Could not increase number of max_open_files to more than 16384 (request: 321
86)
May 18 22:37:12 DietPi mysqld[9982]: 2021-05-18 22:37:12 0 [Warning] Can't create test file /var/lib/mysql/DietPi.lower-test
May 18 22:37:14 DietPi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
May 18 22:37:14 DietPi systemd[1]: mariadb.service: Failed with result 'exit-code'.
May 18 22:37:14 DietPi systemd[1]: Failed to start MariaDB 10.3.27 database server.
May 18 22:40:13 DietPi systemd[1]: Starting MariaDB 10.3.27 database server...
May 18 22:40:13 DietPi mysqld[10492]: 2021-05-18 22:40:13 0 [Note] /usr/sbin/mysqld (mysqld 10.3.27-MariaDB-0+deb10u1) starting as process 10492
...
May 18 22:40:13 DietPi mysqld[10492]: 2021-05-18 22:40:13 0 [Warning] Could not increase number of max_open_files to more than 16384 (request: 32
186)
May 18 22:40:13 DietPi mysqld[10492]: 2021-05-18 22:40:13 0 [Warning] Can't create test file /var/lib/mysql/DietPi.lower-test
May 18 22:40:14 DietPi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
May 18 22:40:14 DietPi systemd[1]: mariadb.service: Failed with result 'exit-code'.
May 18 22:40:14 DietPi systemd[1]: Failed to start MariaDB 10.3.27 database server.
May 18 22:42:08 DietPi systemd[1]: Starting MariaDB 10.3.27 database server...
May 18 22:42:08 DietPi mysqld[10584]: 2021-05-18 22:42:08 0 [Note] /usr/sbin/mysqld (mysqld 10.3.27-MariaDB-0+deb10u1) starting as process 10584
...
May 18 22:42:08 DietPi mysqld[10584]: 2021-05-18 22:42:08 0 [Warning] Could not increase number of max_open_files to more than 16384 (request: 32
186)
May 18 22:42:08 DietPi mysqld[10584]: 2021-05-18 22:42:08 0 [Warning] Can't create test file /var/lib/mysql/DietPi.lower-test
May 18 22:42:09 DietPi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
May 18 22:42:09 DietPi systemd[1]: mariadb.service: Failed with result 'exit-code'.
May 18 22:42:09 DietPi systemd[1]: Failed to start MariaDB 10.3.27 database server.
May 18 22:57:37 DietPi systemd[1]: Starting MariaDB 10.3.27 database server...
May 18 22:57:37 DietPi mysqld[11176]: 2021-05-18 22:57:37 0 [Note] /usr/sbin/mysqld (mysqld 10.3.27-MariaDB-0+deb10u1) starting as process 11176
...
May 18 22:57:37 DietPi mysqld[11176]: 2021-05-18 22:57:37 0 [Warning] Could not increase number of max_open_files to more than 16384 (request: 32
186)
May 18 22:57:37 DietPi mysqld[11176]: 2021-05-18 22:57:37 0 [Warning] Can't create test file /var/lib/mysql/DietPi.lower-test
May 18 22:57:38 DietPi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
May 18 22:57:38 DietPi systemd[1]: mariadb.service: Failed with result 'exit-code'.
May 18 22:57:38 DietPi systemd[1]: Failed to start MariaDB 10.3.27 database server.
May 18 22:59:59 DietPi systemd[1]: Starting MariaDB 10.3.27 database server...
May 18 22:59:59 DietPi mysqld[11549]: 2021-05-18 22:59:59 0 [Note] /usr/sbin/mysqld (mysqld 10.3.27-MariaDB-0+deb10u1) starting as process 11549
...
May 18 22:59:59 DietPi mysqld[11549]: 2021-05-18 22:59:59 0 [Warning] Could not increase number of max_open_files to more than 16384 (request: 32
186)
May 18 22:59:59 DietPi mysqld[11549]: 2021-05-18 22:59:59 0 [Warning] Can't create test file /var/lib/mysql/DietPi.lower-test
May 18 23:00:00 DietPi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
May 18 23:00:00 DietPi systemd[1]: mariadb.service: Failed with result 'exit-code'.
May 18 23:00:00 DietPi systemd[1]: Failed to start MariaDB 10.3.27 database server.
May 18 23:00:03 DietPi systemd[1]: Starting MariaDB 10.3.27 database server...
May 18 23:00:03 DietPi mysqld[11640]: 2021-05-18 23:00:03 0 [Note] /usr/sbin/mysqld (mysqld 10.3.27-MariaDB-0+deb10u1) starting as process 11640
...
May 18 23:00:03 DietPi mysqld[11640]: 2021-05-18 23:00:03 0 [Warning] Could not increase number of max_open_files to more than 16384 (request: 32
186)
May 18 23:00:03 DietPi mysqld[11640]: 2021-05-18 23:00:03 0 [Warning] Can't create test file /var/lib/mysql/DietPi.lower-test
May 18 23:00:04 DietPi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
May 18 23:00:04 DietPi systemd[1]: mariadb.service: Failed with result 'exit-code'.
May 18 23:00:04 DietPi systemd[1]: Failed to start MariaDB 10.3.27 database server.
May 18 23:02:39 DietPi systemd[1]: Starting MariaDB 10.3.27 database server...
May 18 23:02:39 DietPi mysqld[12370]: 2021-05-18 23:02:39 0 [Note] /usr/sbin/mysqld (mysqld 10.3.27-MariaDB-0+deb10u1) starting as process 12370
...
May 18 23:02:39 DietPi mysqld[12370]: 2021-05-18 23:02:39 0 [Warning] Could not increase number of max_open_files to more than 16384 (request: 32
186)
May 18 23:02:39 DietPi mysqld[12370]: 2021-05-18 23:02:39 0 [Warning] Can't create test file /var/lib/mysql/DietPi.lower-test
May 18 23:02:40 DietPi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
May 18 23:02:40 DietPi systemd[1]: mariadb.service: Failed with result 'exit-code'.
May 18 23:02:40 DietPi systemd[1]: Failed to start MariaDB 10.3.27 database server.
May 18 23:05:41 DietPi systemd[1]: Starting MariaDB 10.3.27 database server...
May 18 23:05:41 DietPi mysqld[12747]: 2021-05-18 23:05:41 0 [Note] /usr/sbin/mysqld (mysqld 10.3.27-MariaDB-0+deb10u1) starting as process 12747
...
May 18 23:05:41 DietPi mysqld[12747]: 2021-05-18 23:05:41 0 [Warning] Could not increase number of max_open_files to more than 16384 (request: 32
186)
May 18 23:05:41 DietPi mysqld[12747]: 2021-05-18 23:05:41 0 [Warning] Can't create test file /var/lib/mysql/DietPi.lower-test
May 18 23:05:43 DietPi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
May 18 23:05:43 DietPi systemd[1]: mariadb.service: Failed with result 'exit-code'.
May 18 23:05:43 DietPi systemd[1]: Failed to start MariaDB 10.3.27 database server.
May 18 23:20:45 DietPi systemd[1]: Starting MariaDB 10.3.27 database server...
May 18 23:20:45 DietPi mysqld[13504]: 2021-05-18 23:20:45 0 [Note] /usr/sbin/mysqld (mysqld 10.3.27-MariaDB-0+deb10u1) starting as process 13504
...
May 18 23:20:45 DietPi mysqld[13504]: 2021-05-18 23:20:45 0 [Warning] Could not increase number of max_open_files to more than 16384 (request: 32
186)
May 18 23:20:45 DietPi mysqld[13504]: 2021-05-18 23:20:45 0 [Warning] Can't create test file /var/lib/mysql/DietPi.lower-test
May 18 23:20:47 DietPi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
May 18 23:20:47 DietPi systemd[1]: mariadb.service: Failed with result 'exit-code'.
May 18 23:20:47 DietPi systemd[1]: Failed to start MariaDB 10.3.27 database server.
May 18 23:20:59 DietPi systemd[1]: Starting MariaDB 10.3.27 database server...
May 18 23:20:59 DietPi mysqld[13718]: 2021-05-18 23:20:59 0 [Note] /usr/sbin/mysqld (mysqld 10.3.27-MariaDB-0+deb10u1) starting as process 13718
...
May 18 23:20:59 DietPi mysqld[13718]: 2021-05-18 23:20:59 0 [Warning] Could not increase number of max_open_files to more than 16384 (request: 32
186)
May 18 23:20:59 DietPi mysqld[13718]: 2021-05-18 23:20:59 0 [Warning] Can't create test file /var/lib/mysql/DietPi.lower-test
May 18 23:21:00 DietPi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
May 18 23:21:00 DietPi systemd[1]: mariadb.service: Failed with result 'exit-code'.
May 18 23:21:00 DietPi systemd[1]: Failed to start MariaDB 10.3.27 database server.
May 18 23:22:36 DietPi systemd[1]: Starting MariaDB 10.3.27 database server...
May 18 23:22:36 DietPi mysqld[14255]: 2021-05-18 23:22:36 0 [Note] /usr/sbin/mysqld (mysqld 10.3.27-MariaDB-0+deb10u1) starting as process 14255
...
May 18 23:22:36 DietPi mysqld[14255]: 2021-05-18 23:22:36 0 [Warning] Could not increase number of max_open_files to more than 16384 (request: 32
186)
May 18 23:22:36 DietPi mysqld[14255]: 2021-05-18 23:22:36 0 [Warning] Can't create test file /var/lib/mysql/DietPi.lower-test
May 18 23:22:37 DietPi systemd[1]: Started MariaDB 10.3.27 database server.
May 18 23:22:37 DietPi /etc/mysql/debian-start[14299]: /usr/bin/mysql_upgrade: the '--basedir' option is always ignored

May 18 23:22:37 DietPi /etc/mysql/debian-start[14299]: Looking for 'mysql' as: /usr/bin/mysql
May 18 23:22:37 DietPi /etc/mysql/debian-start[14299]: Looking for 'mysqlcheck' as: /usr/bin/mysqlcheck
May 18 23:22:37 DietPi /etc/mysql/debian-start[14299]: This installation of MySQL is already upgraded to 10.3.27-MariaDB,
 use --force if you still need to run mysql_upgrade
May 18 23:22:37 DietPi /etc/mysql/debian-start[14335]: Triggering myisam-recover for all MyISAM tables and aria-recover for all Aria tables
May 18 23:23:26 DietPi systemd[1]: Stopping MariaDB 10.3.27 database server...
May 18 23:23:27 DietPi systemd[1]: mariadb.service: Succeeded.
May 18 23:23:27 DietPi systemd[1]: Stopped MariaDB 10.3.27 database server.
May 18 23:23:27 DietPi systemd[1]: Starting MariaDB 10.3.27 database server...
May 18 23:23:27 DietPi mysqld[14724]: 2021-05-18 23:23:27 0 [Note] /usr/sbin/mysqld (mysqld 10.3.27-MariaDB-0+deb10u1) starting as process 14724
...
May 18 23:23:27 DietPi mysqld[14724]: 2021-05-18 23:23:27 0 [Warning] Could not increase number of max_open_files to more than 16384 (request: 32
186)
May 18 23:23:27 DietPi mysqld[14724]: 2021-05-18 23:23:27 0 [Warning] Can't create test file /var/lib/mysql/DietPi.lower-test
May 18 23:23:29 DietPi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
May 18 23:23:29 DietPi systemd[1]: mariadb.service: Failed with result 'exit-code'.
May 18 23:23:29 DietPi systemd[1]: Failed to start MariaDB 10.3.27 database server.
May 18 23:23:34 DietPi systemd[1]: Starting MariaDB 10.3.27 database server...
May 18 23:23:34 DietPi mysqld[14976]: 2021-05-18 23:23:34 0 [Note] /usr/sbin/mysqld (mysqld 10.3.27-MariaDB-0+deb10u1) starting as process 14976
...
May 18 23:23:34 DietPi mysqld[14976]: 2021-05-18 23:23:34 0 [Warning] Could not increase number of max_open_files to more than 16384 (request: 32
186)
May 18 23:23:34 DietPi mysqld[14976]: 2021-05-18 23:23:34 0 [Warning] Can't create test file /var/lib/mysql/DietPi.lower-test
May 18 23:23:36 DietPi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
May 18 23:23:36 DietPi systemd[1]: mariadb.service: Failed with result 'exit-code'.
May 18 23:23:36 DietPi systemd[1]: Failed to start MariaDB 10.3.27 database server.
May 18 23:23:42 DietPi systemd[1]: Starting MariaDB 10.3.27 database server...
May 18 23:23:43 DietPi mysqld[15228]: 2021-05-18 23:23:43 0 [Note] /usr/sbin/mysqld (mysqld 10.3.27-MariaDB-0+deb10u1) starting as process 15228
...
May 18 23:23:43 DietPi mysqld[15228]: 2021-05-18 23:23:43 0 [Warning] Could not increase number of max_open_files to more than 16384 (request: 32
186)
May 18 23:23:43 DietPi mysqld[15228]: 2021-05-18 23:23:43 0 [Warning] Can't create test file /var/lib/mysql/DietPi.lower-test
May 18 23:23:45 DietPi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
May 18 23:23:45 DietPi systemd[1]: mariadb.service: Failed with result 'exit-code'.
May 18 23:23:45 DietPi systemd[1]: Failed to start MariaDB 10.3.27 database server.
May 18 23:23:58 DietPi systemd[1]: Starting MariaDB 10.3.27 database server...
May 18 23:23:58 DietPi mysqld[15539]: 2021-05-18 23:23:58 0 [Note] /usr/sbin/mysqld (mysqld 10.3.27-MariaDB-0+deb10u1) starting as process 15539
...
May 18 23:23:58 DietPi mysqld[15539]: 2021-05-18 23:23:58 0 [Warning] Could not increase number of max_open_files to more than 16384 (request: 32
186)
May 18 23:23:58 DietPi mysqld[15539]: 2021-05-18 23:23:58 0 [Warning] Can't create test file /var/lib/mysql/DietPi.lower-test
May 18 23:24:00 DietPi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
May 18 23:24:00 DietPi systemd[1]: mariadb.service: Failed with result 'exit-code'.
May 18 23:24:00 DietPi systemd[1]: Failed to start MariaDB 10.3.27 database server.
May 18 23:34:13 DietPi systemd[1]: Starting MariaDB 10.3.27 database server...
May 18 23:34:13 DietPi mysqld[16254]: 2021-05-18 23:34:13 0 [Note] /usr/sbin/mysqld (mysqld 10.3.27-MariaDB-0+deb10u1) starting as process 16254
...
May 18 23:34:13 DietPi mysqld[16254]: 2021-05-18 23:34:13 0 [Warning] Could not increase number of max_open_files to more than 16384 (request: 32
186)
May 18 23:34:13 DietPi mysqld[16254]: 2021-05-18 23:34:13 0 [Warning] Can't create test file /var/lib/mysql/DietPi.lower-test
May 18 23:34:16 DietPi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
May 18 23:34:16 DietPi systemd[1]: mariadb.service: Failed with result 'exit-code'.
May 18 23:34:16 DietPi systemd[1]: Failed to start MariaDB 10.3.27 database server.
May 19 08:46:18 DietPi systemd[1]: Starting MariaDB 10.3.27 database server...
May 19 08:46:18 DietPi mysqld[18664]: 2021-05-19  8:46:18 0 [Note] /usr/sbin/mysqld (mysqld 10.3.27-MariaDB-0+deb10u1) starting as process 18664
...
May 19 08:46:18 DietPi mysqld[18664]: 2021-05-19  8:46:18 0 [Warning] Could not increase number of max_open_files to more than 16384 (request: 32
186)
May 19 08:46:18 DietPi mysqld[18664]: 2021-05-19  8:46:18 0 [Warning] Can't create test file /var/lib/mysql/DietPi.lower-test
May 19 08:46:21 DietPi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
May 19 08:46:21 DietPi systemd[1]: mariadb.service: Failed with result 'exit-code'.
May 19 08:46:21 DietPi systemd[1]: Failed to start MariaDB 10.3.27 database server.
May 19 08:47:58 DietPi systemd[1]: Starting MariaDB 10.3.27 database server...
May 19 08:47:58 DietPi mysqld[18796]: 2021-05-19  8:47:58 0 [Note] /usr/sbin/mysqld (mysqld 10.3.27-MariaDB-0+deb10u1) starting as process 18796
...
May 19 08:47:58 DietPi mysqld[18796]: 2021-05-19  8:47:58 0 [Warning] Could not increase number of max_open_files to more than 16384 (request: 32
186)
May 19 08:47:58 DietPi mysqld[18796]: 2021-05-19  8:47:58 0 [Warning] Can't create test file /var/lib/mysql/DietPi.lower-test
May 19 08:48:00 DietPi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
May 19 08:48:00 DietPi systemd[1]: mariadb.service: Failed with result 'exit-code'.
May 19 08:48:00 DietPi systemd[1]: Failed to start MariaDB 10.3.27 database server.
May 19 09:00:52 DietPi systemd[1]: Starting MariaDB 10.3.27 database server...
May 19 09:00:53 DietPi mysqld[19707]: 2021-05-19  9:00:53 0 [Note] /usr/sbin/mysqld (mysqld 10.3.27-MariaDB-0+deb10u1) starting as process 19707
...
May 19 09:00:53 DietPi mysqld[19707]: 2021-05-19  9:00:53 0 [Warning] Could not increase number of max_open_files to more than 16384 (request: 32
186)
May 19 09:00:53 DietPi mysqld[19707]: 2021-05-19  9:00:53 0 [Warning] Can't create test file /var/lib/mysql/DietPi.lower-test
May 19 09:00:55 DietPi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
May 19 09:00:55 DietPi systemd[1]: mariadb.service: Failed with result 'exit-code'.
May 19 09:00:55 DietPi systemd[1]: Failed to start MariaDB 10.3.27 database server.
May 19 09:26:55 DietPi systemd[1]: Starting MariaDB 10.3.27 database server...
May 19 09:26:55 DietPi mysqld[20033]: 2021-05-19  9:26:55 0 [Note] /usr/sbin/mysqld (mysqld 10.3.27-MariaDB-0+deb10u1) starting as process 20033
...
May 19 09:26:55 DietPi mysqld[20033]: 2021-05-19  9:26:55 0 [Warning] Could not increase number of max_open_files to more than 16384 (request: 32
186)
May 19 09:26:55 DietPi mysqld[20033]: 2021-05-19  9:26:55 0 [Warning] Can't create test file /var/lib/mysql/DietPi.lower-test
May 19 09:26:58 DietPi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
May 19 09:26:58 DietPi systemd[1]: mariadb.service: Failed with result 'exit-code'.
May 19 09:26:58 DietPi systemd[1]: Failed to start MariaDB 10.3.27 database server.

cat /var/log/mysql/error.log

2021-05-19  9:26:55 0 [Note] InnoDB: Using Linux native AIO
2021-05-19  9:26:55 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2021-05-19  9:26:55 0 [Note] InnoDB: Uses event mutexes
2021-05-19  9:26:55 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-05-19  9:26:55 0 [Note] InnoDB: Number of pools: 1
2021-05-19  9:26:55 0 [Note] InnoDB: Using generic crc32 instructions
2021-05-19  9:26:55 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2021-05-19  9:26:55 0 [Note] InnoDB: Completed initialization of buffer pool
2021-05-19  9:26:55 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2021-05-19  9:26:56 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2021-05-19  9:26:56 0 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2021-05-19  9:26:56 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2021-05-19  9:26:56 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2021-05-19  9:26:56 0 [Note] InnoDB: 10.3.27 started; log sequence number 4681423; transaction id 5263
2021-05-19  9:26:56 0 [Note] InnoDB: Loading buffer pool(s) from /mnt/b2fde4f5-88c8-46b8-8cb2-5958c9884b7d/dietpi_userdata/mysql/ib_buffer_pool
2021-05-19  9:26:56 0 [Note] Plugin 'FEEDBACK' is disabled.
2021-05-19  9:26:56 0 [Note] Recovering after a crash using tc.log
2021-05-19  9:26:56 0 [ERROR] Bad magic header in tc log
2021-05-19  9:26:56 0 [ERROR] Crash recovery failed. Either correct the problem (if it's, for example, out of memory error) and restart, or delete tc log and start mysqld with --tc-heuristic-recover={commit|rollback}
2021-05-19  9:26:56 0 [ERROR] Can't init tc log
2021-05-19  9:26:56 0 [ERROR] Aborting

2021-05-19  9:26:58 0 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2021-05-19  9:26:58 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.

readlink /var/lib/mysql

/mnt/dietpi_userdata/mysql

readlink -f /var/lib/mysql

/mnt/b2fde4f5-88c8-46b8-8cb2-5958c9884b7d/dietpi_userdata/mysql

Ok it’s a permission issues for MariaDB to write to the new file system.

Can you post

ls -la mnt/b2fde4f5-88c8-46b8-8cb2-5958c9884b7d/dietpi_userdata/mysql

ls -la mnt/b2fde4f5-88c8-46b8-8cb2-5958c9884b7d/dietpi_userdata/mysql

ls: cannot access 'mnt/b2fde4f5-88c8-46b8-8cb2-5958c9884b7d/dietpi_userdata/mysql': No such file or directory

Whoops typo

ls -la /mnt/b2fde4f5-88c8-46b8-8cb2-5958c9884b7d/dietpi_userdata/mysql

:slight_smile: Here’s what I found:

ls -la /mnt/b2fde4f5-88c8-46b8-8cb2-5958c9884b7d/dietpi_userdata/mysql
total 188484
drwxr-xr-x 4 root   root       4096 May 18 22:08 .
drwxrwxr-x 9 dietpi dietpi     4096 May 18 22:38 ..
-rw-rw---- 1 mysql  mysql     16384 May 19 09:26 aria_log.00000001
-rw-rw---- 1 mysql  mysql        52 May 19 09:26 aria_log_control
-rw-r--r-- 1 root   root          0 May 18 21:15 debian-10.3.flag
-rw-rw---- 1 mysql  mysql      4071 May 18 22:01 ib_buffer_pool
-rw-rw---- 1 mysql  mysql  50331648 May 19 09:26 ib_logfile0
-rw-rw---- 1 mysql  mysql  50331648 May 18 21:15 ib_logfile1
-rw-rw---- 1 mysql  mysql  79691776 May 19 09:26 ibdata1
-rw-rw---- 1 mysql  mysql  12582912 May 19 09:26 ibtmp1
-rw-rw---- 1 mysql  mysql         0 May 18 21:15 multi-master.info
drwx------ 2 mysql  mysql      4096 May 18 21:15 mysql
-rw-rw---- 1 root   root         16 May 18 21:15 mysql_upgrade_info
drwx------ 2 mysql  mysql      4096 May 18 21:15 performance_schema
-rw-rw---- 1 mysql  mysql     24576 May 18 23:23 tc.log

I really appreciate your help. Is there other info I can provide? Thanks!

pls do following

chown mysql:mysql /mnt/b2fde4f5-88c8-46b8-8cb2-5958c9884b7d/dietpi_userdata/mysql
systemctl restart mariadb.service

if MariaDB is not working still, post the error log again

cat /var/log/mysql/error.log
root@DietPi:~# chown mysql:mysql /mnt/b2fde4f5-88c8-46b8-8cb2-5958c9884b7d/dietpi_userdata/mysql
root@DietPi:~# systemctl restart mariadb.service
Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xe" for details.
root@DietPi:~# cat /var/log/mysql/error.log
2021-05-19 14:52:06 0 [Note] InnoDB: Using Linux native AIO
2021-05-19 14:52:06 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2021-05-19 14:52:06 0 [Note] InnoDB: Uses event mutexes
2021-05-19 14:52:06 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-05-19 14:52:06 0 [Note] InnoDB: Number of pools: 1
2021-05-19 14:52:06 0 [Note] InnoDB: Using generic crc32 instructions
2021-05-19 14:52:06 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2021-05-19 14:52:06 0 [Note] InnoDB: Completed initialization of buffer pool
2021-05-19 14:52:06 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2021-05-19 14:52:06 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2021-05-19 14:52:06 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2021-05-19 14:52:06 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2021-05-19 14:52:06 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2021-05-19 14:52:06 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2021-05-19 14:52:06 0 [Note] InnoDB: 10.3.27 started; log sequence number 4681432; transaction id 5263
2021-05-19 14:52:06 0 [Note] InnoDB: Loading buffer pool(s) from /mnt/b2fde4f5-88c8-46b8-8cb2-5958c9884b7d/dietpi_userdata/mysql/ib_buffer_pool
2021-05-19 14:52:06 0 [Note] Plugin 'FEEDBACK' is disabled.
2021-05-19 14:52:06 0 [Note] Recovering after a crash using tc.log
2021-05-19 14:52:06 0 [ERROR] Bad magic header in tc log
2021-05-19 14:52:06 0 [ERROR] Crash recovery failed. Either correct the problem (if it's, for example, out of memory error) and restart, or delete tc log and start mysqld with --tc-heuristic-recover={commit|rollback}
2021-05-19 14:52:06 0 [ERROR] Can't init tc log
2021-05-19 14:52:06 0 [ERROR] Aborting

ok we are one step further. Next to do

mv /mnt/dietpi_userdata/mysql/tc.log /mnt/dietpi_userdata/mysql/tc.save
systemctl restart mariadb.service

again pls post the error log if not working

That fixed it! Thank you very much for your help today. :sunglasses:

I donated as a small thank you!

ok good. Just to sum it up: you had incorrect file system permission in first place and MariaDB was not able to write to the database directory. Second issue was a corrupted file we moved away.

Much appreciated

Perfect. I think I understand.