{"id":2595,"date":"2023-05-14T18:56:45","date_gmt":"2023-05-14T18:56:45","guid":{"rendered":"https:\/\/www.antpace.com\/blog\/?p=2595"},"modified":"2025-08-25T18:04:58","modified_gmt":"2025-08-25T18:04:58","slug":"diagnosing-and-resolving-disk-space-issues-on-aws-ec2-with-mariadb","status":"publish","type":"post","link":"https:\/\/www.antpace.com\/blog\/diagnosing-and-resolving-disk-space-issues-on-aws-ec2-with-mariadb\/","title":{"rendered":"Diagnosing and Resolving Disk Space Issues on AWS EC2 with MariaDB"},"content":{"rendered":"<p>I run this website on a t2.micro EC2 instance. It only has 8 gigabytes of storage space. The blog runs on WordPress. I tried creating a new post recently, but it wouldn&#8217;t let me publish.<\/p>\n<p>A vague message told me I was &#8220;editing the page that shows your latest posts&#8221; &#8211; even though I wasn&#8217;t. I checked the dashboard site health, and noticed that somethings needed updating, but disk space was critically low.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2596\" src=\"https:\/\/www.antpace.com\/blog\/wp-content\/uploads\/2024\/09\/site-health.png\" alt=\"WordPress site health\" width=\"913\" height=\"770\" \/><\/p>\n<p>I SSH&#8217;d into the instance was able to confirm that 100% of the 8 gigabytes was in use: `<span class=\"s1\">df -h`<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2597\" src=\"https:\/\/www.antpace.com\/blog\/wp-content\/uploads\/2024\/09\/cli.png\" alt=\"hardrive space\" width=\"568\" height=\"421\" \/><\/p>\n<p>I was able to use the &#8216;disk usage&#8217; command to drill down and find large directories: &#8216;sudo <span class=\"hljs-built_in\">du<\/span> -h &#8211;max-depth=1 \/var&#8217;. I was able to clean up unused\u00a0<em>yum<\/em> packages, logs, and cache to clear up over a gigabyte of space.<\/p>\n<pre>sudo journalctl --vacuum-size=100M\nsudo yum clean all\nrm -rf \/var\/cache\/yum\n<\/pre>\n<p>It looks like there are some database files that could be cleaned up too, but I&#8217;ll wait for now. I think my next course of action, when this inevitably happens again, will be to increase my disk space by expanding my EBS volume and resizing the file system.<\/p>\n<p>Playing with databases and storage can be dangerous. Make sure you always have a back-up strategy and disaster recovery plan.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I run this website on a t2.micro EC2 instance. It only has 8 gigabytes of storage space. The blog runs on WordPress. I tried creating a new post recently, but it wouldn&#8217;t let me publish. A vague message told me I was &#8220;editing the page that shows your latest posts&#8221; &#8211; even though I wasn&#8217;t. &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.antpace.com\/blog\/diagnosing-and-resolving-disk-space-issues-on-aws-ec2-with-mariadb\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Diagnosing and Resolving Disk Space Issues on AWS EC2 with MariaDB&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":3267,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[12,42,87],"class_list":["post-2595","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-web-development","tag-aws","tag-ec2","tag-mysql"],"_links":{"self":[{"href":"https:\/\/www.antpace.com\/blog\/wp-json\/wp\/v2\/posts\/2595","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.antpace.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.antpace.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.antpace.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.antpace.com\/blog\/wp-json\/wp\/v2\/comments?post=2595"}],"version-history":[{"count":1,"href":"https:\/\/www.antpace.com\/blog\/wp-json\/wp\/v2\/posts\/2595\/revisions"}],"predecessor-version":[{"id":3268,"href":"https:\/\/www.antpace.com\/blog\/wp-json\/wp\/v2\/posts\/2595\/revisions\/3268"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.antpace.com\/blog\/wp-json\/wp\/v2\/media\/3267"}],"wp:attachment":[{"href":"https:\/\/www.antpace.com\/blog\/wp-json\/wp\/v2\/media?parent=2595"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.antpace.com\/blog\/wp-json\/wp\/v2\/categories?post=2595"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.antpace.com\/blog\/wp-json\/wp\/v2\/tags?post=2595"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}