<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Xcp_ng on ~/kd8bny</title>
    <link>https://kd8bny.com/tags/xcp_ng/</link>
    <description>Recent content in Xcp_ng on ~/kd8bny</description>
    <generator>Hugo</generator>
    <language>en</language>
    <copyright>Daryl Bennett. All Rights Reserved.</copyright>
    <lastBuildDate>Fri, 15 Aug 2025 10:59:34 -0500</lastBuildDate>
    <atom:link href="https://kd8bny.com/tags/xcp_ng/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Modifying Virtual Disk Partitions &amp; Intro to Xen Orchestra</title>
      <link>https://kd8bny.com/posts/xen_disks_intro/</link>
      <pubDate>Fri, 15 Aug 2025 10:59:34 -0500</pubDate>
      <guid>https://kd8bny.com/posts/xen_disks_intro/</guid>
      <description>&lt;h2 id=&#34;intro&#34;&gt;intro&lt;/h2&gt;&#xA;&lt;p&gt;When I started this blog the idea has been this is a place to not just write about anything but to walk through problems. This post will walk through an issue where I was out of disk space on a virtual hard disk and how to expand it and bring it back online. If you&amp;rsquo;d rather skip over my story jump to &lt;a href=&#34;https://kd8bny.com/posts/xen_disks_intro/#tl-dr&#34;&gt;tl;dr&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-problem&#34;&gt;the problem&lt;/h2&gt;&#xA;&lt;p&gt;In my home lab I use a self-hosted GitLab instance to automate my infrastructure management. Generally my infrastructure is made up of a handful of bare VMs running docker and host docker compose configurations. vgose, a VM which hosts my GitLab instance, was no exception. However, I committed a crime in its deployment.&#xA;Against the well documentation recommendations and best practices I configured the GitLab runner execution on the same VM. But hey this is a home lab, not a production with hundreds to thousands of users, just me. It would be more effort to maintain a whole other runner vm for the few times a pipeline kicks off.&lt;/p&gt;&#xA;&lt;p&gt;Well, lumping these configurations together led to the GitLab runner service pulling new images for docker and ran my default template 120G drive out of space. So naturally I noticed as runner jobs were beginning to fail without much reason. The easiest way to determine available space is using &lt;code&gt;df -h&lt;/code&gt; and you can see the results says root mount &lt;code&gt;/&lt;/code&gt; is at 100%. Whomp.&lt;/p&gt;&#xA;&lt;p&gt;&lt;figure&gt;&lt;img src=&#34;https://kd8bny.com/posts/xen_disks_intro/df_a.png&#34;&#xA;    alt=&#34;disk free&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;p&gt;disk free&lt;/p&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;img src=&#34;https://kd8bny.com/posts/xen_disks_intro/df_a.png&#34; alt=&#34;test&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;I tried a desperate attempt to clear &lt;code&gt;/tmp&lt;/code&gt; and &lt;code&gt;/var/log/&lt;/code&gt; for some wiggle room. But as you can see, it&amp;rsquo;s the running GitLab container that was taking up the space with its overlay volumes. No problem though, this VM has a special purpose it deserves a little more room.&lt;/p&gt;&#xA;&lt;h2 id=&#34;make-it-more-big&#34;&gt;make it more big&lt;/h2&gt;&#xA;&lt;p&gt;So the first thing is let&amp;rsquo;s expand the disk size. Using XOA this part is easy by just changing the number in the disk list for the VM. This however won&amp;rsquo;t make any more space available without any edits to the disk partition table. A partition table, generally, is a logical method to compartment disks physical sectors.&lt;/p&gt;&#xA;&lt;p&gt;&lt;figure&gt;&lt;img src=&#34;https://kd8bny.com/posts/xen_disks_intro/xoa_disks_mounts_a.png&#34;&#xA;    alt=&#34;disk free&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;p&gt;disk free&lt;/p&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;img src=&#34;https://kd8bny.com/posts/xen_disks_intro/xoa_disks_mounts_a.png&#34; alt=&#34;test&#34;&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;tangent&#34;&gt;&amp;lt;tangent&amp;gt;&lt;/h3&gt;&#xA;&lt;p&gt;The partition table is basically an index of start and stop positions aligned to drive sectors which set the bounds of what can be used.&lt;/p&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s use some ASCII to visualize.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;                    |      mah&amp;#39; data     |&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;                    |   filesystem 1..n  |&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;|  partition table  |    partition 1..n  |&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;|        physical drive sectors          |&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;So basically, your data lives on the filesystem, the filesystem lives on the partition, and your partition lives on the drive. There are systems that add an abstraction layer between the partition and filesystem like Logical Volume Manager (LVM). LVM is actually really nice and resolves many of the issues I have here… alas my system is not configured as such.&lt;/p&gt;&#xA;&lt;p&gt;&amp;lt;/tangent&amp;gt;&lt;/p&gt;&#xA;&lt;p&gt;So let&amp;rsquo;s make some edits to our disk. Since we are going to mess with the partition structure we need to make sure that the disk isn&amp;rsquo;t mounted. The easiest way to do this is to boot up with your favorite ISO. If available you can choose a recovery mode during bootloader selection. My favorite ISO for most things is the latest monthly build of Arch and I have it handy in my XOA storage repository.&lt;/p&gt;&#xA;&lt;figure&gt;&lt;img src=&#34;https://kd8bny.com/posts/xen_disks_intro/xoa_sr.png&#34;&#xA;    alt=&#34;disk free&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;p&gt;disk free&lt;/p&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;!-- ![test](xoa_sr.png) --&gt;&#xA;&lt;p&gt;In XOA mounting an ISO is easy on the fly. Under the disk tab choose your image. Don&amp;rsquo;t forget to change your boot order, which can be completed in the advanced tab.&lt;/p&gt;&#xA;&lt;figure&gt;&lt;img src=&#34;https://kd8bny.com/posts/xen_disks_intro/xoa_boot_order.png&#34;&#xA;    alt=&#34;disk free&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;p&gt;disk free&lt;/p&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;!-- ![test](xoa_disks_mounts.png) --&gt;&#xA;&lt;p&gt;Proof we&amp;rsquo;re booted up, we got bash and Arch is running.&lt;/p&gt;&#xA;&lt;figure&gt;&lt;img src=&#34;https://kd8bny.com/posts/xen_disks_intro/iso_boot.png&#34;&#xA;    alt=&#34;disk free&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;p&gt;disk free&lt;/p&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;!-- ![test](iso_boot.png) --&gt;&#xA;&lt;h3 id=&#34;parted&#34;&gt;parted&lt;/h3&gt;&#xA;&lt;p&gt;Now it&amp;rsquo;s time to do some damage. Literally. Messing with disk partitions is probably the most risky this you can do.&lt;/p&gt;&#xA;&lt;p&gt;Make a snapshot. Do not pass go. Really.&lt;/p&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s use &lt;code&gt;parted&lt;/code&gt;. fdisk Is also a fan favorite, but I normally head for parted. Once you&amp;rsquo;re interactive, use &lt;code&gt;help&lt;/code&gt; for the various commands available. Use &lt;code&gt;print&lt;/code&gt; to see your disks and partitions available.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;#parted&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;(parted) print&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In this system we only have 1 disk and 3 partitions. Partition 1 looks like our root and 5 is our swap.&lt;/p&gt;&#xA;&lt;p&gt;Note: I personally have no idea why the Debian installer configured it this way.&lt;/p&gt;&#xA;&lt;figure&gt;&lt;img src=&#34;https://kd8bny.com/posts/xen_disks_intro/parted_print.png&#34;&#xA;    alt=&#34;disk free&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;p&gt;disk free&lt;/p&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;!-- ![test](parted_print.png) --&gt;&#xA;&lt;p&gt;Well parted offers a &lt;code&gt;resizepart&lt;/code&gt; command, let&amp;rsquo;s give it a shot. Resize the partition 1 to the full size of the available space on the disk.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;resizepart &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt; 100%&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;figure&gt;&lt;img src=&#34;https://kd8bny.com/posts/xen_disks_intro/parted_overlap.png&#34;&#xA;    alt=&#34;disk free&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;p&gt;disk free&lt;/p&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;!-- ![test](parted_overlap.png) --&gt;&#xA;&lt;p&gt;Huh, well then… Can&amp;rsquo;t overlap a partition eh?&lt;/p&gt;&#xA;&lt;p&gt;So basically this is saying parted can&amp;rsquo;t resize partition 1 to maximize the space because it would overlap partition 2 and 5. It&amp;rsquo;s not that parted isn&amp;rsquo;t smart enough to do something like that, it&amp;rsquo;s not. But it&amp;rsquo;s more of moving a partition would require moving all the data in the filesystem to new sectors on the drive as your setting a new start and stop point for the moving partitions which is very risky and complex. So we just can&amp;rsquo;t do that, not here anyway.&lt;/p&gt;&#xA;&lt;p&gt;Taking a look at the partition table again. Partition 5 is swap with no critical data. Partition 2 looks kinda fishy. It has no filesystem, its extended, and it&amp;rsquo;s only 1GB in size. Usually a partition in a similar slot could be boot which mounts to &lt;code&gt;/boot&lt;/code&gt;, but the flag isn&amp;rsquo;t set, and it&amp;rsquo;s far too small. Let&amp;rsquo;s try to mount it 🤷‍♂️&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;$mkdir&lt;/span&gt; &amp;lt; temp dir &amp;gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;#mount &amp;lt;/dev/deviceZN&amp;gt; &amp;lt;temp dir&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;wth I can&amp;rsquo;t even mount it.&lt;/p&gt;&#xA;&lt;figure&gt;&lt;img src=&#34;https://kd8bny.com/posts/xen_disks_intro/1_parted_mount.png&#34;&#xA;    alt=&#34;ope cant mount&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;p&gt;ope can&amp;rsquo;t mount&lt;/p&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;!-- ![test](1_parted_mount.png) --&gt;&#xA;&lt;p&gt;&lt;em&gt;Note: Ignore my type fat mount attempts at the time I thought it was a boot partition till I noticed the size.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;investigation&#34;&gt;investigation&lt;/h3&gt;&#xA;&lt;p&gt;A&amp;rsquo;ight, so what options do we have?&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;I can make a new disk with more space and copy the data over&lt;/li&gt;&#xA;&lt;li&gt;Let&amp;rsquo;s dig into this partition table and see if we can shift partition 2 and 5 to extend 1.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Going with plan 2 because I&amp;rsquo;m lazy, its interesting, and I have a recent snapshot of the disk. Let&amp;rsquo;s go!&lt;/p&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s take a look at &lt;code&gt;fstab&lt;/code&gt; and &lt;code&gt;blkid&lt;/code&gt; to dig in some more. The tmux top pane showing &lt;code&gt;/etc/fstab&lt;/code&gt; shows that Debian doesn&amp;rsquo;t even mount this partition on boot. Furthermore, I. The bottom pane we can see that the bootloader is on partition 1 when we mount it and partition 2 isn&amp;rsquo;t even listed in &lt;code&gt;blkid&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;figure&gt;&lt;img src=&#34;https://kd8bny.com/posts/xen_disks_intro/2_fstab.png&#34;&#xA;    alt=&#34;fstab lookaround&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;p&gt;fstab lookaround&lt;/p&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;!-- ![test](2_fstab.png) --&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s try &lt;code&gt;fdisk&lt;/code&gt; to see if any more information is available on partition 2. In which we find nothing more useful.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Determination:&lt;/strong&gt; I&amp;rsquo;m 98.89% sure there is nothing on partition 2 worth saving. Let&amp;rsquo;s delete it and resize the data partition 1.&lt;/p&gt;&#xA;&lt;figure&gt;&lt;img src=&#34;https://kd8bny.com/posts/xen_disks_intro/3_parted_sol.png&#34;&#xA;    alt=&#34;parted view&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;p&gt;parted view&lt;/p&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;!-- ![test](3_parted_sol.png) --&gt;&#xA;&lt;figure&gt;&lt;img src=&#34;https://kd8bny.com/posts/xen_disks_intro/4_part_tree.png&#34;&#xA;    alt=&#34;parted view 2&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;p&gt;parted view 2&lt;/p&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;!-- ![test](4_part_tree.png) --&gt;&#xA;&lt;h2 id=&#34;start-the-partitions&#34;&gt;start the partitions&lt;/h2&gt;&#xA;&lt;p&gt;First let&amp;rsquo;s begin by removing partition 2 and 5 with &lt;code&gt;rm&lt;/code&gt;&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;#parted&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;parted&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt; print&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;parted&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt; rm &lt;span class=&#34;m&#34;&gt;2&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;parted&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt; rm &lt;span class=&#34;m&#34;&gt;5&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;parted&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt; print&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;As you can see only partition 1 is left in the table.&lt;/p&gt;&#xA;&lt;figure&gt;&lt;img src=&#34;https://kd8bny.com/posts/xen_disks_intro/5_part1.png&#34;&#xA;    alt=&#34;part 1 survives&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;p&gt;part 1 survives&lt;/p&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;!-- ![test](5_part1.png) --&gt;&#xA;&lt;p&gt;Now we can resize partition 1, successfully this time. However, this time I don&amp;rsquo;t use 100% as I want to leave space at the end of the disk to create a new swap partition which I&amp;rsquo;m going to size at 2GB.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;parted&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt; resizepart &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt; 320GB&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;parted&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt; print&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;As you can see the partition was correctly resized to 320GB.&lt;/p&gt;&#xA;&lt;figure&gt;&lt;img src=&#34;https://kd8bny.com/posts/xen_disks_intro/6_part1_320.png&#34;&#xA;    alt=&#34;part resize&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;p&gt;part resize free&lt;/p&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;!-- ![test](6_part1_320.png) --&gt;&#xA;&lt;p&gt;Now let&amp;rsquo;s create a new swap using &lt;code&gt;mkpart&lt;/code&gt;. Issuing &lt;code&gt;mkpart&lt;/code&gt; alone will stat a series of prompts. I believe you can enter it all in one line if desired.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;mkpart - let&lt;span class=&#34;err&#34;&gt;&amp;#39;&lt;/span&gt;s make a new partition&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;primary - basic normal partition &lt;span class=&#34;nb&#34;&gt;type&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;linux-swap&lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;V1&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt; - specifies this is a swap partition&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;m&#34;&gt;320&lt;/span&gt; - size to notate the start of the partition&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;100% - fill the rest of the disk available space and end the partition&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Followed by a &lt;code&gt;print&lt;/code&gt; shows our new table with overall space increase to fill the disk. We also get a nice reminder to update &lt;code&gt;fstab&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;figure&gt;&lt;img src=&#34;https://kd8bny.com/posts/xen_disks_intro/7_parted_done.png&#34;&#xA;    alt=&#34;new partition tree&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;p&gt;new partition tree&lt;/p&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;!-- ![test](7_parted_done.png) --&gt;&#xA;&lt;h3 id=&#34;final-steps&#34;&gt;final steps&lt;/h3&gt;&#xA;&lt;h4 id=&#34;swap&#34;&gt;swap&lt;/h4&gt;&#xA;&lt;p&gt;Now that we updated our disk partitions we still need to tell the file systems that their foundation changed. Starting with swap we need to make a viable swap space.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;mkswap &amp;lt;/dev/deviceN&amp;gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Along with formatting the space this will generate an UUID in which reference the partition. We can find this UUID with &lt;code&gt;blkid&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;figure&gt;&lt;img src=&#34;https://kd8bny.com/posts/xen_disks_intro/8_new_uuid.png&#34;&#xA;    alt=&#34;new uuid&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;p&gt;new uuid&lt;/p&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;!-- ![test](8_new_uuid.png) --&gt;&#xA;&lt;p&gt;Finally, let&amp;rsquo;s update &lt;code&gt;/etc/fstab&lt;/code&gt; with our new swap UUID so that it will mount the partition on boot.&lt;/p&gt;&#xA;&lt;figure&gt;&lt;img src=&#34;https://kd8bny.com/posts/xen_disks_intro/9_new_uuid2.png&#34;&#xA;    alt=&#34;update fstab&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;p&gt;update fstab&lt;/p&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;!-- ![test](9_new_uuid2.png) --&gt;&#xA;&lt;h4 id=&#34;resize-root&#34;&gt;resize root&lt;/h4&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s boot! …annnnddd It&amp;rsquo;s alive!&lt;/p&gt;&#xA;&lt;p&gt;In this final set after booting we run a &lt;code&gt;df&lt;/code&gt; and see that our root filesystem still need to expand to this new size. Thankfully ext4 provides us &lt;code&gt;resize2fs&lt;/code&gt; to handle this. Running a &lt;code&gt;df&lt;/code&gt; again shows we have fully grown to our underlying partition size!&lt;/p&gt;&#xA;&lt;p&gt;Note: you can run &lt;code&gt;resize2fs&lt;/code&gt; while in the ISO.&lt;/p&gt;&#xA;&lt;figure&gt;&lt;img src=&#34;https://kd8bny.com/posts/xen_disks_intro/10_resize.png&#34;&#xA;    alt=&#34;fin resize part&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;p&gt;fin&lt;/p&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;!-- ![test](10_resize.png) --&gt;&#xA;&lt;h2 id=&#34;tldr&#34;&gt;tl;dr&lt;/h2&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Boot from an iso or recovery mode if available&lt;/li&gt;&#xA;&lt;li&gt;Start parted&lt;/li&gt;&#xA;&lt;li&gt;Remove non-essential partitions with rm&lt;/li&gt;&#xA;&lt;li&gt;Use resizepart to resize partition&lt;/li&gt;&#xA;&lt;li&gt;Format or extend filesystems for adjusted partitions&lt;/li&gt;&#xA;&lt;li&gt;Cross your fingers and boot!&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;</description>
    </item>
  </channel>
</rss>

