<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[HOWTO: Remove SWAP post-install and resize &#x2F;]]></title><description><![CDATA[<p dir="auto">Hi all,</p>
<p dir="auto">I managed to install 2.3.2 on a 1GB Compactflash.</p>
<p dir="auto">Due to the ammount of RAM in the system, the SWAP partition is not needed.</p>
<p dir="auto">For those of you who forgot to disable SWAP during setup or moved to SSD later or for what ever reason this should be handy …</p>
<p dir="auto">get ssh and connect to box / or via console</p>
<p dir="auto">STEP ONE: Get your disk info:</p>
<pre><code>/root: gpart show ada0
=&gt;     63  1989729  ada0  MBR  (972M)
       63  1989729     1  freebsd  [active]  (972M)

</code></pre>
<p dir="auto">my cf card is rec. as the only IDE dev so ada0</p>
<p dir="auto">in slice 1 of the UFS we can find the / of pfSense:</p>
<pre><code>/root: gpart show ada0s1
=&gt;      0  1989729  ada0s1  BSD  (972M)
        0       16          - free -  (8.0K)
       16  1989713       1  freebsd-ufs  (972M)
       1234 5678          2  swap~  (123MB)

</code></pre>
<pre><code>/root: df -h
Filesystem      Size    Used   Avail Capacity  Mounted on
/dev/ada0s1a    937M    593M    268M    69%    /
devfs           1.0K    1.0K      0B   100%    /dev
/dev/md0        3.4M    112K    3.0M     3%    /var/run
devfs           1.0K    1.0K      0B   100%    /var/dhcpd/dev

</code></pre>
<p dir="auto">see that / has the same size as slice 1 :</p>
<pre><code>63  1989729     1  freebsd  [active]  (972M)
/dev/ada0s1a    937M    593M    268M    69%    /

</code></pre>
<p dir="auto">STEP TWO: ok … so we need to disable swap ...<br />
(i know we can do by swapof but i think this is fine either... )</p>
<pre><code>/root: edit /etc/fstab

</code></pre>
<p dir="auto">in fstab comment the line with ~swap~  by adding a # at the beginning</p>
<p dir="auto">like this:</p>
<pre><code># Device                Mountpoint      FStype  Options         Dump    Pass#
/dev/ada0s1a            /               ufs     rw              1       1
#/dev/label/swap0               none            swap    sw              0      0
</code></pre>
<p dir="auto">note that in pfSense default fstab the / partition is mounted by ufsid<br />
… better change that now to ada0s1 or where ever your / partition is hanging around ...</p>
<p dir="auto">otherwise later after resizing of the slize the ufsid changes and pfSense will hang in boot...</p>
<p dir="auto">Reboot...</p>
<p dir="auto">After reboot u can see that there is no swap in top:</p>
<pre><code>/root:top

last pid: 61459;  load averages:  0.00,  0.05,  0.12    up 0+00:38:53  02:17:44
43 processes:  1 running, 42 sleeping
CPU:  0.0% user,  0.0% nice,  1.2% system,  2.0% interrupt, 96.9% idle
Mem: 45M Active, 36M Inact, 54M Wired, 43M Buf, 8228M Free
Swap:

</code></pre>
<p dir="auto">STEP THREE: ok so now let's delete the SWAP partition…</p>
<pre><code>/root: gpart delete ada0s1b
---bla bla deleted...

</code></pre>
<p dir="auto">it is ada0s1b because it is the second sub(is that the correct word ?)  in slice 1 in ada0:</p>
<pre><code>
=&gt;      0  1989729  ada0s1  BSD  (972M)
        0       16          - free -  (8.0K)
       16  1989713       1  freebsd-ufs  (972M)
       1234 5678          2  swap~  (123MB)

</code></pre>
<p dir="auto">after that we can resize the /</p>
<p dir="auto">we wanna resize to maximum capacity so we dont need <em>-s</em> param. Otherwise u could specify the final size by eg. <em>-s 4GB</em><br />
-i is index of / … so in our example 1</p>
<pre><code>/root: gpart resize -i 1 (-s 4GB) ada0s1
</code></pre>
<p dir="auto">after that we can resize our filesystem by doing:</p>
<pre><code>growfs /dev/ada0s1
yes

bla bla warning bla bla... 
done...
</code></pre>
<p dir="auto">now you have the new filesystem size….</p>
<p dir="auto">you can show it in dashboard or in # by</p>
<pre><code>/root: df -h
</code></pre>
<p dir="auto">please feel free to leave a comment if sth is wrong or u know it better …<br />
also if you have any questions or sth. ...<br />
Sorry 4 my english... it's my second language ...</p>
<p dir="auto">Greets</p>
<p dir="auto">Chris</p>
]]></description><link>https://forum.netgate.com/topic/107375/howto-remove-swap-post-install-and-resize</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Mar 2026 11:42:18 GMT</lastBuildDate><atom:link href="https://forum.netgate.com/topic/107375.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 02 Nov 2016 01:30:21 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to HOWTO: Remove SWAP post-install and resize &#x2F; on Sun, 13 Apr 2025 13:07:34 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jazzl0ver">@<bdi>jazzl0ver</bdi></a> Awesome, thanks <img src="https://forum.netgate.com/assets/plugins/nodebb-plugin-emoji/emoji/android/1f3af.png?v=d0a5ddc94ac" class="not-responsive emoji emoji-android emoji--dart" style="height:23px;width:auto;vertical-align:middle" title=":dart:" alt="🎯" /></p>
<p dir="auto">[root@gw-2 ~]# /sbin/glabel label swap0 /dev/blabla</p>
<p dir="auto">was exactly the part which I have been missing <img src="https://forum.netgate.com/assets/plugins/nodebb-plugin-emoji/emoji/android/1f3f7.png?v=d0a5ddc94ac" class="not-responsive emoji emoji-android emoji--label" style="height:23px;width:auto;vertical-align:middle" title=":label:" alt="🏷" /></p>
<p dir="auto">And why:</p>
<p dir="auto">[root@gw-2 ~]# glabel list</p>
<p dir="auto">Didn't showed me anything <img src="https://forum.netgate.com/assets/plugins/nodebb-plugin-emoji/emoji/android/1f511.png?v=d0a5ddc94ac" class="not-responsive emoji emoji-android emoji--key" style="height:23px;width:auto;vertical-align:middle" title=":key:" alt="🔑" /></p>
]]></description><link>https://forum.netgate.com/post/1212167</link><guid isPermaLink="true">https://forum.netgate.com/post/1212167</guid><dc:creator><![CDATA[zewl23]]></dc:creator><pubDate>Sun, 13 Apr 2025 13:07:34 GMT</pubDate></item><item><title><![CDATA[Reply to HOWTO: Remove SWAP post-install and resize &#x2F; on Thu, 05 Oct 2023 06:36:53 GMT]]></title><description><![CDATA[<p dir="auto">Just the refreshment (based on this thread and on https://unix.stackexchange.com/questions/117023/expanding-the-disk-size-on-pfsense-under-vmware-esxi). pfSense is a Proxmox VM, virtual hard drive is virtio0.</p>
<pre><code>[root@gw-2 ~]# swapoff -a
swapoff: removing /dev/label/swap0 as swap device

[root@gw-2 ~]# df -h /
Filesystem                     Size    Used   Avail Capacity  Mounted on
/dev/ufsid/59d3a17dccecce22    2.9G    2.5G    180M    93%    /

[root@gw-2 ~]# gpart show
=&gt;     63  8388545  vtbd0  MBR  (4.0G)
       63  8388513      1  freebsd  [active]  (4.0G)
  8388576       32         - free -  (16K)

=&gt;      0  8388513  vtbd0s1  BSD  (4.0G)
        0       16           - free -  (8.0K)
       16  6291345        1  freebsd-ufs  (3.0G)
  6291361  2097152        2  freebsd-swap  (1.0G)
</code></pre>
<p dir="auto">After the virtual drive expansion (added 2G in the Proxmox interface):</p>
<pre><code>[root@gw-2 ~]# gpart show
=&gt;      63  12582849  vtbd0  MBR  (6.0G)
        63   8388513      1  freebsd  [active]  (4.0G)
   8388576   4194336         - free -  (2.0G)

=&gt;      0  8388513  vtbd0s1  BSD  (4.0G)
        0       16           - free -  (8.0K)
       16  6291345        1  freebsd-ufs  (3.0G)
  6291361  2097152        2  freebsd-swap  (1.0G)

[root@gw-2 ~]# gpart resize -i 1 vtbd0
vtbd0s1 resized
[root@gw-2 ~]# gpart show
=&gt;      63  12582849  vtbd0  MBR  (6.0G)
        63  12582849      1  freebsd  [active]  (6.0G)

=&gt;       0  12582849  vtbd0s1  BSD  (6.0G)
         0        16           - free -  (8.0K)
        16   6291345        1  freebsd-ufs  (3.0G)
   6291361   6291488           - free -  (3.0G)

[root@gw-2 ~]# gpart resize -i 1 -s 5GB vtbd0s1
vtbd0s1a resized
[root@gw-2 ~]# gpart show
=&gt;      63  12582849  vtbd0  MBR  (6.0G)
        63  12582849      1  freebsd  [active]  (6.0G)

=&gt;       0  12582849  vtbd0s1  BSD  (6.0G)
         0        16           - free -  (8.0K)
        16  10485760        1  freebsd-ufs  (5.0G)
  10485776   2097073           - free -  (1.0G)

[root@gw-2 ~]# growfs /dev/ufsid/59d3a17dccecce22
Device is mounted read-write; resizing will result in temporary write suspension for /.
It's strongly recommended to make a backup before growing the file system.
OK to grow filesystem on /dev/ufsid/59d3a17dccecce22, mounted on /, from 3.0GB to 5.0GB? [yes/no] yes
super-block backups (for fsck_ffs -b #) at:
 6411392, 7693632, 8975872, 10258112

[root@gw-2 ~]# df -h /
Filesystem                     Size    Used   Avail Capacity  Mounted on
/dev/ufsid/59d3a17dccecce22    4.8G    2.5G    1.9G    56%    /

[root@gw-2 ~]# gpart add -t freebsd-swap vtbd0s1
vtbd0s1b added
[root@gw-2 ~]# /sbin/glabel label swap0 /dev/vtbd0s1b
[root@gw-2 ~]# swapon -a
swapon: adding /dev/label/swap0 as swap device
</code></pre>
]]></description><link>https://forum.netgate.com/post/1128465</link><guid isPermaLink="true">https://forum.netgate.com/post/1128465</guid><dc:creator><![CDATA[jazzl0ver]]></dc:creator><pubDate>Thu, 05 Oct 2023 06:36:53 GMT</pubDate></item><item><title><![CDATA[Reply to HOWTO: Remove SWAP post-install and resize &#x2F; on Sun, 11 Dec 2016 10:47:22 GMT]]></title><description><![CDATA[<p dir="auto">Notes:</p>
<ul>
<li>You could (and probably should) use /usr/local/sbin/ufslabels.sh to switch /etc/fstab to using the labels again after you are done.</li>
<li>Using /etc/rc.d/growfs from single user mode would probably take care of everything once you've nuked the swap partition.</li>
</ul>
]]></description><link>https://forum.netgate.com/post/666483</link><guid isPermaLink="true">https://forum.netgate.com/post/666483</guid><dc:creator><![CDATA[doktornotor]]></dc:creator><pubDate>Sun, 11 Dec 2016 10:47:22 GMT</pubDate></item><item><title><![CDATA[Reply to HOWTO: Remove SWAP post-install and resize &#x2F; on Sun, 11 Dec 2016 10:13:21 GMT]]></title><description><![CDATA[<p dir="auto">Small remarks:</p>
<p dir="auto">1. fstab now using ufsid addressing, so instead of /dev/ada0s1a I see /dev/ufsid/blablabla. Replace it with correct string - /dev/ada0s1a cause successful boot.<br />
2. gpart delete ada0s1b return "<em>Option 'i' not specified</em>", so I need to gpart show and make this coomand - gpart delete -i 2 /dev/ada0s1<br />
3. Command growfs /dev/ada0s1 return "<em>superblock not recognized</em>", so I replace command with growfs /dev/ada0s1a</p>
<p dir="auto">After that, my swap come part of / and usage decreased form 99 to 73 percent.</p>
<p dir="auto">Big thanks for this great HOW-TO</p>
]]></description><link>https://forum.netgate.com/post/666482</link><guid isPermaLink="true">https://forum.netgate.com/post/666482</guid><dc:creator><![CDATA[hAh0L13]]></dc:creator><pubDate>Sun, 11 Dec 2016 10:13:21 GMT</pubDate></item></channel></rss>