Bug 31067 - Check free disk space before extracting a downloaded image
Check free disk space before extracting a downloaded image
Status: CLOSED FIXED
Product: Z_Univention Corporate Client (UCC)
Classification: Unclassified
Component: Image management
unspecified
Other Linux
: P5 normal
: UCC 2.0
Assigned To: Alexander Kläser
Moritz Muehlenhoff
: interim-3
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-04-16 09:16 CEST by Janis Meybohm
Modified: 2014-06-12 09:19 CEST (History)
2 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Janis Meybohm univentionstaff 2013-04-16 09:16:23 CEST
<http://forum.univention.de/viewtopic.php?f=64&t=2523&p=8619>

ucc-thinclient-image, ucc-desktop-image and/or ucc-image-download should check if there is enough free disk space before downloading/extracting the image.
Comment 1 Moritz Muehlenhoff univentionstaff 2014-05-05 12:58:00 CEST
The check for free disk space in the download tool is already implemented, it only needs to consider some margin for the uncompression:

vfs = os.statvfs(image_directory)
free_diskspace = vfs.f_frsize * vfs.f_bfree

if (free_diskspace < spec['total-size']):
        print "Not enough free diskspace to download the image"
        print "Needed: ", spec['total-size']
        print "Available: ", free_diskspace
        sys.exit(1)
Comment 2 Alexander Kläser univentionstaff 2014-05-06 12:29:00 CEST
As discussed, the following behaviour has been implemented along with Bug 30379. The disk space is checked before downloading the files. When extracting, an IOError is caught (i.e., when running out of disk space) and the uncompressed file is being removed. That should be sufficient for now.
Comment 3 Moritz Muehlenhoff univentionstaff 2014-05-09 09:48:19 CEST
The error is caught and the not-fully-uncompressable image is removed.
Comment 4 Moritz Muehlenhoff univentionstaff 2014-06-12 09:19:47 CEST
UCC 2.0 has been released:
 http://docs.univention.de/release-notes-ucc-2.0.html

If this error occurs again, please use "Clone This Bug".