<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>zfs on Kevin Heruer</title><link>/tags/zfs/</link><description>Recent content in zfs on Kevin Heruer</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Thu, 21 Jan 2021 17:05:03 +0100</lastBuildDate><atom:link href="/tags/zfs/index.xml" rel="self" type="application/rss+xml"/><item><title>Increasing Disk Size on Existing VM Disk</title><link>/posts/2021/01/21/increasing-disk-size-on-existing-vm-disk/</link><pubDate>Thu, 21 Jan 2021 17:05:03 +0100</pubDate><guid>/posts/2021/01/21/increasing-disk-size-on-existing-vm-disk/</guid><description>When you&amp;rsquo;re using your Proxmox server you might run in the problem of not having enough HDD space defined for some of your VMs, using ZFS (pools) it&amp;rsquo;s really easy to fix this.
Since all my VM disks are simple files you can easily increase their size by running the following command: bash qm resize &amp;lt;vmid&amp;gt; &amp;lt;disk&amp;gt; &amp;lt;size&amp;gt; Let&amp;rsquo;s say you have a VM with a disk named vm-100-disk-0 and you wan to increase the disk size by 100GB, you just run bash qm resize 100 vm-100-disk-0 &amp;#43;100G and you&amp;rsquo;re halfway there!</description><content>&lt;p>When you&amp;rsquo;re using your Proxmox server you might run in the problem of not having enough
HDD space defined for some of your VMs, using ZFS (pools) it&amp;rsquo;s really easy to fix this.&lt;/p>
&lt;p>Since all my VM disks are simple files you can easily increase their size by running
the following command:
&lt;div class="collapsable-code">
&lt;input id="157429683" type="checkbox" />
&lt;label for="157429683">
&lt;span class="collapsable-code__language">bash&lt;/span>
&lt;span class="collapsable-code__toggle" data-label-expand="△" data-label-collapse="▽">&lt;/span>
&lt;/label>
&lt;pre class="language-bash" >&lt;code>
qm resize &amp;lt;vmid&amp;gt; &amp;lt;disk&amp;gt; &amp;lt;size&amp;gt;
&lt;/code>&lt;/pre>
&lt;/div>
&lt;/p>
&lt;p>Let&amp;rsquo;s say you have a VM with a disk named vm-100-disk-0 and you wan to increase the disk
size by 100GB, you just run
&lt;div class="collapsable-code">
&lt;input id="582417639" type="checkbox" />
&lt;label for="582417639">
&lt;span class="collapsable-code__language">bash&lt;/span>
&lt;span class="collapsable-code__toggle" data-label-expand="△" data-label-collapse="▽">&lt;/span>
&lt;/label>
&lt;pre class="language-bash" >&lt;code>
qm resize 100 vm-100-disk-0 &amp;#43;100G
&lt;/code>&lt;/pre>
&lt;/div>
and you&amp;rsquo;re halfway there!&lt;/p>
&lt;p>Now you need to tell the VM to use the newly added space, first you need to check if
the system sees the new space by running
&lt;div class="collapsable-code">
&lt;input id="395684127" type="checkbox" />
&lt;label for="395684127">
&lt;span class="collapsable-code__language">bash&lt;/span>
&lt;span class="collapsable-code__toggle" data-label-expand="△" data-label-collapse="▽">&lt;/span>
&lt;/label>
&lt;pre class="language-bash" >&lt;code>
dmesg | grep sda
&lt;/code>&lt;/pre>
&lt;/div>
&lt;/p>
&lt;p>Now we need the right partition to add the space to, run the following to check which
partitions there are
&lt;div class="collapsable-code">
&lt;input id="594613782" type="checkbox" />
&lt;label for="594613782">
&lt;span class="collapsable-code__language">bash&lt;/span>
&lt;span class="collapsable-code__toggle" data-label-expand="△" data-label-collapse="▽">&lt;/span>
&lt;/label>
&lt;pre class="language-bash" >&lt;code>
fdisk -l /dev/sda | grep ^/dev
&lt;/code>&lt;/pre>
&lt;/div>
Remember the number /dev/sda3 for example would be 3.&lt;br>
(Just make sure you&amp;rsquo;re grepping the right device, vda is also a possibility.)&lt;/p>
&lt;p>Now run pared with the right device
&lt;div class="collapsable-code">
&lt;input id="539741826" type="checkbox" />
&lt;label for="539741826">
&lt;span class="collapsable-code__language">bash&lt;/span>
&lt;span class="collapsable-code__toggle" data-label-expand="△" data-label-collapse="▽">&lt;/span>
&lt;/label>
&lt;pre class="language-bash" >&lt;code>
parted /dev/sda
&lt;/code>&lt;/pre>
&lt;/div>
&lt;/p>
&lt;p>It will ask you to fix the unused space, enter &lt;code>F&lt;/code> for fix, then run
&lt;div class="collapsable-code">
&lt;input id="549763812" type="checkbox" />
&lt;label for="549763812">
&lt;span class="collapsable-code__language">bash&lt;/span>
&lt;span class="collapsable-code__toggle" data-label-expand="△" data-label-collapse="▽">&lt;/span>
&lt;/label>
&lt;pre class="language-bash" >&lt;code>
resizepart 3 100%
&lt;/code>&lt;/pre>
&lt;/div>
This will resize partition (sda)3 to use 100% of the newly added space.&lt;/p>
&lt;p>That&amp;rsquo;s it, no need to reboot!&lt;/p>
&lt;p>You can find a more detailed description at the source: &lt;a href="https://pve.proxmox.com/wiki/Resize_disks">https://pve.proxmox.com/wiki/Resize_disks&lt;/a>&lt;/p></content></item></channel></rss>