6.2. Optimizing the file system

To be able to optimize your file system (fs), create a separate partition for SQL database. CFI software enables you to create a filesystem and you can also specify how this fs is going to be used.

[Caution]Caution
Please, verify the partion is optimally aligned.

You can check partion alignment via the follwoing commands:

We can recommend using the following parameters for making ext4 fs:

After the fs creation, you have to mount this fs. Please use the following configuration in the /etc/fstab file:

/dev/sda3 /var/lib/mysql ext4 defaults,errors=remount-ro,noatime 0 1

We suppose that SQL partition will be sda3, but replace sda3 with your disk partition. If you do not need to know when files were last accessed (which is not really useful on a database server), you can mount your filesystems with the noatime option. That skips updates to the last access time in inodes on the filesystem, which avoids some disk seeks.

[Caution]Caution
If you are creating a partition after installing MySQL server, you need to move the MySQL system files from the directory /var/lib/mysql to a new partition. Don't forget to set the correct file attributes.