Disk space issue

Started by gmartin, Today at 03:27:57 AM

Previous topic - Next topic
I'm running 25.1.12 in a VM on proxmox v9. It's been running about 9 months without issue.  I noticed today the drive was full.  In the proxmox console, I increased the disk space to 50GB.  I was prompted in the console to run a command to accept the growth but it did not expand the file system. 
The system is showing a discrepancy between gpart and df.

I assume there is something I need to do inside to grow the fs, but growpart isn't available. Is there another tool?

(BTW, I deleted some logs to alleviate the immediate issue.)

Thanks!

root@oprouter:~ # df -h
Filesystem                   Size    Used   Avail Capacity  Mounted on
/dev/gpt/rootfs               23G     11G     10G    50%    /
devfs                        1.0K      0B    1.0K     0%    /dev
/dev/gpt/efifs               260M    1.3M    259M     1%    /boot/efi
devfs                        1.0K      0B    1.0K     0%    /var/dhcpd/dev
devfs                        1.0K      0B    1.0K     0%    /var/unbound/dev
/usr/local/lib/python3.11     23G     11G     10G    50%    /var/unbound/usr/local/lib/python3.11
/lib                          23G     11G     10G    50%    /var/unbound/lib

and
root@oprouter:~ # gpart show
=>       40  113246128  da0  GPT  (54G)
         40     532480    1  efi  (260M)
     532520       1024    2  freebsd-boot  (512K)
     533544   49798144    3  freebsd-ufs  (24G)
   50331688   16777136    4  freebsd-swap  (8.0G)
   67108824   46137344       - free -  (22G)


Have a look at a similar thread from about a week ago: https://forum.opnsense.org/index.php?topic=50436.0, the post from Maurice.
Deciso DEC740

But the instructions given there will not work for this specific setup, because the ufs partition is not the last one on the disk. The swap partition is in the way for the enlargement and has to be deleted first.
Intel N100, 4* I226-V, 2* 82559, 16 GByte, 500 GByte NVME, ZTE F6005

1100 down / 800 up, Bufferbloat A+

Good point @meyergru, I didn't notice that.
Deciso DEC740

@gmartin but do not (!) just go ahead and remove the swap partition, then use the procedure outlined by @Maurice. This will lead to a system with no swap at all. Bad idea.

Quoteroot@oprouter:~ # gpart show
=>       40  113246128  da0  GPT  (54G)
         40     532480    1  efi  (260M)
     532520       1024    2  freebsd-boot  (512K)
     533544   49798144    3  freebsd-ufs  (24G)
   50331688   16777136    4  freebsd-swap  (8.0G)
   67108824   46137344       - free -  (22G)

So from the top of my head without any guarantee it will work - go step by step and check the results before proceeding to the next one, please:

# make sure secondary GPT header is present
gpart recover da0

# disable swap - take note of the device name, e.g. "/dev/da0p4" or "/dev/gpt/swap"
swapoff -a

# remove swap partition
gpart delete -i 4 da0

# resize UFS partition
gpart resize -i 3 -s 36g da0

# recreate swap partiton - if the device in the first step was "/dev/da0p4" use this:
gpart add -i 4 -t freebsd-swap da0

# recreate swap partition - if the device in the first step was "/dev/gpt/SOMELABEL" use this:
gpart add -i 4 -t freebsd-swap -l SOMELABEL da0

# re-enable swap
swapon -a

If that worked you should have a system with 8 G of swap like before and a resized UFS partition. The last step is to resize the UFS proper.

Connect a console and reboot into single user mode. Do not mount the root partition read/write, just leave it read only (this is the normal state after entering single user mode).

fsck -y /
growfs /
df
shutdown -r now

HTH,
Patrick
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)