Choose the best disk location for your big data. This helps reduce snapshot size, eases management, and improves performance.
Database servers, container platforms, and similar software often stores big data on the root filesystem, under the /var
directory. In Kubuntu 24.04, the root filesystem is BTRFS to facilitate System Rollback. To minimize snapshot size and improve performance, we recommend storing this big data to a separate filesystem or volume.
Besides other benefits, moving this data will prevent it from being reverted when you roll back to a prior snapshot. This is almost always the desired behavior for persistent data.
Please read the disclaimer before proceeding. We review and update guided solutions regularly. If you have suggestions or requests, please write support@kfocus.org.
1. Stop the MySQL server to prevent data corruption. Then move the data and logs.
2. Configure MySQL to use the updated data and log directories.
3. Adjust AppArmor config so the MySQL server can access the data.
4. Restart the MySQL server.
5. Delete large snapshots (such as those containing the old data directory) to free up space. See these steps for guidance.
1. Stop the MariaDB server to prevent data corruption, then move the data.
2. Configure MariaDB server to use the updated data and log directories.
3. You may skip this step if you are not using the /home/
directory; otherwise, adjust the systemd config so MariaDB server can access the data.
4. Restart the MariaDB server.
5. Delete large snapshots (such as those containing the old data directory) to free up space. See these steps for guidance.
1. Stop the PostgreSQL server to prevent data corruption, then move the data.
2. Configure PostgreSQL to use the updated data directory.
3. Configure PostgreSQL to use the updated log directory.
4. Change the home directory of the postgres
user, then restart the PostgreSQL server.
5. Delete large snapshots (such as those containing the old data directory) to free up space. See these steps for guidance.
1. Stop the Docker daemon to prevent data corruption, then move the data.
2. Configure Docker to use a different data directory.
4. Restart the Docker daemon.
5. Delete large snapshots (such as those containing the old data directory) to free up space. See these steps for guidance.
Most applications that manage big data can have their data moved by relocating it to another directory, then changing a configuration file to point to it. If this is not possible, you can usually symlink the new data location to the old location.
1. Ensure the application's service is stopped. This is required to prevent data corruption.
2. Move the application's data directory (and log directory, if appliable) to the desired alternate location.
3. Symlink the new data and log directories back to the original locations.
4. Check for AppArmor sandboxing. You may need to tell AppArmor that the new data location is an alias to the old location to allow access.
5. Check for systemd sandboxing. Several systemd configuration options may limit the access an application has to the rest of the system. In particular, ProtectHome
may prevent an application from accessing files under the /home
directory.
6. Restart the application.
7. If the service fails to start, use systemctl and journalctl to see logs from the service. This data can oftentimes be used in web searches to find a fix.
8. Delete large snapshots (such as those containing the old data directory) to free up space. See these steps for guidance.
Q: Disk space on the root filesystem isn't freed up after moving big data directories. How do I reclaim the space?
A: If a snapshot was created while big data files were present on the root filesystem, it will contain a copy of those files. Deleting the snapshots using the System Rollback Dashboard will fix this. You can click [ Show Snapshot Sizes ]
in the Dashboard to identify and delete snapshots that are taking up space. After deleting snapshots, a reboot can open up more file space because it clears open file handles.
To open up more space, you can use [ Free Up Disk Space ] > [ Quick Clean ]
which will optimize disk usage. Finally, one may erase all snapshots and optimize the disk using [ Free Up Disk Space ] > [ Deep Clean ]
.
This is a partial revision history. See the git
repository for all entries.
2025-07-30 6684c321
First publicationWe try hard to provide a useful solution validated by professionals. However, we cannot anticipate every situation, and therefore cannot guarantee this procedure will work for your needs. Always backup your data and test the solution to determine the correct procedure for you.
THIS SOLUTION IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOLUTION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
HAVE QUESTIONS?Call 844-536-2871 or write
TellMeMore@kfocus.org | GET FOCUS MERCH