I’m running MySQL on Ubuntu with a ZFS filesystem setup. My MySQL data directory is at the standard /var/lib/mysql location, which sits on a ZFS dataset.
Here’s what I’m trying to do:
- Create a snapshot of the ZFS dataset
- Mount this snapshot to
/var/lib/mysql1 - Set proper ownership with
chown mysql:mysql - Update the datadir configuration to point to
/var/lib/mysql1 - Restart the MySQL service
However, MySQL won’t start with the new datadir pointing to the snapshot. It only works when I change the datadir back to the original /var/lib/mysql path.
I’m using InnoDB as the storage engine. What am I overlooking here?
My goal is to set up automated hourly snapshots that I can transfer to a backup server via SSH for redundancy purposes.