{"id":526,"date":"2025-05-10T08:54:59","date_gmt":"2025-05-10T16:54:59","guid":{"rendered":"https:\/\/nramkumar.org\/tech\/?p=526"},"modified":"2025-05-10T08:54:59","modified_gmt":"2025-05-10T16:54:59","slug":"shrinking-the-size-of-a-proxmox-containers-root-volume","status":"publish","type":"post","link":"https:\/\/nramkumar.org\/tech\/blog\/2025\/05\/10\/shrinking-the-size-of-a-proxmox-containers-root-volume\/","title":{"rendered":"Shrinking the size of a Proxmox Container&#8217;s Root Volume"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The easiest way to shrink the size of a Proxmox container&#8217;s root volume is to backup the container and restore it to a new container with the updated volume size. The following sequence of operations will do this &#8211; please be careful and make sure to take full backups as some of these steps will destroy the container\/configuration. Additionally, make sure that your restore volume size is at least as large as the amount of data in the container.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First, take a full backup of the container (preferably after stopping the container):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vzdump &lt;container-id> --storage &lt;backup-storage><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">After this step, your backup will be stored in some path under backup-storage and look similar to <code>\/path\/to\/backup\/vzdump-lxc-&lt;container-id>-xxxxx.tar.zst<\/code> or something along those lines. You will need this exact file for the restore step. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Next, make a backup copy of the original container configuration in case you run into issues:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cp \/etc\/pve\/lxc\/&lt;container-id>.conf \/path\/to\/backup<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">After this, destroy the original container (you will restore to this container in the next step):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pct destroy &lt;container-id><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Finally, restore from the backup to the container id:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pct restore &lt;container-id> \/path\/to\/backup\/vzdump-lxc-&lt;container-id>-xxxxx.tar.zst --storage &lt;storage> --rootfs &lt;lvm>:&lt;new root volume size in GB><\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The easiest way to shrink the size of a Proxmox container&#8217;s root volume is to backup the container and restore it to a new container with the updated volume size. The following sequence of operations will do this &#8211; please be careful and make sure to take full backups as some of these steps will&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-526","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/nramkumar.org\/tech\/wp-json\/wp\/v2\/posts\/526","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nramkumar.org\/tech\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nramkumar.org\/tech\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nramkumar.org\/tech\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nramkumar.org\/tech\/wp-json\/wp\/v2\/comments?post=526"}],"version-history":[{"count":1,"href":"https:\/\/nramkumar.org\/tech\/wp-json\/wp\/v2\/posts\/526\/revisions"}],"predecessor-version":[{"id":527,"href":"https:\/\/nramkumar.org\/tech\/wp-json\/wp\/v2\/posts\/526\/revisions\/527"}],"wp:attachment":[{"href":"https:\/\/nramkumar.org\/tech\/wp-json\/wp\/v2\/media?parent=526"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nramkumar.org\/tech\/wp-json\/wp\/v2\/categories?post=526"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nramkumar.org\/tech\/wp-json\/wp\/v2\/tags?post=526"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}