Kernel version | Linux DietPi 6.6.62+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.6.62-1+rpt1 (2024-11-25) aarch64 GNU/Linux
Architecture | arm64
Hardware model | RPi 5 Model B (aarch64) (ID=5)
Power supply used | Beseus 100w PD
SD card used | SanDisk Extreme 128Gb + Samsung Evo 970 + Data X8200Pro
Steps to reproduce:
Just installing NextCloud (or MariaDB)
Extra details:
margerfs installed and working (marging 2 SSDs in 1 storage)
nextcloud was installed just after first boot (never tested! ), but because of syncthing βissueβ I uninstalled it
Additional logs:
Warning: The unit file, source configuration file or drop-ins of mariadb.service changed on disk. Run 'systemctl daemon-reload' to reload units.
Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xeu mariadb.service" for details.
systemctl status mariadb.service
Γ mariadb.service - MariaDB 10.11.6 database server
Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; preset: enabled)
Drop-In: /etc/systemd/system/mariadb.service.d
ββdietpi.conf
Active: failed (Result: exit-code) since Sun 2024-12-29 12:35:31 GMT; 5min ago
Docs: man:mariadbd(8)
https://mariadb.com/kb/en/library/systemd/
Process: 9142 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
Process: 9143 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process: 9145 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`cd /usr/bin/..; /usr/bin/galera_recovery`; [ $? -eq 0 ] && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
Process: 9174 ExecStart=/usr/sbin/mariadbd $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)
Main PID: 9174 (code=exited, status=1/FAILURE)
Status: "MariaDB server is down"
CPU: 90ms
Dec 29 12:35:31 DietPi systemd[1]: Starting mariadb.service - MariaDB 10.11.6 database server...
Dec 29 12:35:31 DietPi mariadbd[9174]: 2024-12-29 12:35:31 0 [Warning] Can't create test file '/var/lib/mysql/DietPi.lower-test' (Errcode: 13 "Permission denied")
Dec 29 12:35:31 DietPi mariadbd[9174]: [92B blob data]
Dec 29 12:35:31 DietPi mariadbd[9174]: 2024-12-29 12:35:31 0 [ERROR] Aborting
Dec 29 12:35:31 DietPi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Dec 29 12:35:31 DietPi systemd[1]: mariadb.service: Failed with result 'exit-code'.
Dec 29 12:35:31 DietPi systemd[1]: Failed to start mariadb.service - MariaDB 10.11.6 database server.
journalctl -xeu mariadb.service
Dec 29 12:35:31 DietPi mariadbd[9174]: 2024-12-29 12:35:31 0 [Warning] Can't create test file '/var/lib/mysql/DietPi.lower-test' (Errcode: 13 "Permission denied")
Dec 29 12:35:31 DietPi mariadbd[9174]: [92B blob data]
Dec 29 12:35:31 DietPi mariadbd[9174]: 2024-12-29 12:35:31 0 [ERROR] Aborting
Dec 29 12:35:31 DietPi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
ββ Subject: Unit process exited
ββ Defined-By: systemd
ββ Support: https://www.debian.org/support
ββ
ββ An ExecStart= process belonging to unit mariadb.service has exited.
ββ
ββ The process' exit code is 'exited' and its exit status is 1.
Dec 29 12:35:31 DietPi systemd[1]: mariadb.service: Failed with result 'exit-code'.
ββ Subject: Unit failed
ββ Defined-By: systemd
ββ Support: https://www.debian.org/support
ββ
ββ The unit mariadb.service has entered the 'failed' state with result 'exit-code'.
Dec 29 12:35:31 DietPi systemd[1]: Failed to start mariadb.service - MariaDB 10.11.6 database server.
ββ Subject: A start job for unit mariadb.service has failed
ββ Defined-By: systemd
ββ Support: https://www.debian.org/support
ββ
ββ A start job for unit mariadb.service has finished with a failure.
ββ
ββ The job identifier is 1985 and the job result is failed.
Yes, i was testing features and and moved directory to ssd, and then move it back to sd - completly forget about thatβ¦
readlink /var/lib/mysql
/mnt/dietpi_userdata/mysql
readlink -f /var/lib/mysql
/mnt/dietpi_userdata/mysql
Incase needed:
root@DietPi:/# ls -la /var/lib/mysql
lrwxrwxrwx 1 root root 26 Dec 29 11:48 /var/lib/mysql -> /mnt/dietpi_userdata/mysql
root@DietPi:/# ls -la /mnt/dietpi_userdata/mysql
total 110600
drwxr-xr-x 2 mysql mysql 4096 Dec 29 11:31 .
drwxrwxr-x 9 dietpi dietpi 4096 Dec 29 11:31 ..
-rw-r--r-- 1 root root 0 Dec 29 11:31 debian-10.11.flag
-rw-rw---- 1 mysql mysql 100663296 Dec 29 11:31 ib_logfile0
-rw-rw---- 1 mysql mysql 12582912 Dec 29 11:31 ibdata1
How did you move the folder? Using drive manager or manually?
With drive menager
root@DietPi:/# sudo -u mysql -g mysql touch /var/lib/mysql/demo.file
ls -la /mnt/dietpi_userdata/mysql
touch: cannot touch '/var/lib/mysql/demo.file': Permission denied
total 110600
drwxr-xr-x 2 mysql mysql 4096 Dec 29 11:31 .
drwxrwxr-x 9 dietpi dietpi 4096 Dec 29 11:31 ..
-rw-r--r-- 1 root root 0 Dec 29 11:31 debian-10.11.flag
-rw-rw---- 1 mysql mysql 100663296 Dec 29 11:31 ib_logfile0
-rw-rw---- 1 mysql mysql 12582912 Dec 29 11:31 ibdata1
root@DietPi:/# sudo -u mysql -g mysql touch /mnt/dietpi_userdata/mysql/demo.file
ls -la /mnt/dietpi_userdata/mysql
touch: cannot touch '/mnt/dietpi_userdata/mysql/demo.file': Permission denied
total 110600
drwxr-xr-x 2 mysql mysql 4096 Dec 29 11:31 .
drwxrwxr-x 9 dietpi dietpi 4096 Dec 29 11:31 ..
-rw-r--r-- 1 root root 0 Dec 29 11:31 debian-10.11.flag
-rw-rw---- 1 mysql mysql 100663296 Dec 29 11:31 ib_logfile0
-rw-rw---- 1 mysql mysql 12582912 Dec 29 11:31 ibdata1
Thatβs it. It appears that you have adjusted the authorisations to /mnt. The read authorisation for everyone is missing. Did you change that? Instead, write permissions have been added for the group. Therefore the MariaDB user cannot access the folders under /mnt.
To fix
chmod 775 /mnt/
systemctl restart mariadb
systemctl status mariadb
Simple learning by doing. It is also good to read and understand log files in order to know where the error could lie. A certain understanding of Linux is also an advantage. And as far as DietPi is concerned, there are certainly one or two undocumented functions. That comes over time
We have one or two users who started from scratch and got to grips with Linux just for the fun of it. And now they are a helpful part of the community.