MariaDB keeps waking up HDD

Creating a bug report/issue

I have searched the existing open and closed issues

Required Information

  • DietPi version |
    G_DIETPI_VERSION_CORE=9
    G_DIETPI_VERSION_SUB=1
    G_DIETPI_VERSION_RC=1
    G_GITBRANCH=‘master’
    G_GITOWNER=‘MichaIng’
    G_LIVE_PATCH_STATUS[0]=‘not applicable’
  • Distro version |
    bookworm 0
  • Kernel version |
    Linux DietPi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux
  • Architecture |
    arm64
  • SBC model |
    RPi 4 Model B (aarch64)
  • Power supply used |
    raspberry power supply
  • SD card used |
    SanDisk ultra 32GB

Additional Information (if applicable)

  • Software title |
    MariaDB (in use with Nextcloud)
  • Was the software title installed freshly or updated/migrated?
    fresh installed
  • Can this issue be replicated on a fresh installation of DietPi?
    I guess it is an expected behavior but it is periodic (every ~4-5min
  • Bug report ID |
    not really a bug

Steps to reproduce

I used iotop to track r/w actions on ext. drive. MariaDB is waking up HDD

Extra details

So I signed up here becaus I have the problem, that MariaDB keeps waking up my HDD.
Setup:
I installed Nextcloud and mounted my ext. drive with the drive manager.
I moved the User Data to my mounted HDD with the DietPi Software launcher.
Spindown is set to 4 min. The drive is also spinning down like intended, but shortly after starts spinning again.
Like I saoid a used iotop to see what is using the HDD and found MariaDB accessing it
So I´m pretty sure this is a intended behavior.
I guess the best would be to move the Data back to the SD and only move Nextcloud data to the HDD.
What would be the simplest solution for this one?
Help is very much appreciated, because i´m not yet that familiar with linux :slight_smile:

You could try to move only database repository to SD card as it is a symbolic link anyhow :slight_smile:

Could you tune MariaDB to allocate more RAM before writing to the database?

thank you for your both recommendations, but I would need a little bit more explanation :slight_smile:
I´m not yet that familiar with linux.
I was searching a little bit in the file structure but could neiter find the database resporitoty (or did find it and was not aware :D), nor did I find the MariaDB ini file where to increase the RAM usage.

MariaDB database directory is located at /var/lib/mysql. However this is a link to your dietpi_userdata. Should looks like this.

root@DietPiOPi5:~# ls -la /var/lib/mysql
lrwxrwxrwx 1 root root 26 Feb 25 21:08 /var/lib/mysql -> /mnt/dietpi_userdata/mysql
root@DietPiOPi5:~#

What you can do is to stop all services and move /mnt/dietpi_userdata/mysql to your SD card. Before we should do a backup of the DB folder, like this :smiley:

dietpi-services stop
cp -a /mnt/dietpi_userdata/mysql/ /mnt/dietpi_userdata/mysql_backup/
rm /var/lib/mysql
cp -a /mnt/dietpi_userdata/mysql/ /var/lib/mysql/
dietpi-services start
1 Like

Worked perfect, thank you for your quick Help👍🏻

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.