Percona failed to set datadir to

Hi,

I’ve been using Percona and recently I decided to move the database from the OS ssd to a new nvme one.

Set the datadir to the new location, copied the files and set permissions but I get an error when starting mysql.
Tried setting permission, set owner, reinstalled but nothing seams to work. Any advice is welcomed. Server is working just fine if the datadir is set to /var/lib/mysl.

Thanks.


oct 14 18:20:09 mavacorp-System-Product-Name mysqld[22976]: mysqld: Can't change dir to '/media/mavacorp/nvme1/mysql/' (Errcode: 13 - Permission denied)
oct 14 18:20:09 mavacorp-System-Product-Name mysqld[22976]: 2018-10-14T15:20:09.026595Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
oct 14 18:20:09 mavacorp-System-Product-Name mysqld[22976]: 2018-10-14T15:20:09.026782Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
oct 14 18:20:09 mavacorp-System-Product-Name mysqld[22976]: 2018-10-14T15:20:09.169953Z 0 [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql mode
oct 14 18:20:09 mavacorp-System-Product-Name mysqld[22976]: 2018-10-14T15:20:09.169971Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.
oct 14 18:20:09 mavacorp-System-Product-Name mysqld[22976]: 2018-10-14T15:20:09.170008Z 0 [Warning] Can't create test file /media/mavacorp/nvme1/mysql/mavacorp-System-Product-
oct 14 18:20:09 mavacorp-System-Product-Name mysqld[22976]: 2018-10-14T15:20:09.170023Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.23-23) starting as process 22978 ...
oct 14 18:20:09 mavacorp-System-Product-Name mysqld[22976]: 2018-10-14T15:20:09.171481Z 0 [Warning] Can't create test file /media/mavacorp/nvme1/mysql/mavacorp-System-Product-
oct 14 18:20:09 mavacorp-System-Product-Name mysqld[22976]: 2018-10-14T15:20:09.171489Z 0 [Warning] Can't create test file /media/mavacorp/nvme1/mysql/mavacorp-System-Product-
oct 14 18:20:09 mavacorp-System-Product-Name mysqld[22976]: 2018-10-14T15:20:09.171754Z 0 [ERROR] failed to set datadir to /media/mavacorp/nvme1/mysql/
oct 14 18:20:09 mavacorp-System-Product-Name mysqld[22976]: 2018-10-14T15:20:09.171760Z 0 [ERROR] Aborting
oct 14 18:20:09 mavacorp-System-Product-Name mysqld[22976]: 2018-10-14T15:20:09.171774Z 0 [Note] Binlog end
oct 14 18:20:09 mavacorp-System-Product-Name mysqld[22976]: 2018-10-14T15:20:09.171807Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
oct 14 18:20:09 mavacorp-System-Product-Name mysqld[22976]: Initialization of mysqld failed: 0
oct 14 18:20:09 mavacorp-System-Product-Name systemd[1]: mysql.service: Control process exited, code=exited status=1
oct 14 18:20:09 mavacorp-System-Product-Name systemd[1]: mysql.service: Failed with result 'exit-code'.
oct 14 18:20:09 mavacorp-System-Product-Name systemd[1]: Failed to start Percona Server.

Looks like the x permission was missing for mysql on the directory or its parents?