Bug 497377

Summary: livecd-tools should do at least a final fsck on the created image
Product: [Fedora] Fedora Reporter: Eric Sandeen <esandeen>
Component: livecd-toolsAssignee: Jeremy Katz <katzj>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 11CC: c.shoemaker, davidz, katzj
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 498475 (view as bug list) Environment:
Last Closed: 2009-07-21 18:31:33 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Eric Sandeen 2009-04-23 15:43:00 UTC
To catch things like bug #496982 before the corrupted images make it out to the user, I think that the __resize_filesystem and __resize_to_minimal methods should fsck the filesystem post-resize, or at least a fsck of the final image should happen some time prior to the process completion, and the whole endeavour should fail if a fsck is not clean...

I hacked up a patch something like:

--- imgcreate/fs.py.orig	2009-04-14 13:05:52.000000000 -0500
+++ imgcreate/fs.py.	2009-04-23 10:35:29.610358871 -0500
@@ -395,8 +395,9 @@
             self.disk.expand(size)
 
         self.__fsck()
-
         resize2fs(self.disk.lofile, size)
+        self.__fsck()
+
         return size
 
     def __create(self):
@@ -453,6 +454,7 @@
                 top = t
             else:
                 bot = t
+        self.__fsck()
         return top
 
     def resparse(self, size = None):

and it caught the corruption mentioned in bug #496982, although it didn't stop the process.

Even if this can't be formally added pre-f11-GA, I'd strongly recommend that the livecd image be hand-fsck'd before we ship it.

Thanks!

-Eric

Comment 1 Jeremy Katz 2009-04-23 16:37:58 UTC
Added in git.  And if we want to stop the process on certain return codes from fsck, just let me know what the exit codes to die on are.

Comment 2 Eric Sandeen 2009-04-23 16:45:58 UTC
       The  exit  code  returned by e2fsck is the sum of the following condi-
       tions:
            0    - No errors
            1    - File system errors corrected
            2    - File system errors corrected, system should
                   be rebooted
            4    - File system errors left uncorrected
            8    - Operational error
            16   - Usage or syntax error
            32   - E2fsck canceled by user request
            128  - Shared library error

I think I'd say anything other than 0 should stop the process, unless you think otherwise... maybe with a way to override it for "corrected" errors, since in the end the person running this tool can't control the kernel bugs ;)

Comment 3 Chris Shoemaker 2009-05-19 22:59:53 UTC
as long as we're checking error statuses, maybe we should check that the umount before the resize is actually successful (for example, that it didn't refuse to unmount because of open files).

Comment 4 Bug Zapper 2009-06-09 14:28:02 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle.
Changing version to '11'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 5 Jeremy Katz 2009-07-21 18:31:33 UTC
Closing out bug that's been in MODIFIED for a while.