0

I've got a Raspberry Pi configured to run a MySQL database using MariaDB. To ensure that I don't run out of space I want to move the data directory to an external USB hard drive. I followed an online tutorial and at the end ran the command systemctl start mariadb which failed. Upon inspection, I found that line in the log : [Warning] Can't create test file /media/pi/DDE\ externe\ test/mysql-data/raspberrypi.lower-test

I thought it might be a problem with the permissions, so I redid the step of the tutorial where I create the mysql-data directory on the external drive and set its ownership. There I noticed that I couldn't set the owner to user mysql, it would stay as user pi :

pi@raspberrypi:/media/pi/DDE externe test $ ls -la total 8 drwxrwxrwx 1 pi pi 4096 mars 8 08:31 . drwxr-x---+ 3 root root 4096 mars 7 15:01 .. pi@raspberrypi:/media/pi/DDE externe test $ mkdir mysql_data pi@raspberrypi:/media/pi/DDE externe test $ ls -la total 8 drwxrwxrwx 1 pi pi 4096 mars 8 08:32 . drwxr-x---+ 3 root root 4096 mars 7 15:01 .. drwxrwxrwx 1 pi pi 0 mars 8 08:32 mysql_data pi@raspberrypi:/media/pi/DDE externe test $ sudo chown mysql:mysql mysql_data/ pi@raspberrypi:/media/pi/DDE externe test $ ls -la total 8 drwxrwxrwx 1 pi pi 4096 mars 8 08:32 . drwxr-x---+ 3 root root 4096 mars 7 15:01 .. drwxrwxrwx 1 pi pi 0 mars 8 08:32 mysql_data 

Am I missing something from that chown command ? Or am I making any obvious mistake ?

3
  • 1
    What is file system type on your external drive? For now it seems that you are using ntfs or other filesystem that does not support owners. Commented Mar 8, 2021 at 7:52
  • That's entirely possible ! I'll try formatting it. Commented Mar 8, 2021 at 7:56
  • @DevilaN Formatting the drive did fix the chown issue, thanks ! Commented Mar 8, 2021 at 8:17

1 Answer 1

1

I'm guessing that the obvious mistake is that the external drive does not have a filesystem that supports chown.

2
  • Thanks for the help, I'll try formatting it Commented Mar 8, 2021 at 7:56
  • While I still get my error message when starting mariadb, at least I did manage to set my folder permissions by formatting my drive to ext4, thanks ! Commented Mar 8, 2021 at 8:16

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.