Shrink UFS and ZFS to their bare minimum

Started by verfluchten, May 15, 2025, 04:40:07 PM

Previous topic - Next topic
By default, OS installs to full disk, which is sub-optimal.
Is there a way to do the opposite of https://forum.opnsense.org/index.php?topic=19250.0 and shrink all of the partitions to their bare minimum?

I have this currently and no faintest idea how to shrink it:


2% / [zfs] (1.1G/64G)
0% /var/log [zfs] (1.8M/63G)
0% /zroot [zfs] (88K/63G)
0% /tmp [tmpfs] (408K/10G)
0% /var/crash [zfs] (88K/63G)
0% /usr/home [zfs] (88K/63G)
0% /var/audit [zfs] (88K/63G)
0% /usr/ports [zfs] (104M/63G)
0% /var/mail [zfs] (112K/63G)
0% /var/tmp [zfs] (88K/63G)
0% /usr/src [zfs] (88K/63G)
0% /tmp [tmpfs] (408K/10G)

What should the procedure be?

Most filesystems support growing at best, I know that ZFS does not support shrinking.

You could backup your configuration, reinstall using advanced options and partition to your own liking.

Restore your configuration afterwards and you should be set.
Intel N100, 4 x I226-V, 16 GByte, 256 GByte NVME, ZTE F6005

1100 down / 800 up, Bufferbloat A+

You can actually grab/restore the full content of the /conf directory if you use the importer during install.
This said, configuration for other plugins is another matter... I just moved from virtualized to bare metal.

I'm wondering which part of "the installer will use the entire disk" is unclear, but that's besides the point.

If you have ZFS you can reallocate space to anywhere you like and even clamp down on the existing root file system if you think it uses too much.

Again, you didn't know what you wanted during install (which allows fine-tuning the disk layout and space use in the non-guided variants) and now you also don't say what you want to do with the space. You don't even say if this is HW or a VM. In the latter case maybe you try to salvage host space but then also why not give the host a smaller disk in the first place.

A lot of speculation here, but hopefully an insight into what we're missing here in context.


Cheers,
Franco