Bug 1368595

Summary: livemedia-creator e2fsck -E discard does not actually delete unused blocks
Product: [Fedora] Fedora Reporter: Chris Murphy <bugzilla>
Component: loraxAssignee: Brian Lane <bcl>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 25CC: anaconda-maint-list, bcl
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-12-12 10:25:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Chris Murphy 2016-08-19 21:19:36 UTC
Description of problem:

This commit adds 'e2fsck -E discard' which doesn't do what it's intended to do except on SSD's and LVM thin p.

https://github.com/rhinstaller/lorax/pull/82/commits/ba4218ea982790b116926b869bf114fbd6c42668

Eric Sandeen and I tested it today, and it definitely does not punch out blocks on loop mounted files. Whereas fstrim on the mounted volume does work.

The following images were fallocated, formatted ext4, and a single ~500MiB file was copied to each fs and then deleted. And then as the name suggests discard.img = e2fsck -E discard, and fstrim.img = fstrim <mountpoint>, and nodiscardortrim.img has had neither e2fsck or fstrim applied.


[root@f24s 0]# ls -lsh /mnt/0
total 1.3G
571M -rw-r--r--. 1 root root 5.0G Aug 19 10:57 discard.img
130M -rw-r--r--. 1 root root 5.0G Aug 19 10:58 fstrim.img
571M -rw-r--r--. 1 root root 5.0G Aug 19 10:57 nodiscardortrim.img
[root@f24s 0]# gzip discard.img
[root@f24s 0]# gzip fstrim.img
[root@f24s 0]# gzip nodiscardortrim.img

# Then compress everything with gzip.

[root@f24s 0]# ls -lsh
total 863M
429M -rw-r--r--. 1 root root 429M Aug 19 10:57 discard.img.gz
5.0M -rw-r--r--. 1 root root 5.0M Aug 19 10:58 fstrim.img.gz
429M -rw-r--r--. 1 root root 429M Aug 19 10:57 nodiscardortrim.img.gz


So pretty clearly e2fsck -E discard isn't doing what's intended. Use fstrim instead.



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


How reproducible:
Always


Steps to Reproduce:
1. e2fsck -E discard on anything other than LVM thinp or SSD.
2.
3.

Actual results:

Nothing.

Expected results:

Maybe it should punch out those blocks so the backing file gets sparse fragments, and thus saves space. But it doesn't and I guess the e2fsck code is insane, unclear whether this will be fixed especially since fstrim does work. So just use fstrim instead, plus this command is file system agnostic should some other file system end up being used for the resulting rootfs.img.


Additional info:


The main difference is that fstrim needs to happen before umount.

Comment 1 Fedora End Of Life 2017-11-16 19:41:19 UTC
This message is a reminder that Fedora 25 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 25. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '25'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 25 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 2 Fedora End Of Life 2017-12-12 10:25:17 UTC
Fedora 25 changed to end-of-life (EOL) status on 2017-12-12. Fedora 25 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.