# MYSQL files occupied whole disk, which file to delete to recover

**URL:** <https://forum.virtualmin.com/t/mysql-files-occupied-whole-disk-which-file-to-delete-to-recover/116374>\
**Category:** Webmin\
**Created:** [August 7, 2022, 2:57pm UTC](https://forum.virtualmin.com/t/mysql-files-occupied-whole-disk-which-file-to-delete-to-recover/116374 "2022-08-07T14:57:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![iauth](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/i/8491ac/32.png) [@iauth](https://forum.virtualmin.com/u/iauth)\
**Post date:** [August 7, 2022, 2:57pm UTC](https://forum.virtualmin.com/t/mysql-files-occupied-whole-disk-which-file-to-delete-to-recover/116374/1 "2022-08-07T14:57:05Z")

</div>

| SYSTEM INFORMATION | |
| --- | --- |

Ubuntu 20.04  
Webmin 1.994  
RAM: 1GB  
vCPU: 1

My Webmin displayed an error message saying the disk is full. Upon investigation, I found 3 files inside  
` /var/lib/mysql` has grown too big.

1. mysql.ibd (8.8G)
2. undo\_001 (8.4G)
3. undo\_003 (2.5G)  
I googled to check whether these files can be removed (rm) but the suggestion was against mysql.ibd  
while no clear information on undo\_001 & undo\_002.  
How can I safely remove files and which one to restore to the server? As of now, 0 bytes is free, and nothing I can do on the server.  
Another question is how to prevent these files from growing so big.

Thank you

 ![webmin](https://cdn.forum.virtualmin.com/uploads/default/original/2X/7/7112000a940c5ecdec78edbb64207e2e2212f017.jpeg)

---

<div class="post-metadata">

**Author:** ![vander.host](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/vander.host/32/4430_2.png) [@vander.host](https://forum.virtualmin.com/u/vander.host)\
**Post date:** [August 16, 2022, 10:18am UTC](https://forum.virtualmin.com/t/mysql-files-occupied-whole-disk-which-file-to-delete-to-recover/116374/2 "2022-08-16T10:18:56Z")

</div>

Man I wish I documented this problem. I only had it once and after quite a bit of Googling I managed to fix it. One of my network admin friends just called me with a fresh installation of Virtualmin and he has the same problem. Now he can’t even start MySQL anymore.

---

<div class="post-metadata">

**Author:** ![jimr1](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/jimr1/32/14173_2.png) [@jimr1](https://forum.virtualmin.com/u/jimr1)\
**Post date:** [August 16, 2022, 10:41am UTC](https://forum.virtualmin.com/t/mysql-files-occupied-whole-disk-which-file-to-delete-to-recover/116374/3 "2022-08-16T10:41:15Z")

</div>

this may help [https://dba.stackexchange.com/questions/142653/mysql-ibd-file-is-too-big](https://dba.stackexchange.com/questions/142653/mysql-ibd-file-is-too-big)

---

<div class="post-metadata">

**Author:** ![vander.host](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/vander.host/32/4430_2.png) [@vander.host](https://forum.virtualmin.com/u/vander.host)\
**Post date:** [August 16, 2022, 11:09am UTC](https://forum.virtualmin.com/t/mysql-files-occupied-whole-disk-which-file-to-delete-to-recover/116374/4 "2022-08-16T11:09:09Z")

</div>

Thanks @jimr1 ,

That post has no accepted answer yet on stack, and seems to refer to the generic growth of a table. I think what our user was dealing with is rather a bug or something, but either way, he seems to have reverted to stack and gotten an accepted answer here:

> <https://askubuntu.com/questions/1422399/undo-000-files-are-occupying-most-of-the-disk-can-i-remove-them>

To me it looks like this sequence might do the job, provided you still have control over your database:

```auto
ALTER UNDO TABLESPACE tablespace_name SET INACTIVE;
DROP UNDO TABLESPACE tablespace_name;
SET GLOBAL innodb_undo_log_truncate=ON;

```

---

<div class="post-metadata">

**Author:** ![system](https://cdn.forum.virtualmin.com/uploads/default/original/2X/c/cd96d761e326db4b2bef94886a639109bd7a8e76.svg) [@system](https://forum.virtualmin.com/u/system)\
**Post date:** [October 15, 2022, 11:09am UTC](https://forum.virtualmin.com/t/mysql-files-occupied-whole-disk-which-file-to-delete-to-recover/116374/5 "2022-10-15T11:09:29Z")

</div>

Closed on October 15, 2022, 11:09am UTC

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