Creating a bug report/issue
Required Information
DietPi version | cat /boot/dietpi/.version
Distro version | echo $G_DISTRO_NAME $G_RASPBIAN
Kernel version | uname -a
SBC model | echo $G_HW_MODEL_NAME
or (EG: RPi3) Intel compute stick
Power supply used | (EG: 5V 1A RAVpower)
SD card used | (EG: SanDisk ultra)
Additional Information (if applicable)
Software title | (EG: Nextcloud)
Was the software title installed freshly or updated/migrated?
Can this issue be replicated on a fresh installation of DietPi?
← If you sent a “dietpi-bugreport”, please paste the ID here →
Bug report ID | echo $G_HW_UUID
9a3ce469-650f-4d77-81a2-a77f1ec1f090
Steps to reproduce
… software install nextcloud
…
Expected behaviour
Actual behaviour
Extra details
i tried reinstall couple times in dietpi-software
can you share following
systemctl restart mariadb.service
journalctl -u mariadb
cat /var/log/mysql/error.log
readlink /var/lib/mysql
readlink -f /var/lib/mysql
root@DietPi:~# systemctl restart mariadb.service
journalctl -u mariadb
Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xe" for details.
-- Journal begins at Mon 2023-04-10 20:51:02 BST, ends at Mon 2023-04-10 21:55:06 BST. --
ápr 10 20:53:44 DietPi systemd[1]: Starting MariaDB 10.5.18 database server...
ápr 10 20:53:44 DietPi mariadbd[3235]: 2023-04-10 20:53:44 0 [Note] /usr/sbin/mariadbd (mysqld 10.5.18-MariaDB-0+deb11u1) starting as process 3235 ...
ápr 10 20:53:44 DietPi mariadbd[3235]: 2023-04-10 20:53:44 0 [Warning] Can't create test file /var/lib/mysql/DietPi.lower-test
ápr 10 20:53:44 DietPi mariadbd[3235]: [92B blob data]
ápr 10 20:53:44 DietPi mariadbd[3235]: 2023-04-10 20:53:44 0 [ERROR] Aborting
ápr 10 20:53:44 DietPi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
ápr 10 20:53:44 DietPi systemd[1]: mariadb.service: Failed with result 'exit-code'.
ápr 10 20:53:44 DietPi systemd[1]: Failed to start MariaDB 10.5.18 database server.
ápr 10 20:53:46 DietPi systemd[1]: Starting MariaDB 10.5.18 database server...
ápr 10 20:53:46 DietPi mariadbd[3454]: 2023-04-10 20:53:46 0 [Note] /usr/sbin/mariadbd (mysqld 10.5.18-MariaDB-0+deb11u1) starting as process 3454 ...
ápr 10 20:53:46 DietPi mariadbd[3454]: 2023-04-10 20:53:46 0 [Warning] Can't create test file /var/lib/mysql/DietPi.lower-test
ápr 10 20:53:46 DietPi mariadbd[3454]: [92B blob data]
ápr 10 20:53:46 DietPi mariadbd[3454]: 2023-04-10 20:53:46 0 [ERROR] Aborting
ápr 10 20:53:46 DietPi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
ápr 10 20:53:46 DietPi systemd[1]: mariadb.service: Failed with result 'exit-code'.
ápr 10 20:53:46 DietPi systemd[1]: Failed to start MariaDB 10.5.18 database server.
ápr 10 21:07:06 DietPi systemd[1]: Starting MariaDB 10.5.18 database server...
ápr 10 21:07:06 DietPi mariadbd[5601]: 2023-04-10 21:07:06 0 [Note] /usr/sbin/mariadbd (mysqld 10.5.18-MariaDB-0+deb11u1) starting as process 5601 ...
ápr 10 21:07:06 DietPi mariadbd[5601]: 2023-04-10 21:07:06 0 [Warning] Can't create test file /var/lib/mysql/DietPi.lower-test
ápr 10 21:07:06 DietPi mariadbd[5601]: [92B blob data]
ápr 10 21:07:06 DietPi mariadbd[5601]: 2023-04-10 21:07:06 0 [ERROR] Aborting
ápr 10 21:07:06 DietPi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
ápr 10 21:07:06 DietPi systemd[1]: mariadb.service: Failed with result 'exit-code'.
ápr 10 21:07:06 DietPi systemd[1]: Failed to start MariaDB 10.5.18 database server.
ápr 10 21:55:06 DietPi systemd[1]: Starting MariaDB 10.5.18 database server...
ápr 10 21:55:06 DietPi mariadbd[6639]: 2023-04-10 21:55:06 0 [Note] /usr/sbin/mariadbd (mysqld 10.5.18-MariaDB-0+deb11u1) starting as process 6639 ...
ápr 10 21:55:06 DietPi mariadbd[6639]: 2023-04-10 21:55:06 0 [Warning] Can't create test file /var/lib/mysql/DietPi.lower-test
ápr 10 21:55:06 DietPi mariadbd[6639]: [92B blob data]
ápr 10 21:55:06 DietPi mariadbd[6639]: 2023-04-10 21:55:06 0 [ERROR] Aborting
ápr 10 21:55:06 DietPi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
ápr 10 21:55:06 DietPi systemd[1]: mariadb.service: Failed with result 'exit-code'.
ápr 10 21:55:06 DietPi systemd[1]: Failed to start MariaDB 10.5.18 database server.
cat /var/log/mysql/error.log
cat: /var/log/mysql/error.log: Nincs ilyen fájl vagy könyvtár
readlink /var/lib/mysql
/mnt/dietpi_userdata/mysql
readlink -f /var/lib/mysql
/mnt/dietpi_userdata/mysql
There seems to be an issue with the file system. Can you check following? It should create a test file, similiar as what MariaDB would do.
sudo -u mysql -g mysql touch /var/lib/mysql/demo.file
Do you use an external disk?
Yes I have 2 external HDD.
Result:
touch: '/var/lib/mysql/demo.file' elérése sikertelen: Engedély megtagadva
Translate: cant reach the file. Premission denied
pls share a couple of things in addition. Try to execute one by one and not at once.
ls -la /var/lib/
ls -la /mnt/dietpi_userdata/mysql
ls -la /mnt
df -h
lsblk -o name,fstype,label,size,ro,type,mountpoint,partuuid,uuid
root@DietPi:~# ls -la /var/lib/
összesen 88
drwxr-xr-x 22 root root 4096 ápr 11 09.24 .
drwxr-xr-x 12 root root 4096 ápr 8 23.53 ..
drwxr-xr-x 2 root root 4096 ápr 11 09.49 alsa
drwxr-xr-x 5 root root 4096 ápr 10 20.18 apache2
drwxr-xr-x 3 root root 4096 ápr 11 09.24 apt
drwx--x--x 10 root root 4096 márc 8 12.26 containerd
drwxr-xr-x 2 root root 4096 márc 8 12.18 dbus
drwxr-xr-x 2 root root 4096 márc 8 12.19 dhcp
drwxr-xr-x 8 root root 4096 ápr 8 23.53 dietpi
drwxr-xr-x 7 root root 4096 ápr 11 09.24 dpkg
drwxr-xr-x 3 root root 4096 febr 13 20.34 grub
drwxr-xr-x 2 root root 4096 márc 8 12.14 initramfs-tools
drwxr-xr-x 2 root root 4096 dec 9 19.15 misc
lrwxrwxrwx 1 root root 26 ápr 11 09.24 mysql -> /mnt/dietpi_userdata/mysql
drwxr-xr-x 2 root root 4096 márc 8 12.20 pam
drwxr-xr-x 4 root root 4096 ápr 10 20.18 php
drwx------ 3 root root 4096 febr 13 20.33 polkit-1
drwx------ 2 root root 4096 febr 13 20.33 private
drwxr-xr-x 2 root root 4096 márc 8 12.19 python
drwxr-x--- 2 redis redis 4096 ápr 11 09.49 redis
drwxr-xr-x 3 root root 4096 febr 13 20.33 sudo
drwxr-xr-x 11 root root 4096 ápr 11 09.19 systemd
drwxr-xr-x 3 root root 4096 ápr 11 09.24 ucf
root@DietPi:~# ls -la /mnt/dietpi_userdata/mysql
összesen 110604
drwxr-xr-x 2 mysql mysql 4096 ápr 11 09.22 .
drwxrwxrw- 11 dietpi dietpi 4096 ápr 11 09.22 ..
-rw-r--r-- 1 mysql mysql 0 ápr 11 09.22 debian-10.5.flag
-rw-rw---- 1 mysql mysql 12582912 ápr 11 09.22 ibdata1
-rw-rw---- 1 mysql mysql 100663296 ápr 11 09.22 ib_logfile0
root@DietPi:~# ls -la /mnt
összesen 36
drwxrwxrw- 8 root root 4096 márc 15 16.17 .
drwxr-xr-x 20 root root 4096 ápr 8 23.53 ..
drwxrwxrwx 1 root root 8192 ápr 1 10.12 BHDD
drwxrwxrw- 11 dietpi dietpi 4096 ápr 11 09.22 dietpi_userdata
drwxrwxrw- 2 dietpi dietpi 4096 febr 13 20.35 ftp_client
drwxrwxrw- 8 dietpi users 4096 ápr 10 20.29 HDD
drwxrwxrw- 2 dietpi dietpi 4096 febr 13 20.35 nfs_client
drwxrwxrw- 2 dietpi dietpi 4096 febr 13 20.35 samba
root@DietPi:~# df -h
Fájlrendszer Méret Fogl. Szab. Fo.% Csatol. pont
udev 1,9G 0 1,9G 0% /dev
tmpfs 383M 5,9M 377M 2% /run
/dev/mmcblk0p2 57G 14G 40G 25% /
tmpfs 1,9G 0 1,9G 0% /dev/shm
tmpfs 5,0M 4,0K 5,0M 1% /run/lock
tmpfs 3,9G 0 3,9G 0% /tmp
tmpfs 50M 0 50M 0% /var/log
/dev/mmcblk0p1 63M 11M 53M 17% /boot/efi
tmpfs 383M 0 383M 0% /run/user/0
/dev/sdb1 1,8T 884G 857G 51% /mnt/HDD
overlay 57G 14G 40G 25% /mnt/dietpi_userdata/docker-data/overlay2/783d89ebef3d99000a9b82a5accd87202fcd3a35a47049e6648393eb5f70bcea/merged
overlay 57G 14G 40G 25% /mnt/dietpi_userdata/docker-data/overlay2/b42959cca4c33779726ae33a955c56cd879fa88a9a935571930e288149c49b9e/merged
/dev/sda1 932G 541G 392G 59% /mnt/BHDD
root@DietPi:~# lsblk -o name,fstype,label,size,ro,type,mountpoint,partuuid,uuid
NAME FSTYPE LABEL SIZE RO TYPE MOUNTPOINT PARTUUID UUID
sda 931,5G 0 disk
└─sda1
ntfs Maxtor
931,5G 0 part /mnt/BHDD 2b8809d0-01 66B6C20FB6C1DFA3
sdb 1,8T 0 disk
└─sdb1
ext4 PrimaryHDD
1,8T 0 part /mnt/HDD 29515f11-2e3c-4280-b915-98df4371948c fbe2a122-ba2d-43f4-a69d-aef0422c0fc1
mmcblk0
│ 57G 0 disk
├─mmcblk0p1
│ vfat 64M 0 part /boot/efi 5efa9c68-b874-4fa5-8cc7-455020134246 E6ED-861F
└─mmcblk0p2
ext4 56,9G 0 part / fe45e2f5-f6da-48c2-8418-aa662c252d1b c84d3b07-a6cc-4192-9b77-a7f4cbb61993
mmcblk0boot0
4M 1 disk
mmcblk0boot1
4M 1 disk
strange, permissions seems to be fine. Can you test following
sudo -u mysql -g mysql touch /var/lib/mysql/demo1.file
sudo -u mysql -g mysql touch /mnt/dietpi_userdata/mysql/demo2.file
result:
root@DietPi:~# sudo -u mysql -g mysql touch /var/lib/mysql/demo1.file
sudo -u mysql -g mysql touch /mnt/dietpi_userdata/mysql/demo2.file
touch: '/var/lib/mysql/demo1.file' access failed: permission denied
touch: '/mnt/dietpi_userdata/mysql/demo2.file' access failed: permission denied
following is failing as well?
cd /mnt/dietpi_userdata/mysql/
sudo -u mysql -g mysql touch ./demo.file
root@DietPi:~# cd /mnt/dietpi_userdata/mysql/
root@DietPi:/mnt/dietpi_userdata/mysql# sudo -u mysql -g mysql touch ./demo.file
root@DietPi:/mnt/dietpi_userdata/mysql#
Nothing happend
Isti6github:
Nothing happend
that’s a good sign on Linux. No feedback means, command has been executed and the test file has been created without issues
Still strange that creating the file from inside the database directory is working but not from outside
Let’s test further thinks to see where it is failing. Pls do this step by step.
cd /
sudo -u mysql -g mysql touch /mnt/dietpi_userdata/mysql/demo.file
cd /mnt/
sudo -u mysql -g mysql touch ./dietpi_userdata/mysql/demo.file
cd /mnt/dietpi_userdata/
sudo -u mysql -g mysql touch ./mysql/demo.file
cd /mnt/dietpi_userdata/mysql/
sudo -u mysql -g mysql touch ./demo.file
Just the last one works
root@DietPi:/mnt/dietpi_userdata/mysql# cd /
root@DietPi:/# sudo -u mysql -g mysql touch /mnt/dietpi_userdata/mysql/demo.file
touch: '/mnt/dietpi_userdata/mysql/demo.file' elérése sikertelen: Engedély megtagadva
root@DietPi:/# cd /mnt/
root@DietPi:/mnt# sudo -u mysql -g mysql touch ./dietpi_userdata/mysql/demo.file
touch: './dietpi_userdata/mysql/demo.file' elérése sikertelen: Engedély megtagadva
root@DietPi:/mnt# cd /mnt/dietpi_userdata/
root@DietPi:/mnt/dietpi_userdata# sudo -u mysql -g mysql touch ./mysql/demo.file
touch: './mysql/demo.file' elérése sikertelen: Engedély megtagadva
root@DietPi:/mnt/dietpi_userdata# cd /mnt/dietpi_userdata/mysql/
root@DietPi:/mnt/dietpi_userdata/mysql# sudo -u mysql -g mysql touch ./demo.file
root@DietPi:/mnt/dietpi_userdata/mysql#
still strange, can you try following
cd /mnt/dietpi_userdata/
ls -la
chown mysql:mysql ./mysql/
chmod 755 ./mysql/
ls -la
sudo -u mysql -g mysql touch ./mysql/demo.file
Unfortunetly, same…
root@DietPi:~# cd /mnt/dietpi_userdata/
ls -la
chown mysql:mysql ./mysql/
chmod 755 ./mysql/
ls -la
sudo -u mysql -g mysql touch ./mysql/demo.file
összesen 80
drwxrwxrw- 11 dietpi dietpi 4096 ápr 11 09.22 .
drwxrwxrw- 8 root root 4096 márc 15 16.17 ..
drwxrwxrw- 4 debian-deluged root 4096 márc 22 13.26 deluge
-rwxrwxrwx 1 root root 2035 márc 1 05.11 docker-compose.yml-immich
-rw-r--r-- 1 root root 10475 márc 10 16.01 docker-compose.yml-original
-rwxrwxrwx 1 root root 9066 márc 14 08.05 docker-compose.yml-photoprism
drwx--x--- 12 root root 4096 ápr 11 09.50 docker-data
drwxrwxr-x 2 dietpi dietpi 4096 márc 9 09.58 downloads
-rwxrwxrwx 1 root root 3384 márc 14 20.24 .env-Immich
drwxrwxrw- 2 filebrowser root 4096 márc 8 12.28 filebrowser
-rw-r--r-- 1 root root 3372 márc 20 17.21 immich.env
drwxrwxrw- 9 jellyfin jellyfin 4096 márc 8 16.49 jellyfin
-rw-r--r-- 1 root root 0 ápr 11 09.19 mariadb-database-backup.sql
drwxrwxr-x 2 dietpi dietpi 4096 márc 8 12.28 Music
drwxr-xr-x 2 mysql mysql 4096 ápr 11 12.58 mysql
drwxrwxr-x 2 dietpi dietpi 4096 márc 8 12.17 Pictures
drwxrwxr-x 2 dietpi dietpi 4096 márc 8 12.17 Video
összesen 80
drwxrwxrw- 11 dietpi dietpi 4096 ápr 11 09.22 .
drwxrwxrw- 8 root root 4096 márc 15 16.17 ..
drwxrwxrw- 4 debian-deluged root 4096 márc 22 13.26 deluge
-rwxrwxrwx 1 root root 2035 márc 1 05.11 docker-compose.yml-immich
-rw-r--r-- 1 root root 10475 márc 10 16.01 docker-compose.yml-original
-rwxrwxrwx 1 root root 9066 márc 14 08.05 docker-compose.yml-photoprism
drwx--x--- 12 root root 4096 ápr 11 09.50 docker-data
drwxrwxr-x 2 dietpi dietpi 4096 márc 9 09.58 downloads
-rwxrwxrwx 1 root root 3384 márc 14 20.24 .env-Immich
drwxrwxrw- 2 filebrowser root 4096 márc 8 12.28 filebrowser
-rw-r--r-- 1 root root 3372 márc 20 17.21 immich.env
drwxrwxrw- 9 jellyfin jellyfin 4096 márc 8 16.49 jellyfin
-rw-r--r-- 1 root root 0 ápr 11 09.19 mariadb-database-backup.sql
drwxrwxr-x 2 dietpi dietpi 4096 márc 8 12.28 Music
drwxr-xr-x 2 mysql mysql 4096 ápr 11 12.58 mysql
drwxrwxr-x 2 dietpi dietpi 4096 márc 8 12.17 Pictures
drwxrwxr-x 2 dietpi dietpi 4096 márc 8 12.17 Video
touch: './mysql/demo.file' elérése sikertelen: Engedély megtagadva
root@DietPi:/mnt/dietpi_userdata#
I’m running out of ideas slowly. Permissions are fine but database user is not able to write to database directory still
Let’s try to set write permission for everyone
cd /mnt/dietpi_userdata/
chmod 777 ./mysql/
ls -la
sudo -u mysql -g mysql touch ./mysql/demo.file
Sadly. The issue is the same.
root@DietPi:/mnt/dietpi_userdata# cd /mnt/dietpi_userdata/
chmod 777 ./mysql/
ls -la
sudo -u mysql -g mysql touch ./mysql/demo.file
összesen 80
drwxrwxrw- 11 dietpi dietpi 4096 ápr 11 09.22 .
drwxrwxrw- 8 root root 4096 márc 15 16.17 ..
drwxrwxrw- 4 debian-deluged root 4096 márc 22 13.26 deluge
-rwxrwxrwx 1 root root 2035 márc 1 05.11 docker-compose.yml-immich
-rw-r--r-- 1 root root 10475 márc 10 16.01 docker-compose.yml-original
-rwxrwxrwx 1 root root 9066 márc 14 08.05 docker-compose.yml-photoprism
drwx--x--- 12 root root 4096 ápr 11 09.50 docker-data
drwxrwxr-x 2 dietpi dietpi 4096 márc 9 09.58 downloads
-rwxrwxrwx 1 root root 3384 márc 14 20.24 .env-Immich
drwxrwxrw- 2 filebrowser root 4096 márc 8 12.28 filebrowser
-rw-r--r-- 1 root root 3372 márc 20 17.21 immich.env
drwxrwxrw- 9 jellyfin jellyfin 4096 márc 8 16.49 jellyfin
-rw-r--r-- 1 root root 0 ápr 11 09.19 mariadb-database-backup.sql
drwxrwxr-x 2 dietpi dietpi 4096 márc 8 12.28 Music
drwxrwxrwx 2 mysql mysql 4096 ápr 11 12.58 mysql
drwxrwxr-x 2 dietpi dietpi 4096 márc 8 12.17 Pictures
drwxrwxr-x 2 dietpi dietpi 4096 márc 8 12.17 Video
touch: './mysql/demo.file' elérése sikertelen: Engedély megtagadva
root@DietPi:/mnt/dietpi_userdata#
ok I have no further ideas why it is not possible to write into a directory that is writable for everybody.
Maybe @MichaIng has a fresh pair of eyes.
Is there probably an immutable flag?
lsattr /mnt/dietpi_userdata/mysql