Bug 185676

Summary: freebsd-update(8) claimed success even though install ran out of disk space
Product: Base System Reporter: Matt Emmerton <matt>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Open ---    
Severity: Affects Only Me CC: gndaryee, grahamperrin, jsellens, markj, trash
Priority: Normal Keywords: patch
Version: 9.1-RELEASE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Add error message and exit for failing install.
none
FIXED Add error message and exit for failing install. none

Description Matt Emmerton 2014-01-12 07:50:00 UTC
I was using freebsd-update to move to 9.2:

# freebsd-update -r 9.2-RELEASE upgrade

Ran through all the merging no problem, and then went to install:

# freebsd-update install

Installing updates...
/: write failed, filesystem is full
install: ///boot/kernel/INS@bBbO: No space left on device

Kernel updates have been installed.  Please reboot and run
"/usr/sbin/freebsd-update install" again to finish installing updates.

OMG!  Rebooting would likely have been fatal at that point.  And yes, my root FS was full:

olympia# df -k
Filesystem  1024-blocks      Used    Avail Capacity  Mounted on
/dev/ad0s1a      507630    487372   -20352   104%    /
devfs                 1         1        0   100%    /dev
procfs                4         4        0   100%    /proc
/dev/ad0s1e      507630     18608   448412     4%    /tmp
/dev/ad0s1f    34443364   1377450 30310446     4%    /usr
/dev/ad0s1d     1469326   1057210   294570    78%    /var
/dev/ad4s1d   946031670 820026292 50322846    94%    /bigvol1

After cleaning up root (had some old kernels hanging around) and re-running the install everything was fine.

Since "freebsd-update install" knows how much space is needed for the new kernel, could it not check for adequate space up-front?  (Same holds true for most other files, too.)

Fix: 

Ensure adequate disk space prior to running freebsd-install.
How-To-Repeat: Fill up root filesystem.
Run freebsd-update install.
See failures yet claims of success.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2014-04-14 00:27:34 UTC
Responsible Changed
From-To: freebsd-bugs->cperciva

Over to maintainer.
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:00:49 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped
Comment 3 Gerald Aryeetey 2019-01-14 19:17:37 UTC
Created attachment 201137 [details]
Add error message and exit for failing install.

This is probably because "install_files" does not captures errors when copying/installing files. This patch should update it to ensure these errors are caught and give users a potential remedy.
Comment 4 Mark Johnston freebsd_committer freebsd_triage 2019-01-14 20:01:10 UTC
(In reply to Gerald Aryeetey from comment #3)
Seems reasonable to me; there is a typo in the error message, "BASEDDIR".
Comment 5 Gerald Aryeetey 2019-01-14 20:34:09 UTC
Created attachment 201139 [details]
FIXED Add error message and exit for failing install.

Updated patch to fix typo
Comment 6 Gerald Aryeetey 2019-01-14 20:35:36 UTC
Also this report is likely a duplicate of this one: bug #164131
Comment 7 Mark Johnston freebsd_committer freebsd_triage 2019-01-14 20:43:18 UTC
*** Bug 164131 has been marked as a duplicate of this bug. ***
Comment 8 Ed Maste freebsd_committer freebsd_triage 2019-01-24 22:22:46 UTC
*** Bug 186278 has been marked as a duplicate of this bug. ***