Bug 3444 - Use sparse files for images
Summary: Use sparse files for images
Status: RESOLVED NOTABUG
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: deployment (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium enhancement
Target Milestone: 2.1 M3
Assignee: Ross Burton
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2012-11-15 18:21 UTC by Darren Hart
Modified: 2016-02-11 11:45 UTC (History)
2 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Yes (doc changes required)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Darren Hart 2012-11-15 18:21:01 UTC
Many of our images have a lot of empty space in them. There are projects around that take advantage of sparse files and filemaps to create a better image writer which only writes the necessary data to the target device. This should result in smaller images and faster device write times (and longer flash life as well).
Comment 1 Darren Hart 2013-07-19 01:09:56 UTC
Tom is going to try and find the MeeGo solution reference...
Comment 2 Ross Burton 2014-09-25 15:25:54 UTC
So the bare filesystem images are sparse already:

$ du -h core-image-sato-nuc-20140916184231.rootfs.ext3
444M	core-image-sato-nuc-20140916184231.rootfs.ext3
$ du -h --apparent-size core-image-sato-nuc-20140916184231.rootfs.ext3
984M	core-image-sato-nuc-20140916184231.rootfs.ext3

But when that gets wrapped up into a hddimg most of the sparseness disappears:

$ du -h core-image-sato-nuc-20140916184231.hddimg
1000M	core-image-sato-nuc-20140916184231.hddimg
$ du -h --apparent-size core-image-sato-nuc-20140916184231.hddimg
1014M	core-image-sato-nuc-20140916184231.hddimg
Comment 3 Ross Burton 2016-02-11 11:45:47 UTC
*Most*, this is due to wrapping an ext in a fat in a...  and it's filesystems all the way down.

There's a problem with wic in that it *doesn't* do sparse, but there's a patch for that already.