[SOLVED] QUESTION: Permissions for storing MariaDB data on a USB drive

richardjlyon

New Member
May 20, 2023
6
1
3
Edinburgh, Scotland
Hello. Novice user here.

I have an ubuntu-22.10-standard_22.10-1_amd64 LXC running mariadb, stored on the `local` SSD drive that proxmox is installed on.

I want to store the database on an external usb drive, accessible at path /mnt/gdrive/mariadb.

I've updated /etc/mysql/my.cnf as:

Code:
[mysqld] datadir=/mnt/gdrive/mariadb

PROBLEM: I cant restart the mariadb service, and attempting to move the database files from /var/lib/mysql to /mnt/gdrive/mariadb produces "permission denied" errors, even as root.

I presume I have to set a user up on /mnt/gdrive/mariadb - I assume a dedicated mariadb user - and give it read/write permissions, but I'm a novice Linux/proxmox user and don't know how to do it or where to look.

May I ask someone to advise me on how to set Mariadb with its database on an external USB drive in this way?

Thank you.
 
Last edited:
Besides that I do not recommend to run anything from external usb drives (latency-related issues) it may be easier to add the external disk as a new storage in PVE and just move your LX(C) container to the external storage. This is completely transparent to the container and will maybe work better with regards to your problem.
 
Besides that I do not recommend to run anything from external usb drives (latency-related issues) it may be easier to add the external disk as a new storage in PVE and just move your LX(C) container to the external storage. This is completely transparent to the container and will maybe work better with regards to your problem.
That makes sense. I've purchased an external SSD drive and will follow your guidance. Thank you :)
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!