{"id":31,"date":"2023-09-18T12:18:37","date_gmt":"2023-09-18T11:18:37","guid":{"rendered":"https:\/\/thevadasan.com\/?p=31"},"modified":"2024-04-29T03:24:03","modified_gmt":"2024-04-29T02:24:03","slug":"how-to-increase-the-storage-size-of-an-lxc-container-on-proxmox","status":"publish","type":"post","link":"https:\/\/thevadasan.com\/?p=31","title":{"rendered":"How to increase the Storage size of a LXC Container on Proxmox"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<p>Are you running low on storage space in your Proxmox LXC container? Before you panic or contemplate setting up a new container, you should know that it&#8217;s entirely possible to increase the storage size of your existing LXC container. In today&#8217;s guide, I&#8217;ll walk you through the steps to do just that.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1. Always Backup First<\/strong><\/h3>\n\n\n\n<p>Before you dive into any changes, especially those related to storage, ensure that you&#8217;ve backed up your container&#8217;s data. It&#8217;s better to be safe and have a backup ready in case anything goes wrong.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2. Power Down Your Container<\/strong><\/h3>\n\n\n\n<p>For changes to take effect and to avoid potential data corruption, stop the LXC container. You can achieve this either from the Proxmox web interface or by using the following command:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\npct stop &lt;container-id&gt;\n<\/pre><\/div>\n\n\n<p>Make sure to replace <code>&lt;container-id&gt;<\/code> with your container&#8217;s unique ID.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3. Let&#8217;s Resize That Disk!<\/strong><\/h3>\n\n\n\n<p>Depending on your storage type (LVM, ZFS, or directory-based), the method to resize will vary:<\/p>\n\n\n\n<ul>\n<li><strong>For LVM Users<\/strong>: Adjust the logical volume and filesystem size using:<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n  lvresize --resizefs -L +10G \/dev\/pve\/data-&lt;container-id&gt;-disk-0\n<\/pre><\/div>\n\n\n<p>In this example, <code>+10G<\/code> will increase the size by 10GB. Feel free to tweak this value based on your requirements.<\/p>\n\n\n\n<ul>\n<li><strong>For ZFS Enthusiasts<\/strong>: Set a new quota for your container with:<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n  zfs set quota=20G &lt;pool-name&gt;\/subvol-&lt;container-id&gt;-disk-0\n<\/pre><\/div>\n\n\n<p>The <code>20G<\/code> here is an example value; replace it with your desired size.<\/p>\n\n\n\n<ul>\n<li><strong>For Directory-based Storage Lovers<\/strong>: This requires a bit more finesse. You&#8217;ll need to increase the space on the underlying file system. This might involve resizing the partition and file system or clearing up some space on the host.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>4. Power Up and Verify<\/strong><\/h3>\n\n\n\n<p>Once you&#8217;ve expanded your container&#8217;s horizons (or rather, its storage), it&#8217;s time to start it up:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">pct start &lt;container-id&gt;<\/code><\/pre>\n\n\n\n<p>With your container running, let&#8217;s make sure our changes took effect:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">pct exec &lt;container-id&gt; -- df -h \/<\/code><\/pre>\n\n\n\n<p>This command will show you the disk usage and the newly available space.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Conclusion<\/strong><\/h3>\n\n\n\n<p>Increasing storage for your Proxmox LXC container isn&#8217;t as daunting as it might first appear. With these steps, you can easily give your container the space it needs. Always remember to consult the official Proxmox documentation for the most accurate and up-to-date information. And as always, happy virtualizing!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Are you running low on storage space in your Proxmox LXC container? Before you panic or contemplate setting up a new container, you should know that it&#8217;s entirely possible to increase the storage size of your existing LXC container. In today&#8217;s guide, I&#8217;ll walk you through the steps to do just that. 1. Always Backup [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":71,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[17],"tags":[28,27],"_links":{"self":[{"href":"https:\/\/thevadasan.com\/index.php?rest_route=\/wp\/v2\/posts\/31"}],"collection":[{"href":"https:\/\/thevadasan.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thevadasan.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thevadasan.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thevadasan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=31"}],"version-history":[{"count":4,"href":"https:\/\/thevadasan.com\/index.php?rest_route=\/wp\/v2\/posts\/31\/revisions"}],"predecessor-version":[{"id":73,"href":"https:\/\/thevadasan.com\/index.php?rest_route=\/wp\/v2\/posts\/31\/revisions\/73"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thevadasan.com\/index.php?rest_route=\/wp\/v2\/media\/71"}],"wp:attachment":[{"href":"https:\/\/thevadasan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=31"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thevadasan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=31"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thevadasan.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=31"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}