Contents

Opnsense update hang on fetch

Introduction

As I tied to update my OPNsense VM from version 23.7.10 to 24.1.5 via web GUI, the update got always stuck at the fetching process, without any hint what the problem could be.

So I connected to the console via SSH and tied there to update the vm, and now I got the error message “No space left on device”

1
2
3
4
5
6
Fetching packages-24.1-amd64.tar: ...............tee: /tmp/pkg_upgrade.progress: No space left on device
.tee: /tmp/pkg_upgrade.progress: No space left on device
[]tee: /tmp/pkg_upgrade.progress: No space left on device
 failed, no update found
echo: write error on stdout
A firmware action is currently in progress.

Increase disk space on VM with ZFS filesystem

1. You need to increase the space for your virtual disk\

I use Proxmox with ZFS storage, and I did not even need to reboot the VM to increase my VHD.

2. Know login as root to your OPNsense and get your partition table

1
2
3
4
5
6
7
8
# gpart show
=>      40  41942960  da0  GPT  (20G)
        40    532480    1  efi  (260M)
    532520      1024    2  freebsd-boot  (512K)
    533544       984       - free -  (492K)
    534528  16777216    3  freebsd-swap  (8.0G)
  17311744   3657728    4  freebsd-zfs  (1.7G)
  20969472  20973528       - free -  (10G)

In my example, I got one disk da0 with 4 partitions and 10G free space.

3. Resize the partition where your OPNsense is installed

1
2
3
4
5
6
7
8
9
# gpart resize -i 4 da0
da0p4 resized
# gpart show
=>      40  41942960  da0  GPT  (20G)
        40    532480    1  efi  (260M)
    532520      1024    2  freebsd-boot  (512K)
    533544       984       - free -  (492K)
    534528  16777216    3  freebsd-swap  (8.0G)
  17311744  24631256    4  freebsd-zfs  (12G)

4. Get your ZFS pool and used disk

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# zpool status
  pool: zroot
 state: ONLINE
config:

	NAME        STATE     READ WRITE CKSUM
	zroot       ONLINE       0     0     0
	  da0p4     ONLINE       0     0     0

errors: No known data errors

5. Trigger rescan ZFS pool disk

1
# zpool online -e zroot da0p4

6. Now you should have enough space to update your OPNsense

1
2
3
# zfs list /tmp
NAME        USED  AVAIL     REFER  MOUNTPOINT
zroot/tmp   744K  10.0G      744K  /tmp

I hope this could help you.

References