OpenBSD Journal

Big news for small /usr partitions

Contributed by rueda on from the here's-a-nickel-kid dept.

Several recent commits have improved sysupgrade(8) handling of low free disk space in /usr:

Firstly, Stuart Henderson (sthen@) modified the installer to increase free space prior to installing:

CVSROOT:	/cvs
Module name:	src
Changes by:	sthen@cvs.openbsd.org	2025/11/01 06:54:17

Modified files:
	distrib/miniroot: install.sub 

Log message:
Before extracting on an upgrade, remove share/relink/*, not just
share/relink/usr/lib/*. The old files aren't useful post-upgrade and
this increases the chance of successfully extracting base*.tgz files,
so that people low on space in /usr have a better chance of getting
into the system after a reboot.

"install.sub can delete the entire relink space" deraadt@

Theo de Raadt (deraadt@) modified sysupgrade(8) so that, if space is too tight, it will fail gracefully rather than risk leaving the administrator with a broken system:

CVSROOT:	/cvs
Module name:	src
Changes by:	deraadt@cvs.openbsd.org	2025/11/11 08:14:17

Modified files:
	usr.sbin/sysupgrade: sysupgrade.sh 

Log message:
If "df /usr" says the filesystem is over 90% full, rather than
potentially completely breaking the system, fail the sysupgrade.  This
comes with a message pointing people to read a new Sub-Section PRUNING
in the manual page which will softly lead them to understand all the
nuances involved and that their best choice is to reinstall with a bigger
/usr.
script diff from florian

Theo added a "PRUNING" subsection to the sysupgrade(8) manual, with explanation and advice:

CVSROOT:	/cvs
Module name:	src
Changes by:	deraadt@cvs.openbsd.org	2025/11/11 08:18:30

Modified files:
	usr.sbin/sysupgrade: sysupgrade.8 

Log message:
First draft of a PRUNING subsection in the manual page which people
will read when sysupgrade prevents a dangerously-failing upgrade
because /usr is too full.

This explains some of the history and reasons why /usr is too full,
and also explains that sysupgrade / installer cannot delete any
detritus because it cannot identify it.  More imporatntly, users also
will have a hard time identifying the detritus -- most of it is older
lib*.so.* libraries but there's no reasonable mechanism to traverse all
possible filesystems and ensure no binaries remain which use those
libraries.

rather than telling people hacky choices that might get them through this
sysupgrade, and fail next time, we choose to provide no hacky advice.

A bigger /usr is their best choice, which implies that it is time for a reinstall.

ok florian, sthen

Comments
  1. By Hip Today (hiptoday) on

    Man, I could've used this a few releases ago! After many years of sysupgrades I got complacent and stopped bothering to check free space in /usr and eventually borked my system. I have since moved to new hardware with a bigger drive, but it was not a fun recovery. Hopefully these changes save somebody else the same fate.

  2. By Chris Bennett (chrisbennett) on

    This is superb. It gives RTFM as a perfect response on the mailing lists, rather than repeatedly explaining what is going on.
    I also like that this will fail gracefully. That's a nice touch.

  3. By Florida Gray Man (FLGrayMan) undeadly.tech@c.wearegross.com on

    This is good. For 7.7 I had to switch /usr and /tmp on my secondary router to do provide enough space for the upgrade. Then for 7.8 I had to do the same on the primary.

Credits

Copyright © - Daniel Hartmeier. All rights reserved. Articles and comments are copyright their respective authors, submission implies license to publish on this web site. Contents of the archive prior to as well as images and HTML templates were copied from the fabulous original deadly.org with Jose's and Jim's kind permission. This journal runs as CGI with httpd(8) on OpenBSD, the source code is BSD licensed. undeadly \Un*dead"ly\, a. Not subject to death; immortal. [Obs.]