Bug 896215 - RFE: use fstrim to shrink images instead of device-mapper shenanigans
Summary: RFE: use fstrim to shrink images instead of device-mapper shenanigans
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: livecd-tools
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Brian Lane
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-01-16 20:49 UTC by Bill Nottingham
Modified: 2014-10-07 23:08 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-10-07 23:08:51 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Bill Nottingham 2013-01-16 20:49:17 UTC
Description of problem:

def create_image_minimizer(path, image, compress_type, target_size = None,
                           tmpdir = "/tmp"):
    """
    Builds a copy-on-write image which can be used to
    create a device-mapper snapshot of an image where
    the image's filesystem is as small as possible

    The steps taken are:
      1) Create a sparse COW
      2) Loopback mount the image and the COW
      3) Create a device-mapper snapshot of the image
         using the COW
      4) Resize the filesystem to the minimal size
      5) Determine the amount of space used in the COW
      6) Restroy the device-mapper snapshot
      7) Truncate the COW, removing unused space
      8) Create a squashfs of the COW
    """

Ew.

Instead, to shrink the live filesystem in use, it should just use fstrim(8) from util-linux. Should be much simpler.

Version-Release number of selected component (if applicable):

looking at git

Comment 1 Brian Lane 2013-12-19 21:39:57 UTC
Actually, this whole part can now be eliminated. Anaconda uses rsync to copy the filesystem (which is using squashfs so it is small on the iso) so we no longer need the minimized COW which was needed when directly copying blocks.


Note You need to log in before you can comment on or make changes to this bug.