MySQL om ZFS

It's highly recommended to provide special containers for MySQL logs and database. Personally I'm doing somethink like this, just before start database for the first time:

zfs create zroot/var/mysql-db ; \
zfs create zroot/var/mysql-log ; \
zfs set recordsize=16k zroot/var/mysql-db ; \
zfs set atime=off zroot/var/mysql-db ; \
zfs set compression=off zroot/var/mysql-db ; \
zfs set mountpoint=/var/db/mysql zroot/var/mysql-db ; \
zfs set mountpoint=/var/log/mysql zroot/var/mysql-log ; 

Don't forget to also include following 2 mysql options

# innodb_doublewrite            = 0
# innodb_flush_method           = O_DSYNC
Share with Me via Nextcloud