Building images within a container fail due to size miscalculation
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
diskimage-builder |
In Progress
|
Undecided
|
Jamie Lennox |
Bug Description
When building Images within a container the target size calculated by `du -x` is incorrect and tiny, which results in a number of problems.
The first error message we see is: Journal size too big for filesystem
This seems to be because we are creating a file system of approximately 20mb when we intend to create something in the hundreds of mb, and so attaching a 64mb journal is a massive size difference that the tool won't create.
It appears that there is a current outstanding problem when using AUFS that the du -x flag (meaning don't cross filesystems) doesn't correctly report the files together hence our image size calculation is failing. [1]
At the point in the build where this image size calculation happens we don't have /dev /proc etc mounted so these shouldn't cause problems, however as pointed out by lifeless: "The -x is there so that if someone has mounted e.g. a apt or yum cache in one of the other hooks, we don't include it."
Changed in diskimage-builder: | |
assignee: | nobody → Jamie Lennox (jamielennox) |
status: | New → In Progress |
The suggestion from comment is to revert the -x removal when upstream has merged, but who knows how long that can take to get into stable kernels.
I think more likely we either:
1. Test aufs version and special case it to work around the bug.
2. Expect people to unmount volumes they don't want copied.
I think 2 is actually a more reasonable solution because the copy step appears to be executed not long after this step and it copies the image contents over regardless of filesystem and so it's possible that anything left mounted will be copied into an image that's too small. However i'm not familiar enough with the code to say that definitively.