out of disk space needs better handling

Bug #1630145 reported by I Ahmad
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
snapd
Triaged
Medium
Unassigned

Bug Description

snap system gives irrelevant error messages when the SD card gets out of space.

Steps to reproduce:

1. Flash and boot the ubuntu-core 16 image on dragonboard
2. Run the command df -h to list the available space on various mounted partitions
3. Using fallocate, occupy all the available space on /writable partition
4. Install some snaps to occupy the remaining space to make sure df -h output is similar to http://paste.ubuntu.com/23273852/

5. There would be a point where, snap install and other snap commands would start failing with following error

error: cannot communicate with server: Post http://localhost/v2/snaps: EOF

even sudo snap remove would not work to free up the space as can be seen in above pastebin

This can be reproduced on kvm as well by following same steps above.

Revision history for this message
Gustavo Niemeyer (niemeyer) wrote :

It's hard to do a great job on actual out-of-space, but we should at least try to avoid getting snapd into the situation via its own means.

For that, the first step is probably to preempt better the case of space getting short, and not allow installs/refreshes while the situation isn't sorted.

Revision history for this message
Oliver Grawert (ogra) wrote :

ogra@dragon:~$ sudo dumpe2fs -h /dev/mmcblk0p2|grep "Reserved blocks"
dumpe2fs 1.42.13 (17-May-2015)
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)

looks like ubuntu-image does not actually set any reserved blocks when creating the file system, i wonder if this could help out here ...

could you also post the exact fallocate command you used for reproducing it ?

Revision history for this message
Gustavo Niemeyer (niemeyer) wrote :

This helps in some cases and should definitely be fixed. Otherwise anything on the machine can run the system out of space.

Revision history for this message
I Ahmad (iahmad) wrote :

Running df -h gives an idea about the available space and then I used the fallocate like

fallocate -l 6G tempfile, e.g. to allocate 6G of writable area

but that won't be enough you may have to install some snaps afterwards to occupy the remaining/reserve space before you reach to the point where it starts giving 'cannot communicate with server' error.

Dave Morley (davmor2)
Changed in snappy:
status: New → Confirmed
Oliver Grawert (ogra)
summary: - out of disk space needs better handling
+ ubuntu-image should add the regular 5% reserved space for root when
+ creating filesystem for /writable
Revision history for this message
Launchpad Janitor (janitor) wrote : Re: ubuntu-image should add the regular 5% reserved space for root when creating filesystem for /writable

Status changed to 'Confirmed' because the bug affects multiple users.

Oliver Grawert (ogra)
affects: subiquity (Ubuntu) → ubuntu-image (Ubuntu)
Changed in ubuntu-image (Ubuntu):
status: New → Confirmed
Revision history for this message
Gustavo Niemeyer (niemeyer) wrote :

Let's please keep the original topic as handling space issues in snapd needs to be improved indeed.

If there's a specific request about ubuntu-image, this needs another bug.

summary: - ubuntu-image should add the regular 5% reserved space for root when
- creating filesystem for /writable
+ out of disk space needs better handling
Revision history for this message
Barry Warsaw (barry) wrote :

Agreed w/ Gustavo. I am removing the ubuntu-image bugtask but if there's something specific u-i needs to do, please open a separate bug.

no longer affects: ubuntu-image (Ubuntu)
Revision history for this message
Oliver Grawert (ogra) wrote :

bug 1635258 is for reserving 5%

Changed in snappy:
importance: Undecided → Medium
status: Confirmed → Triaged
Michael Vogt (mvo)
affects: snappy → snapd
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.